Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
AP Computer Science Principles/Big Idea 2: Data
Start Practice TestPractice Test
About Exam
medium

Evaluating Schedule Code Compression

Mark
< Prev
Next >

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 24=162^4 = 16 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?

A

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.

B

Engineer 2 is correct because dictionary compression can assign the same 3-bit code to multiple inputs without creating decoding ambiguity.

C

Engineer 1 is correct because lossless compression algorithms are mathematically restricted to input files containing at least 8 bits.

D

Engineer 2 is correct because run-length encoding guarantees that every 4-bit binary pattern compresses to 2 bits or fewer.

Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|