Evaluating Schedule Code Compression
A school club scheduling tool records each student’s daily 4-period availability as a fixed-length 4-bit binary string, where each bit represents availability during one time slot. Because each string contains 4 bits, there are possible distinct schedule records.
A developer introduces Proposal Alpha, a lossless compression algorithm, and guarantees that it will compress every one of the 16 possible 4-bit schedule records into a unique bit string strictly shorter than 4 bits (1 to 3 bits in length), allowing complete and exact reconstruction of any original record.
| Bit Length | Pattern Count Formula | Available Unique Bit Patterns |
|---|---|---|
| 1 bit | 2^1 | 2 |
| 2 bits | 2^2 | 4 |
| 3 bits | 2^3 | 8 |
| Total (1 to 3 bits) | 2 + 4 + 8 | 14 |
Two software engineers evaluate Proposal Alpha. Engineer 1 argues that the developer’s guarantee is mathematically impossible for lossless compression, while Engineer 2 argues that the guarantee is feasible because dictionary encoding can compress any small pattern. Which statement correctly evaluates their arguments?
Engineer 1 is correct because there are only 14 unique bit patterns of lengths 1 through 3, which is insufficient to uniquely represent all 16 distinct 4-bit inputs without collisions.
Engineer 2 is correct because dictionary compression can assign the same 3-bit code to multiple inputs without creating decoding ambiguity.
Engineer 1 is correct because lossless compression algorithms are mathematically restricted to input files containing at least 8 bits.
Engineer 2 is correct because run-length encoding guarantees that every 4-bit binary pattern compresses to 2 bits or fewer.
Question Leaderboard
Not enough data yet to show leaderboard.
