Skip to content
Advertisement

Tag: coin-flipping

How do I simulate flip of biased coin?

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: Answer random.random() returns a uniformly distributed pseudo-random floating point number in the range [0, 1). This number is less than a given number p in the range [0,1) with

Advertisement