Two n-bit binary strings, S_1 and S_2, are chosen randomly with uniform probability. The probability that the Hamming distance between these two strings (the number of bit positions where the two strings differ) is equal to d is
A. C(n,d) / 2^n
B. C(n,d) / 2^d
C. d / 2^n
D. 1 / 2^d
GATE 2004 · Engineering Mathematics · Uniform Distribution · medium
Fix S_1 and count favorable S_2: For any fixed S_1, the number of S_2 at Hamming distance d is C(n,d): choose which d of the n bit positions differ, and the value at those positions is forced (flipped). All other positions match S_1.
Compute the probability: P(Hamming distance = d) = C(n,d) / 2^n. The total number of n-bit strings is 2^n, and exactly C(n,d) of them are at distance d from any fixed S_1.