GATE / CS ARCHIVE

GATE CSE 2004 / QUESTION 78

Probability of a specified Hamming distance

Discrete Mathematics · Probability & Random Variables · Full GATE CSE 2004 paper

GATE 2004, Q78 2 marks · MCQ
Report issue

Probability & Random Variables

Question 78, GATE 2004: Two n-bit binary strings are drawn independently and uniformly. What is the probability their Hamming distance (number of differing positions) is d, 0≤d≤n?
Options:
(A) C(n,d)/2^n
(B) C(n,d)/2^d
(C) d/2^n
(D) 1/2^d
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Fix the first n-bit string. Exactly binomial(n,d) second strings differ in d positions, since the chosen positions uniquely determine their bit flips.

2. All 2n second strings are equally likely, giving binomial(n,d)/2n, A, for integer 0≤d≤n. This uses the intended independent uniform draws; uniform marginals alone without independence would not determine the result.

3. Teaching check: After fixing S1, choose the d positions where S2 differs; at each such binary position its value is forced. No additional factor 2d is needed. Summing C(n,d)/2n over all d gives 1, a useful normalization check.

Original paper, page 11