Why is $\dfrac{b(3x)}{b(x\bigoplus2x)}$ almost normally distributed?

69 Views Asked by At

I'm sorry if my question is a bit vague; I don't know a whole lot about distributions.

Let $b(x)$ be the number of ones in the binary representation of $x$. I use $\bigoplus$ as bitwise XOR operator. Now we have: $$f(x)=\dfrac{b(3x)}{b(x\bigoplus2x)}$$ I calculated $f(x)$ for all integers $1\leq x\leq100000000$ and rounded to two decimal places. Then I plotted how many times $f(x)$ was equal to a certain number (the number being the x-axis and the amount being the y-axis) and got this result: enter image description here

To me, this looks a bit like a normal distribution, except that it has a minimum value ($f(x)$>0) and that there is one value of $f(x)$ ($f(x)=1$ to be precise) that occurs way more often that it would have in a 'real' normal distribution.

My question is: Why does this happen?

I figured it has something to do with the fact that adding without carrying is the same as XOR-ing (in binary). At least that's why I think there's such a spike in the center.