1

We have $M$ coins, with biases $p_1,\dots,p_M$. I draw all of them and count the total number of heads. What's the probability of observing $K$ heads?

I realize the solution can be formally written as follows:

$$P(K) = (1-p_1)\dots(1-p_M) \sum_{1 \le i_1<\dots<i_K \le M} \frac{p_{i_1}\dots p_{i_K}}{(1-p_{i_1})\dots (1-p_{i_K})}$$

where the sum goes over all ordered tuples $(i_1,\dots,i_K)$, satisfying $1 \le i_1 < \dots < i_K \le M$.

The question I'm interesting in, is whether an efficient algorithm to compute $P(K)$ exists?

More precisely, is there an efficient routine that, given $p_1,\dots,p_M$ and $K$ as inputs, is able to compute $P(K)$, as defined above efficiently?

I'm being intentionally loose on the meaning of "efficiency" here, since I'm not sure what to expect in terms of computational complexity. I'd be satisfied with seeing methods to compute $P(K)$ that are "reasonably" faster than the the expression I've given above.

a06e
  • 6,665
  • 1
    In the notation of the duplicate post, $$\sum_{1\le i_1<\dots<i_k\le M}\frac{p_{i_1}\cdots p_{i_K}}{(1-p_{i_1})\cdots(1-p_{i_K})}=\sigma_M^K\left(\frac{p_1}{1-p_1},\dots,\frac{p_M}{1-p_M}\right)$$ – Mike Earnest Feb 17 '23 at 16:59
  • @MikeEarnest Thanks! Indeed, it's just a determinant! – a06e Feb 17 '23 at 17:05
  • Related: https://stats.stackexchange.com/q/637645/5536 – a06e Jan 26 '24 at 15:54

0 Answers0