The sum $Y$ of independent Bernoulli variables with Poissonian upper limit $N$ is independent of $N-Y$ 
The random variables are $N,X_1,X_2,..$ are independent,$N \in po(\lambda)$ and $X_k \in Be(1/2)$, $k \geq 1$.
Set $Y_1 = \sum\limits_{k=1}^{N}X_k  $ and $Y_2 = N - Y_1$. Here $Y_1 = 0$ for $N = 0$. Show that $Y_1$ and $Y_2$ are independent, and determine their distributions.

My idea, as for the independency,
Pr($Y_1 = z , N-Y_1 = k$ ) =  Pr($Y_1 = z, N = z + k $ ) = Pr($\sum\limits_{k=1}^{z+ k}X_k = z , N = z + k$) =    Pr($Y_1 = z)Pr(N - Y_1 =k)$ ,  the last equality because $N$ and $X_1,X_2,...$ are independent so are  $N$ and $g(X_1,X_2,...)$ for any real function $g$ , the last statement i can't prove maybe someone could show me?. anyhow Iam a bit unsure about my reasoning since $N$ is poissonian  $Y_2 = N-Y_1$ could take on values that $Y_1$ cannot ( e.g any fraction ) , but then  this:  $Pr(Y_1 = z , N-Y_1 = k )  = Pr(Y_1 = z)Pr(N - Y_1 =k)$ only holds for integer values $z$.  Is there anyone how could clarify these things further?
 A: For $Y_1$, $Y_2$ to be independent it must hold $\mathbb{P}(Y_1=k_1,Y_2=k_2) = \mathbb{P}(Y_1=k_1) \mathbb{P}(Y_2=k_2)$, i.e., the joint distribution is equal to the product of marginal distributions. 
We know the following: 
\begin{equation}
\mathbb{P}(N=n)=e^{-\lambda}\frac{\lambda^n}{n!},\; n=0,1,\ldots, 
\end{equation}
and
\begin{equation}
 \mathbb{P}(Y_1=k_1|N=n) = {n \choose k_1}p^{k_1}(1-p)^{n-k_1},\; k_1 = 0,1,\ldots,n, 
\end{equation}
with $p=1/2$.
Now, 
\begin{align}
\mathbb{P}(Y_1=k_1,Y_2=k_2)&=\mathbb{P}(Y_1=k_1,N-Y_1=k_2)\\
&=\mathbb{P}(Y_1=k_1,N=k_1+k_2)\\
&=\mathbb{P}(Y_1=k_1|N=k_1+k_2)\mathbb{P}(N=k_1+k_2)
\end{align}
From this point on you should be able to find (after some algebra) that $Y_1$, $Y_2$ are indeed independent as well as their marginal distributions.
Remark: The above result is a special case of a more general result concerning homogeneous Poisson point processes (HPPPs) which states that when the points of a HPPP of intensity $\lambda$ are independently ''marked'' (selected) with probability $p$, the result is two independent HPPPs of intensities $\lambda p$ and $\lambda (1-p)$, respectively.
A: Note that $Y_{2}=\sum_{k=1}^{N}Z_{k}$ for $Z_{k}=1-X_{k}$. 
It is evident that the $Z_{k}$ are independent and Bernouilli$(\frac{1}{2})$-distributed
so the distributions of $Y_{1}$ and $Y_{2}$ are the same. In fact
their distribution is Poisson$\left(\frac{\lambda}{2}\right)$ and
a proof for that can be found here.
$$P\left\{ Y_{1}=r\wedge Y_{2}=s\right\} =P\left\{ Y_{1}=r\wedge N=r+s\right\} =P\left\{ Y_{1}=r\mid N=r+s\right\} P\left\{ N=r+s\right\} =\dbinom{r+s}{r}2^{-r-s}e^{-\lambda}\frac{\lambda^{r+s}}{\left(r+s\right)!}$$
This equals: $$P\left\{ Y_{1}=r\right\} P\left\{ Y_{2}=s\right\} =e^{-\frac{\lambda}{2}}\frac{\left(\frac{\lambda}{2}\right)^{r}}{r!}\times e^{-\frac{\lambda}{2}}\frac{\left(\frac{\lambda}{2}\right)^{s}}{s!}$$
Proved is now that $Y_{1}$ and $Y_{2}$ are independent.
