# How write down joint PMF, conditinals and marginals of Bernoulli and Binomial random variables?

I have the following problem, where I'd like to know whether I'm doing it right and whether the notation of the joint PMF is correct.

One of two doctors, Dr. Hibbert and Dr. Nick, is called upon to perform a series of $n$ surgeries. Let $H$ be the indicator random variable for Dr. Hibbert performing the surgeries, and suppose that $E(H) = p$. Given that Dr. Hibbert is performing the surgeries, each surgery is successful with probability $a$, independently. Given that Dr. Nick is performing the surgeries, each surgery is successful with probability $b$, independently. Let $X$ be the number of successful surgeries.

(a) Find the joint PMF of H and X.

(b) Find the marginal PMF of X.

(c) Find the conditional PMF of H given X = k.

a) $$P(X=x, H=h) = \left( \binom{n}{x} a^x(1-a)^{n-x} \cdot p \right)^{h} + \left( \binom{n}{x} b^x(1-b)^{n-x} \cdot (1-p) \right)^{1-h}$$

b) $$P(X=x) = \sum_{h=0}^1 P(X=x, H=h) = \binom{n}{x} \left( a^x(1-a)^{n-x} \cdot p + b^x(1-b)^{n-x} \cdot (1-p) \right)$$

c) $$P(H=1|X=x) = \frac{1}{1 + \frac{1-p}{p} (\frac{b}{a})^x (\frac{1-b}{1-a})^{n-x}}$$

• What's r.v. indicator, and $I(h)$? – Vladimir Vargas Dec 29 '14 at 22:05
• I edited it. r.v. = random variable, $I(h)$ is actually not necessary. – NoBackingDown Dec 29 '14 at 22:09

## 1 Answer

a) should read: $$P(X=x, H=h) = \binom{n}{x} \left( a^x(1-a)^{n-x} \cdot p \right)^{h} \cdot \left(b^x(1-b)^{n-x} \cdot (1-p) \right)^{1-h}$$

b) is correct: $$P(X=x) = \sum_{h=0}^1 P(X=x, H=h) = \binom{n}{x} \left( a^x(1-a)^{n-x} \cdot p + b^x(1-b)^{n-x} \cdot (1-p) \right)$$

c) should read: $$P(H=1|X=x) = \frac{a^x(1-a)^{n-x} \cdot p}{a^x(1-a)^{n-x} \cdot p +b^x(1-b)^{n-x} \cdot (1-p)}$$ $$P(H=0|X=x) = \frac{b^x(1-b)^{n-x} \cdot (1-p)}{a^x(1-a)^{n-x} \cdot p +b^x(1-b)^{n-x} \cdot (1-p)}$$

• The reason why @Did uses multiplication instead of addition is because if $h = 0$ in the expression using addition, the first term is $1$, not zero; and when $h = 1$, the second term is $1$, not zero, and you would get a probability exceeding $1$ in either case. – heropup Dec 29 '14 at 22:39
• @heropup Thanks (although I would not say this is the reason, rather some post hoc confirmation). – Did Dec 30 '14 at 8:37