coin-flipping

Trying to generate a conditional coin flip

Trying to generate a conditional coin flip Question: So I’m a trying to create a function which first flips an unbiased coin but if the result is heads it flips a biased coin with 0.75 probability of heads. If it shows tails then the next flip is unbiased. I’ve tried the following code but I …

Total answers: 3

convert an unfair coin into a fair coin in Python 2.7

convert an unfair coin into a fair coin in Python 2.7 Question: Using Python 2.7. Suppose I have an unfair coin and I want to turn it into a fair coin using the following way, Probability of generating head is equal for unfair coin; Flip unfair coin and only accept head; When a head is …

Total answers: 2

How do I simulate flip of biased coin?

How do I simulate flip of biased coin? Question: In unbiased coin flip H or T occurs 50% of times. But I want to simulate coin which gives H with probability ‘p’ and T with probability ‘(1-p)’. something like this: def flip(p): ”’this function return H with probability p”’ # do something return result >> …

Total answers: 7