ITPEC FE Morning October 2023 Question 6

Source exam: ITPEC FE Morning October 2023Topic: Basic Theory & Math

ITPEC FE Morning October 2023 — Question 6 of 80

Huffman Coding — find the missing code using the prefix-free property.

Given codes: A=00, B=01, C=10, E=111. Find code for D (13%).

  • D and E are the two least frequent → both get 3-bit codes
  • D's code must start with 11 (only free 2-bit prefix)
  • E already uses 111, so D = 110

Why not others:
- (a) 001 — prefix 00 collides with A's code

- (b) 010 — prefix 01 collides with B's code

- (c) 101 — prefix 10 collides with C's code

Key rule: Huffman codes are prefix-free — no code can be the beginning of another code. Eliminate options that start with an existing code.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.