Does bitwise-XORing substrings results in a uniform distribution?

124 Views Asked by At

Let's say I have an integer $k$ whose bit string representation can be exactly divided into $l$ substrings of length $\log_2(m)$. Let's call each one of these substrings $B_i(k)$, for $i\in\{0,1,2,...,l-1\}$.

Now, if I define: $$f(k)=\bigoplus_{i=0}^{l-1}B_i(k)$$ Where $\oplus$ is the bitwise-XOR operator, I want to know what is the probability that $f(k)=j$, if $j\in\{0,1,2,...,m-1\}$.

My question boils down to knowing if doing that bitwise-XOR thing results in a uniform distribution over $\{0,1,2,...,m-1\}$. See, I think that the size of the sample space is the amount of possible values that the bit strings of size $\log_2(m)$ can take, which is $2^{\log_2(m)}=m$. If that is the case, which it would if that thing has a uniform distribution, then the probability would be $1/m$. Am I right?