Probability of getting $n$ heads from multiple coins each tried several times

binomial distributionprobability

Assume we have 10 coins, and each has its own probability of getting a head. We toss each coin a different number of times, say 10 times for the first coin, 15 times for the second coin, and so on. What is the probability of getting a head at least once in at least 5 different coins?

My thinking is that the probability for getting at least one head from a coin tossed $k$ times with a head probability of $p$ can be computed from the binomial distribution. Example R code:

sum(dbinom(1:k, k, p))

But I don't know how to generalize it to multiple coins mathematically or computationally.

Best Answer

Let the number of coins be $K$ and the probability to toss head with $i$-th coin be $p_i$, so that the corresponding probability to toss $N_i$ tails is $(1-p_i)^{N_i}\equiv Q_i$. Then assuming that $Q_i\ne0\ (\iff p_i\ne1)$ the probability that at least $k$ coins at least once showed up head is: $$ 1-\prod_i Q_i\sum_{S\in\mathbb P({\cal K})}^{|S|<k}\prod_{s\in S}\frac{1-Q_{s}}{Q_{s}}, $$ where the sum runs over all subsets $S=(s_1,s_2,\dots s_{|S|})$ of the set ${\cal K}=\{1,2\dots K\}$ with cardinality $|S|$ being less than $k$, and the inner product runs over all elements of the given subset.