The probability that $0$ occurs exactly twice in $x^n$

58 Views Asked by At

Consider a binary random variable $X$ taking value over $\mathcal{X} = \{0,1\}$ with probabilities $P_X(1)=aP_X(0)$ (with $a>0$) and an i.i.d. sequence of length $n$ denoted by $x^n = (x_1,...,x_n)$. If we know that $0$ occurs in the $m$-th output ($1\leq m < n$) for the first time, what is the probability that $0$ occurs exactly twice in $x^n$?

We know that the probability distribution $P_X(x)$ has to fulfill $\sum_{x\in\mathcal{X}} P_X(x)=1$. Therefore,

$$P_X(0)+P_X(1)=1$$ $$P_X(0)+aP_X(0)=1$$ $$P_X(0)(a+1)=1$$ $$P_X(0)=\frac{1}{1+a} \;\;\; and \;\;\; P_X(1)=\frac{a}{1+a}$$

I know that the probability that there is a 0 in a sequence $x^n$ is $P_{x^n}[t(1,n-1)]= {n\choose 1}P_X(0)P_X(1)^{n-1}=nP_X(0)P_X(1)^{n-1}$. But I am not sure how to compute the probability that 0 occurs exactly twice in $x^n$. It is not $P_{x^n}[t(2,n-2)]$, is it?

1

There are 1 best solutions below

0
On BEST ANSWER

The probability that you want is the probability that $X=0$ exactly one time in the interval $[m+1,n]$ That is $P=(n-m)P_X(0)P_X(1)^{n-m-1}$, given the condition that the first $0$ is at $m$.