How can we say than the XOR between $n$ (uniform, independent) random bits is $1$ with probability $1/2$? For example if we have 4 random bits, we know that the XOR of them will be $1$ with half probability. The same happens if we have 3, or 4 random bits. But if we have $n$ random bits?
Probability that XOR of an arbitrary number of random bits is 1
197 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
The last bit is $0$ or $1$, each with probability $\frac12$, independently of the XOR of the previous bits,
so leaves that result the same or changes it, each with probability $\frac12$,
meaning the overall XOR is $0$ or $1$, each with probability $\frac12$.
On
It's One if number of 1s is Odd. So ignore the first n-1 bits. (their parity is completely random*) Now the last bit determine the final answer (based on number of 1s in the first n-1 bits)
*: Probability that number of 1s in the first n-1 bits is Odd, is 1/2. Try to prove this part yourself.
hint: You can find a 1-to-1 correspondence between even and odd parities. for example for every sequence with even parity there is sequence of bits with odd parity (by switching the last bit) and vice versa.
Let $D = \bigoplus_{k = 1}^{n-1} b_i$. Then,
\begin{align}P(\bigoplus_{k = 1}^n b_i = 1) &= P(\bigoplus_{k = 1}^n b_i = 1 | D=1)P(D=1) + P(\bigoplus_{k = 1}^n b_i = 1 | D=0)P(D=0) \\ &= \frac12P(D=1) + \frac12P(D=0) \\ &= \frac12 \end{align}