Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1A=0, B=10, C=11 | AThe shortest code (0) was given to B, which is rarer. The most frequent letter A should get the 1-bit code, so A=0 and B=10. | |
| 29 letters x 2 bits = 18 bits | BA variable-length code: the most common letter A gets a 1-bit code, and the rarer letters B and C get 2-bit codes. | |
| 3Counting character frequencies in AAAAAABBC shows which letter is most common and should get the shortest code. | C6x1 + 2x2 + 1x2 = 12 bits (fixed: 18 bits) | |
| 4Comparing total bits shows the variable-length code (A=0, B=10, C=11) uses fewer bits than a 2-bit fixed code for AAAAAABBC. | D12 is less than 18, so the variable-length code is smaller. The fixed-length code is the larger one. | |
| 5A=10, B=0, C=11 (A appears 6 times, B twice) | EA:6, B:2, C:1 | |
| 612 bits vs 18 bits, so the fixed-length code is smaller | FThe total bits for a 9-letter message when a fixed-length code uses 2 bits for every character. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
variable-length coding — Gives common characters short bit codes and rare ones longer codes, so a whole message uses fewer bits than if every character used the same fixed number of bits.Message: AAAABBC
Count of A = 4Fixed: 7 characters x 2 bits = 14 bitsMost common letter gets the shortest codeA: 4 x 1 = 4
B: 2 x 2 = 4
C: 1 x 2 = 210 bits < 14 bits, so variable saves space