Question

Two numbers are chosen independently and uniformly at random from the set {1,2,…,13}\{1, 2, \dots, 13\}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary representations have the same most significant bit is ___________.

Official answer and solution
Accepted answers
0.502 to 0.504
From
Official GATE 2019 answer key

Solution

Classify the numbers by their most significant bit in 4-bit unsigned binary, then calculate the joint probability.

The set of numbers is S={1,2,…,13}S = \{1, 2, \dots, 13\}, so ∣S∣=13|S| = 13.
Let us examine the 4-bit unsigned binary representations of each element:

  • For numbers 11 to 77 (000120001_2 to 011120111_2):
    The most significant bit (MSB, 4th bit) is 00. There are 77 such numbers.
  • For numbers 88 to 1313 (100021000_2 to 110121101_2):
    The most significant bit (MSB, 4th bit) is 11. There are 66 such numbers.

Two numbers are chosen independently and uniformly at random with replacement from SS.
The total number of equally likely outcomes is:

Ntotal=13×13=169N_{\text{total}} = 13 \times 13 = 169

The favorable outcomes where both numbers have the same MSB are:

  1. Both have MSB=0\text{MSB} = 0: 7×7=497 \times 7 = 49 ways.
  2. Both have MSB=1\text{MSB} = 1: 6×6=366 \times 6 = 36 ways.
Nfav=49+36=85N_{\text{fav}} = 49 + 36 = 85

Therefore, the probability is:

P=85169≈0.5029585...P = \frac{85}{169} \approx 0.5029585...

Rounding off to 3 decimal places gives 0.503.

Final answer

0.503

Common trap

Assuming sampling without replacement (which yields (7*6 + 6*5) / (13*12) = 72/156 = 0.462) instead of independent draws.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2019 Computer Science and Information Technology (CS)
Question
32 of 65, printed as CS Q.22
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.