1
$\begingroup$

There are $K$ bags of coins, each bag contains $m_k$ ($k=1,\dots,K$) coins, and thus we have $M:=\sum_{k=1}^K m_k$ coins in total.

Coins in the $k$-th bag satisfies $P(\text{H})=p_k$, $P(\text{T})=1-p_k$ (here, H and T stands for head and tail).

The question is, what is the probability of getting $N$ heads when we toss these $M$ coins?


Collection of my thoughts:

We have $k=1,\dots,K$ of bags, and there are in total $\frac{(K+N)!}{K!N!}$ ways of getting $N$ heads from different bags.

For $k$-th bag, suppose we have $n_k$ heads. Then, there are $\frac{(K-1+N-n_k)!}{(K-1)!(N-n_k)!}$ ways of getting $N-n_k$ from other bags.

For $k$-th bag, the probability of getting $n_k$ heads is${m_k \choose n_k} p_k^{n_k}(1-p_k)^{m_k-n_k}$.

etc., but I am not convinced or I cannot get it right.

  • 0
    Fix $(n_1, n_2, \dots, n_k)$ such that $n_1 + \dots + n_k = N$, and calculate the probabilities. See if the expressions add up to anything nice. (Alternative hint: Consider the generating function $\prod_{k=1}^{K}(p_kz + 1-p_k)^{m_k}$.) Either way, you won't get a perfectly nice expression, but I don't know whether this is a question that came up in some test, or in real life.2017-02-16
  • 0
    @ShreevatsaR Hm, thanks for comment, but I guess I get stack at moving $(n_1,\dots,n_k)$ phase, as $(n_1,\dots,n_k)$ being fixed it is essentially the same as the usual binomial thing. Also, I think the pgf is the same as $\prod_{k=1}^K[(\sum_{j=0}^{m_k} {m_k\choose j} p_k^j (1-p_k)^{m_k-j} )z^j]$, which looks like a pgf of a bigger binomial distribution with different parameters $(m_k,p_k)$. This seems to be sort of a natural generalization, but I don't see how to verify this. (Since the sum depends on $k$, I cannot rewrite this as the series expansion, which is the definition of pgf).2017-02-16
  • 0
    What is the motivation for this question BTW? Did someone ask you this question (in a textbook, test, homework), or did it come up when trying to do something else (in which case there may be a better way to do that than answering this question exactly)?2017-02-16
  • 0
    BTW, the answer to your question is $$\sum_{\substack{(n_1, \dots, n_k) \\ n_1 + \dots + n_k = N}} {m_k \choose n_k} p_k^{n_k}(1-p_k)^{m_k-n_k}$$ and it cannot be substantially simplified. In terms of generating functions, we can say that the answer is the coefficient of $z^N$ in $\prod_{k=1}^{K}(p_kz + 1-p_k)^{m_k}$. I get the impression you're looking for something "simpler" than this, which doesn't exist – that's why I asked for the motivation.2017-02-16
  • 0
    If it helps, think of just the case when $K = 2$.2017-02-16
  • 0
    @ShreevatsaR No I am just to playing around with the idea just for the sake of it>motivation. But thanks! It looks nice enough.2017-02-17
  • 0
    I've posted the expression from the above comments as an answer (after fixing a typo: the product was missing). If it looks fine to you, please "accept" the answer by clicking on the check mark. That way, this question will not appear in the list of "unanswered" questions.2017-02-17

1 Answers 1

1

Your thoughts are along the right lines, particularly this:

For the $k$-th bag, the probability of getting $n_k$ heads is ${m_k \choose n_k} p_k^{n_k}(1-p_k)^{m_k-n_k}$.

The only remaining thing is: what can the values of $n_k$ be, so that the total number of heads is $N$? Well, the only constraint is that $n_1 + n_2 + \dots + n_K$ (which is the total number of heads) must be equal to $N$. If you fix any such tuple $(n_1, \dots, n_K)$, then the probability from each bag is ${m_k \choose n_k} p_k^{n_k}(1-p_k)^{m_k-n_k}$, and the total probability is their product as the bags are independent. In other words, the answer is:

$$\sum_{\substack{(n_1, \dots, n_K) \\ n_1 + \dots + n_K = N}} \prod_{k=1}^K {m_k \choose n_k} p_k^{n_k}(1-p_k)^{m_k-n_k}$$


There is another way to express this: the probability generating function for a particular coin in the $k$th bag turning heads is $(p_kz + 1-p_k)$. As all coins are independent, the probability-generating function for all your coins is the product of this expression over all $M$ coins, namely $$\prod_{k=1}^{K} (p_kz + 1-p_k)^{m_k}$$ and the probability you want is the coefficient of $z^N$ in the above.