Probability of two events I am having trouble of calculating the following probability:
Let $\epsilon_i$, $i=1,\dotsc,N$ be Rademacher random variables. Let $n_i\in \{0, 1, 2, \dotsc, M\}$, $i=1,\dotsc,N$ such that $\sum_{i=1}^Nn_i=M$. I want to calculate
$$
P\left(\left\{\prod_{i=1}^N\epsilon^{n_i}_i=1\right\}\bigcap\left\{\sum_{i=1}^N\epsilon_i=0\right\}\right).
$$
Thank you.
 A: To begin with, in order to satisfy
$$
\prod_{i=1}^{N}\epsilon_{i}^{n_{i}}=1
$$
we must have that, for $S=\left\{ i\backepsilon\epsilon_{i}=-1\right\} $,
$$
\sum_{i\in S}n_{i}
$$
 is even. Since
$$
\sum_{i=1}^{N}n_{i}=M
$$
we want to enumerate the partitions of M in N parts such that a sum
of a subset S of its parts is even. The subset is selected at random,
selecting a part if $\epsilon_{i}=-1$ and leaving a part out if $\epsilon_{i}=1$.
We don't care about the $n_{i}$ for which $\epsilon_{i}=1$.
Furthermore, in order to satisfy
$$
\sum_{i=1}^{N}\epsilon_{i}=0
$$
there needs to be the same number of $\epsilon_{i}$ such that $\epsilon_{i}=1$
as there are $\epsilon_{i}$ such that $\epsilon_{i}=-1$, so that
N has to be even.
Therefore, the partitions of M into N parts (where N is even) have
to be such that a subset of its parts is the partition of an even
number. If M is odd, this subset must be strict. And we select parts
from the partition of M at random, with a coin toss.
The problem is not solved, but it is framed in terms that could lead
to a solution.
A: I'll give you just my idea.
Suppose you have ordered the $\epsilon_i$ such that the first $J$ have $n_i$ odd.
This because, when $n_i$ is odd, $\epsilon_i^{n_i}=\epsilon_i$; when $n_i$ is even, $\epsilon_i^{n_i}=1$.
Then $\prod_{i=1}^N\epsilon_i^{n_i}=\prod_{i=1}^J\epsilon_i$.
Now what you want is that in the first $J$ there are an even number of r.v.'s with result -1, in all the N half and half.
So you can have 0 of -1 in the first J (so all +1) and in the N-J remaining N/2 are -1 (of course you need $2N\geq J$) and the number of such combination are $1\cdot C(N-J,N/2)$.
Then you can have 2 of -1 in the first J ($C(J,2)$) and you need N/2-2 of (-1) in the remaining N-J ($C(N-J,N/2-2)$)...
Hope it will help you and it is correct.
I am now reading from the original post that $\sum_{i=1}^Nn_i=M$.
I havent read before: I dont think this change the solution; it will maybe open an easier way. 
