Assuming that t is the bit length of the numbers and that we can pick 2 random numbers (the same number cannot be chosen twice), which is the probability that the two numbers will differ by exactly one bit?
From my understanding, the probability to hit a specific bit pattern is $$\frac{1}{2^t}$$
Since there are only t - 1 other bit patterns which differs from the first one by one bit, then we have that the probability to hit two numbers which differ by one bit is:
$$\frac{1}{2^t}\frac{t-1}{2^t} = \frac{t-1}{2^{2t}}$$
Does this make sense?
Thanks
The exclusive-or of two $n$-bit patterns that differ by $k$ bits is an $n$-bit pattern with $k$ ones and $n-k$ zeros. Thus, after choosing the first $n$-bit pattern, there are $\binom{n}{k}$ patterns which differ by $k$ bits.
With Replacement
Since there are $2^n$ different $n$-bit patterns, the probability that two $n$-bit patterns differ by $k$ bits is $$ \frac{\binom{n}{k}}{2^n} $$ Therefore, the probability that they differ by $1$ bit is $$ \frac{n}{2^n} $$
Without Replacement
Without replacement, the case of $k=0$ is not included, thus, the probability that two $n$-bit patterns differ by $k$ bits is $$ \frac{\binom{n}{k}[k\ne0]}{2^n-1} $$ where $[\cdots]$ are Iverson Brackets.
Therefore, the probability that they differ by $1$ bit is $$ \frac{n}{2^n-1} $$