IAE Academy

GATE 2023 EC Q.65: solution and answer

GATE 2023 · ECQ.65 · 2 marks · NAT

The frequency of occurrence of 8 symbols (a-h) is shown in the table below. A symbol is chosen and it is determined by asking a series of "yes/no" questions which are assumed to be truthfully answered. The average number of questions when asked in the most efficient sequence, to determine the chosen symbol, is ________ (rounded off to two decimal places).

GATE 2023 EC question 65: A table with two rows.Tap to open full size
Figure from the GATE 2023 EC paper. It is part of the question.
Figure description

A table with two rows. Row 'Symbols': a, b, c, d, e, f, g, h. Row 'Frequency of occurrence': 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/128 respectively.

Answer and solution

ANSWER

The average number of yes/no questions is .

Official answer: 1.97 to 1.99Source: Official answer key, GATE 2023 EC (IIT Kanpur)

  1. Each yes/no question gives at most 1 bit, so the most efficient questioning scheme is an optimal binary prefix code (Huffman code). The average number of questions equals the average codeword length of that code.

  2. The probabilities sum to , and each one is a negative integer power of 2 (dyadic).

  3. Huffman merging: the two least likely symbols merge to . This joins () to give , then gives , and so on up to . The tree is a single chain, so the codeword lengths are for .

  4. Check: for a dyadic source the length is exactly (for and , ), so equals the entropy and the code meets the lower bound.

  5. Rounded to two decimal places, the average number of questions is (inside the official range 1.97 to 1.99).

KEY IDEA

The most efficient yes/no questioning scheme is the Huffman code. Its average length is the expected number of questions, and for a dyadic source it equals the entropy .

WATCH OUT FOR

Giving the entropy of a source that is not dyadic, or assuming a fixed-length code with 3 questions for 8 symbols. Another slip is giving both of the two rarest symbols length 6 instead of 7.

From the GATE 2023 EC paper. Every question of this paper · Download the full paper · All 9 Information theory questions, with notes

More Information theory questions