# Conditional probability of tossing coins with uncertain head probability

Suppose there are two coins A and B. When tossing a coin $$i$$, "head" happens with probability $$p_i$$.

The problem is that $$p_i$$ itself is a random variable. Say that the associated probability density function is given by $$f_i$$ for coin $$i$$.

We also know the conditional probability $$f_{p_A|p_B=p}$$.

In this setting, what is the formula to compute the probability of head for coin A given that coin B showed head? i.e., $$P[A:Head|B:Head]$$?

## 1 Answer

We can use conditional probability formula to get what we want: $$P(A:Head|B:Head)=\frac{P(A:Head\cap B:Head)}{P(B:Head)}$$

First we condition on $$p_a,p_b$$ (using lowercase for notational simplicity), and use total probability law: $$P(A:Head\cap B:Head)=\int P(A:Head\cap B:Head \ \vert\ p_a,p_b)f_{P_a,P_b}(p_a,p_b)dp_adp_b$$

$$P(A:Head\cap B:Head|p_a,p_b)$$ simplifies to $$p_ap_b$$ because we don't need anything else other than the head probabilities, i.e. the events are conditionally independent given the $$p_i$$'s. Also, the joint density can be written as $$f_{P_a,P_b}(p_a,p_b)=f_{P_a|P_b}(p_a|p_b)f_{P_b}(p_b)$$. The final expression is something like: $$P(A:Head\cap B:Head)=\int p_ap_b f_{P_a|P_b}(p_a|p_b)f_{P_b}(p_b)dp_adp_b=E[P_aP_b]$$ Similarly, we could find $$P(B:Head)=\int P(B:Head|p_b)f_{P_b}(p_b)dp_b=E[P_b]$$

• I think you have assumed that the two coins are independent to each other? Is that why you have $P(A:H~and~B:H)=\int p_ap_b f_{p_ap_b}(p_a,p_b)dp_adp_b$? Does this also work for possibly correlated case? – Andeanlll Sep 12 '19 at 2:00
• No I haven't assumed it, if they were independent, I'd have written $$P(A:Head|B:Head)=P(A:Head)$$ However, note that "given" their head probabilities, they're independent. – gunes Sep 12 '19 at 8:19
• Alright! Thanks for the clarification :) – Andeanlll Sep 13 '19 at 4:29
• Sorry for keep posting comments, but one last question for clarification. $P_A$ and $P_B$ are random variables here. So, shouldn't $P_A|P_B$ also be an RV? Can we take $E[P_A|P_B]=\frac{E[P_AP_B]}{E[P_B]}?$ – Andeanlll Sep 18 '19 at 3:22
• Yes, $P_A|P_B$ represents a random variable. But, the expectation you wrote is wrong. – gunes Sep 18 '19 at 3:56