Flipping a set of unfair coins [closed]

Let $X$ be the number of heads we observe.

Suppose we wish to find $P(X=3)$

There are ${5 \choose 3}=10$ ways to select the coins that will show up as heads. In particular

$$H_1H_2H_3$$

$$H_1H_2H_4$$

$$H_1H_2H_5$$

$$H_1H_3H_4$$

$$H_1H_3H_5$$

$$H_1H_4H_5$$

$$H_2H_3H_4$$

$$H_2H_3H_5$$

$$H_2H_4H_5$$

$$H_3H_4H_5$$

The respective probabilities for these are

$$P(H_1H_2H_3)=0.38\cdot0.18\cdot0.71\cdot0.34\cdot0.71$$

$$P(H_1H_2H_4)=0.38\cdot0.18\cdot0.29\cdot0.66\cdot0.71$$

$$P(H_1H_2H_5)=0.38\cdot0.18\cdot0.29\cdot0.34\cdot0.29$$

$$P(H_1H_3H_4)=0.38\cdot0.82\cdot0.71\cdot0.66\cdot0.71$$

$$P(H_1H_3H_5)=0.38\cdot0.82\cdot0.71\cdot0.34\cdot0.29$$

$$P(H_1H_4H_5)=0.38\cdot0.82\cdot0.29\cdot0.66\cdot0.29$$

$$P(H_2H_3H_4)=0.62\cdot0.18\cdot0.71\cdot0.66\cdot0.71$$

$$P(H_2H_3H_5)=0.62\cdot0.18\cdot0.71\cdot0.34\cdot0.29$$

$$P(H_2H_4H_5)=0.62\cdot0.18\cdot0.29\cdot0.66\cdot0.29$$

$$P(H_3H_4H_5)=0.62\cdot0.82\cdot0.71\cdot0.66\cdot0.29$$

Summing these, we get

$$P(X=3)\approx 0.286$$

Similarly, for finding $P(X=4)$, there are ${5 \choose 4}=5$ ways to pick the four successes and for finding $P(X=5)$, there are ${5 \choose 5}=1$ ways to pick the five successes.

These computations aren't very fun so perhaps a computer program can be implemented.


I get approximately 0.3841, according to this Python script which performs the necessary evaluation of cases:

def all_outcomes(num_coins) :
    return [[(m / 2**k) % 2 for k in range(num_coins)[::-1]] for m in range(2**num_coins)]

def at_least_three_heads(coll) :
    # assume list of 0 (tails) and 1 (heads)
    return sum(coll) >= 3


def joint_probability(outcome, coins) :
    ret = 1
    for (is_heads, p) in zip(outcome, coins) :
        ret *= (p if is_heads else 1-p)
    print outcome, ret
    return ret

def compute_probability(coins, success_fn) :
    outcomes = all_outcomes(len(coins))
    return sum([joint_probability(outcome, coins) for outcome in outcomes if success_fn(outcome)])


print compute_probability([0.38, 0.18, 0.71, 0.66, 0.29], at_least_three_heads)

This number makes sense, because most of your coins come up tails most of the time. For comparison, a toss of five fair coins will have three or more heads in half of all cases—there's either three or more heads, or three or more tails. So the probability for five fair coins is 0.5.


Well, the easiest method and most clear one I suppose would be casework. Complementary counting would give the same number of cases.

Find the probability of each of the following:

Try (1, 2, 3) heads and (4, 5) tails, or (1, 2, 4) heads and (3, 5) tails, etc.

Then do (1, 2, 3, 4) heads and (5) tails, etc.

Then do (1, 2, 3, 4, 5) heads.

Then add up the probabilities of everything. To make it easier, I suppose you can write a simple program or code, but this problem is pretty hard as the numbers you gave are pretty random.