1) Choose your language.
2) study how rand is working in that language.
Quote:implement a biased coin that outputs 1 with probability p and 0 with probability 1–p.
the important word is 'biased'. This imply a 2 step drawing.
Say the odds are 0.33 and 0.67.
- draw a random number
- check the random against odds and decide of the result.
We do not do your HomeWork.
So just a few hints.