Question
Two numbers are chosen independently and uniformly at random from the set . 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 , so .
Let us examine the 4-bit unsigned binary representations of each element:
- For numbers to ( to ):
The most significant bit (MSB, 4th bit) is . There are such numbers. - For numbers to ( to ):
The most significant bit (MSB, 4th bit) is . There are such numbers.
Two numbers are chosen independently and uniformly at random with replacement from .
The total number of equally likely outcomes is:
The favorable outcomes where both numbers have the same MSB are:
- Both have : ways.
- Both have : ways.
Therefore, the probability is:
Rounding off to 3 decimal places gives 0.503.
0.503
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.