For $n \geq 1$, let $X_1, X_2, \dots, X_n$ be a sequence of independent random variables each with a value equals $1$ or $0$ with probability $p$ and $q$, respectively.
If $N = \inf \{n \geq 0, Z_{n+1} = 1 \}$ such that $Z_n = \sum_{i=1}^n X_i Y_i$ and $Y_1, \dots, Y_n$ is a sequence of random variables defined exactly as the first sequence above "sequence of $X_i$" and independent of it.
Show that: $1.~~ p(\cap_{i=1}^n (X_i=x_i) /N=n) = \prod_{i=1}^n p(X_i=x_i /N=n).$
$2.~~ \forall i \in[1,n],~~p(X_i = 1/ N=n) = p(X_i=1 /X_iY_i=0) = \frac{p(1-q)}{1-pq}.$
$\Longrightarrow$ I tried with the first part as
\begin{eqnarray}
p(\cap_{i=1}^n (X_i=x_i) /N=n) &=& p((X_1=x_1 \cap X_2=x_2 \dots \cap X_n=x_n)/N=n)\\
&=& \frac{p((X_1=x_1 \cap X_2=x_2 \dots \cap X_n=x_n) \cap N=n)}{p(N=n)}\\
\text{after that I should say }\\
&=& p((X_1=x_1) /N=n) p((X_2=x_2) /N=n) \dots p((X_n=x_n) /N=n)\\
&=& \prod_{i=1}^n p(X_i=x_i /N=n)
\end{eqnarray}
But I don't know how to get this. I know that the sequence is independent but I don't see how I can use this property to arrive to the last two lines.
$\Longrightarrow$ For the second part, we know
$N \sim Geometric(pq)$, $Z_n \sim \text{Binomial}(n,pq)$ and $p(X_i =1)=p$ then
\begin{eqnarray}
p(X_i = 1/ N=n) &=& \frac{p(X_i=1 \cap N=n)}{p(N=n)}\\
&=& \vdots
\end{eqnarray}
and I don't know also how to continue from here. I really appreciate any help or hint
Best Answer
For the first one:
Notice first that $$N=n \iff (X_1 =0\cup Y_1=0)\cap(X_2 =0\cup Y_2=0) \cdots \cap(X_{n+1} =1\cap Y_{n+1}=1) $$
Let's abuse notation to abbreviate $p(x_i) = P(X_i = x_i)$ , $p(n)=P(N=n)$, etc. Then
$$p(x_i \mid n)=\frac{p(n\mid x_i) p(x_i)}{p(n)} \tag1$$
But, for $1\le i\le n$:
$$ \begin{align} p(n)&=(1-p^2)^n p^2 = q^{n}(1+p)^{n} p^2 \tag 2 \\ p(n\mid x_i)&=(1-p^2)^{n-1} p^2 q^{x_i} \tag 3 \\ p(x_i)&= p^{x_i} q^{1-x_i} = q \, (p/q)^{x_i} \tag 4 \end{align} $$
Hence
$$p(x_i\mid n)=\frac{q^{x_i} q \, (p/q)^{x_i}}{1-p^2}=p^{x_i} (1+p)^{-1} \tag 5$$ and $$\prod p(x_i \mid n) = p^{w_x} (1+p)^{-n} \tag 6$$ where $w_x=\sum x_i$ is the weight of the bistring ${\bf x}=(x_1 \cdots x_n)$
Now, we compute the joint prob:
$$p({\bf x}\mid n)=\frac{p(n\mid {\bf x}) p({\bf x})}{p(n)}$$
with
$$p({\bf x})=p^{w_x} \, q^{n-w_x} \tag 7$$
$$p(n\mid {\bf x})=q^{w_x } p^2 \tag 8$$
So
$$p({\bf x}\mid n) = \frac{p^{w_x} q^n p^2 }{q^{n}(1+p)^{n} p^2}=p^{w_x} (1+p)^{-n} \tag 9$$
which coincides with $(6)$.
For the second part, I get, from $(5)$
$$p(X_i=1 \mid n) = \frac{p}{1+p}=\frac{pq}{1-p^2}$$
which does not coincide with your value. It coincides, however with
$$ P(X_i=1 \mid X_i Y_i=0) = \frac{ P(X_i Y_i=0\mid X_i=1 ) P(X_i=1)}{P(X_i Y_i=0)}=\frac{q \, p}{1-p^2} $$
Care to check that?