The conditional probability when some random variables are independent 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
 A: Nice question! I enjoyed working out the solution. It's certainly not immediately obvious, by any stretch!

Suppose that $N = n$. This means that $Z_m = 0$ for all $1 \le m \le n$ and also $Z_{n+1} = 1$. (Note that $Z_1, Z_2, ...$ changes by $0$ or $1$ in a single step.) From this we deduce that $X_m Y_m = 0$ for all $1 \le m \le n$ and $X_{n+1} = 1 = Y_{n+1}$.
Note the symmetry regarding $X_i Y_i$ over $i \in [1,n]$, and recall the independence. This allows you to deduce Q2.
For Q1, for ease of presentation, let's consider $n = 2$. The general case follows (extremely) similarly.
We have
$$ a := \Pr( X_1 = x_1, \: X_2 = x_2; \: N = n ) = \Pr( X_1 = x_1, \: Y_1 = \bar x_1; X_2 = x_2, \: Y_2 = \bar y_2; X_3 = 1, \: Y_3 = 1 ), $$
where $\bar x := 1 - x$ (the 'complement' in $\{0,1\}$).
I am assuming that the $Y$-sequence is independent of the $X$-sequence (otherwise I highly doubt it's true). So this just becomes
$$ a = \Pr(X_1 = x_1) \Pr(Y_1 = \bar x_1) \Pr(Y_2 = x_2) \Pr(Y_2 = \bar x_2) \Pr(X_3 = 1) \Pr(Y_3 = 1).$$
But since we always have pairs, $(x_1, \bar x_1) = (x_1, 1 - x_1)$ and $(x_2, \bar x_2) = (x_2, 1 - x_2)$, we always have
$$ a = (pq)^2 \cdot p^2. $$
In general, we would have
$$ \Pr( \cap_1^n \{X_i = x_1\}, \: N = n ) = (pq)^n \cdot p^2. $$
Ok, so we've found actually exactly what one side is.
We can do in essence the same calculation for $\Pr(N = n)$.
Indeed,
$$ \Pr(N = n \mid \cap_1^n \{X_i = x_i\}) = \Pr(\cap_1^n \{Y_i = \bar x_i\}; \: X_{n+1} = 1, \: Y_{n+1} = 1).$$

Can you try to finish from here? I don't want to give away the entire question! :)
A: 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?
