# How do I derive this expression for conditional probability?

#### Eclair_de_XII

Problem Statement
"Let $Y_i$ be independent Bernoulli r.v.'s. Let $T=1$ if $Y_1=1$ and $Y_2=0$ and $T=0$ otherwise. Let $W=\sum Y_i$. Prove that $P(T=1|W=w)=\frac{w(n-w)}{n(n-1)}$.
Relevant Equations
$P(A|B)=\frac{P(A\cap B)}{P(B)}$
An answer from another part in the problem: $E(T)=p(1-p)$
$P(T=1|W=w)=\frac{P(\{T=1\}\cap\{W=w\})}{P(W=w)}=\frac{\binom {n-2} {w-1} p^{w-1}(1-p)^{(n-2)-(w-1)}}{\binom n w p^w (1-p)^{n-w}}=\frac{(n-2)!}{(w-1)!(n-w-1)!}\frac{w!(n-w)!}{n!}\frac{1}{p(1-p)}=\frac{w(n-w)}{n(n-1)}(p(1-p))^{-1}$.

I cannot seem to get the terms with $p$ out of my expression.

Related Calculus and Beyond Homework News on Phys.org

#### Math_QED

Homework Helper
Problem Statement
"Let $Y_i$ be independent Bernoulli r.v.'s. Let $T=1$ if $Y_1=1$ and $Y_2=0$ and $T=0$ otherwise. Let $W=\sum Y_i$. Prove that $P(T=1|W=w)=\frac{w(n-w)}{n(n-1)}$.
Relevant Equations
$P(A|B)=\frac{P(A\cap B)}{P(B)}$
An answer from another part in the problem: $E(T)=p(1-p)$

$P(T=1|W=w)=\frac{P(\{T=1\}\cap\{W=w\})}{P(W=w)}=\frac{\binom {n-2} {w-1} p^{w-1}(1-p)^{(n-2)-(w-1)}}{\binom n w p^w (1-p)^{n-w}}=\frac{(n-2)!}{(w-1)!(n-w-1)!}\frac{w!(n-w)!}{n!}\frac{1}{p(1-p)}=\frac{w(n-w)}{n(n-1)}(p(1-p))^{-1}$.

I cannot seem to get the terms with $p$ out of my expression.

For $w \geq 1$, we have:

$P(T=1, W = w) = P(Y_1 = 1, Y_2 = 0, \sum_{i=3}^n Y_i = w-1) = P(Y_1 = 1)P(Y_2 = 0)P(\sum_{i=3}^n Y_i = w-1)$ (here the independence of $(Y_n)_n$ was crucial) and the first two factors give the factor $p(1-p)$ that you are missing.

For $w=0$, it is easily checked that the equality you want to prove holds as well.

#### Eclair_de_XII

Okay, thanks.

"How do I derive this expression for conditional probability?"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving