Consider a collection of n biased coins, each showing Heads with probability p and Tails with probability 1-p , independently of the others. The coins are tossed and all coins showing Heads are collected together and tossed again. Write down an expression for the probability mass function of the random variable representing the number of Heads that turn up in the second round of tosses. Hint: Condition on the results of the first round of tosses using the “total probability" formula.

To find the probability mass function of the random variable representing the number of Heads in the second round of tosses, we can condition on the outcomes of the first round of tosses using the total probability formula.

Let X be the random variable representing the number of Heads in the second round of tosses.

We can express the probability of X = k, where k is a non-negative integer, as the sum of probabilities over all possible outcomes in the first round of tosses that result in k Heads in the second round.

Using the total probability formula, we have:

P(X = k) = P(X = k | H in first round) * P(H in first round) + P(X = k | T in first round) * P(T in first round)

Now, let's consider the two cases:

1. When there is at least one Head in the first round of tosses:
- In this case, we need to consider the probability of getting exactly k-1 Heads in the first round of tosses and getting 1 Head in the second round. This can be expressed as P(X = k | H in first round) = (k-1)C(k-1) * p^(k-1) * (1-p).
- The probability of getting at least one Head in the first round is P(H in first round) = 1 - P(T in first round) = 1 - (1-p)^n.

2. When there are no Heads in the first round of tosses:
- In this case, in order to have X = k in the second round, we need to have exactly k Heads in the first round. This can be expressed as P(X = k | T in first round) = (nCk) * p^k * (1-p)^(n-k).
- The probability of getting no Heads in the first round is P(T in first round) = (1-p)^n.

Putting it all together, the probability mass function of X is:

P(X = k) = ((k-1)C(k-1) * p^(k-1) * (1-p)) * (1 - (1-p)^n) + (nCk) * p^k * (1-p)^(n-k) * (1-p)^n

Simplifying further, we get:

P(X = k) = (k-1)C(k-1) * p^(k-1) * (1-p)^n - (nCk) * p^k * (1-p)^(2n-k) * (1-p)^n

To find the probability mass function (pmf) of the random variable representing the number of Heads in the second round of tosses, we need to consider the results of the first round of tosses and condition our calculation based on that information.

Let's denote the random variable representing the number of Heads in the second round of tosses as X. We want to find P(X = k), i.e., the probability that exactly k Heads turn up in the second round.

To derive the expression for this probability, we can use the Law of Total Probability. It states that for any event A and a partition (disjoint subsets) B₁, B₂, ..., Bn of the sample space, the probability of event A can be expressed as the sum of probabilities conditional on the various subsets:

P(A) = P(A ∩ B₁) + P(A ∩ B₂) + ... + P(A ∩ Bn)

In this case, we can partition the results of the first round of tosses into two subsets: those that resulted in Heads (H) and those that resulted in Tails (T). Let's denote these events as A and B, respectively.

Now, we can express the probability of X = k using the total probability formula:

P(X = k) = P(X = k ∩ A) + P(X = k ∩ B)

To calculate the conditional probabilities P(X = k ∩ A) and P(X = k ∩ B), we need to determine the probabilities associated with each case.

1. Probability of X = k ∩ A (Number of Heads in the second round = k, given that we collected the coins showing Heads in the first round):
To calculate this probability, we need to consider k out of the n coins showing Heads and the remaining (n - k) coins showing Tails. The probability of k Heads and (n - k) Tails in the second round can be calculated using the binomial distribution, with the probability of a single coin showing Heads being p.

So, P(X = k ∩ A) = (n choose k) * p^k * (1-p)^(n-k)

2. Probability of X = k ∩ B (Number of Heads in the second round = k, given that we collected the coins showing Tails in the first round):
In this case, all the coins from the first round showed Tails, so there can be no Heads in the second round. Therefore, P(X = k ∩ B) = 0.

Now, we can write the expression for the probability mass function of X:

P(X = k) = P(X = k ∩ A) + P(X = k ∩ B)
= (n choose k) * p^k * (1-p)^(n-k)

This expression gives the probability that exactly k Heads turn up in the second round of tosses, taking into account the results of the first round of tosses.