Label place values before adding, count patterns as 2^n with a maximum one lower, and decide lossless versus lossy by whether exact reconstruction or size is the stated priority.
Convert with a place-value row, both directions
Every conversion is the same move: write the place row (1, 2, 4, 8, 16, 32, continuing leftward), then read the digits against it. Binary to decimal adds the places under the 1-bits; decimal to binary repeatedly subtracts the largest remaining place value and writes 1s in the places used. Both directions end with the same verification step: convert back and confirm the original number reappears. Skipping the check is how a single wrong place survives into an answer.
A worked pass in each direction: 111000 sits over places 32, 16, 8, 4, 2, 1 with 1-bits in the 32, 16 and 8 places, so its value is 56. Going the other way, 44 = 32 + 12 and then 12 = 8 + 4, so 44 reads 101100. Both verifications run in seconds, and either one catches a misplaced place before it reaches a final answer, which is exactly when a correction is cheap.
Count patterns before promising a range
A fixed number of bits holds exactly 2^n patterns and, read as unsigned integers, those patterns name 0 through 2^n - 1. Four bits hold 16 patterns naming 0 through 15; the maximum is one below the pattern count because 0 uses a pattern. Minimum-width questions read the relationship backwards: a value v fits in n bits when 2^n - 1 >= v, so search for the smallest n that satisfies the inequality rather than rounding 2^n upward.
A counter that must reach 30, for example, needs five bits: four bits stop at 15 and five bits reach 31. If a computation then pushes past the promised maximum, the representation cannot name the result, and that failure is overflow. Keeping the three quantities separate, pattern count, maximum, and the value to store, lets one inequality answer every fixed-bit question without a new method each time. The same separation exposes range claims that sound generous: a representation promising every nonnegative number in eight bits has promised 256 patterns something 256 patterns cannot deliver.
Name the trade before naming the algorithm
Compression reduces the number of bits stored or transmitted. Lossless compression guarantees complete reconstruction of the original data; lossy compression reconstructs only an approximation, and usually removes more bits. How much any method saves depends on the redundancy in the original representation and on the algorithm applied, so the same file can compress very differently under the two classes and no fixed percentage is promised.
The decision rule is the priority stated in the scenario. When exact reconstruction is required, as with program code or records that must come back character-for-character, the lossless class is the answer regardless of its smaller savings. When the scenario prioritizes smaller size or faster transmission and tolerates fidelity loss, as with web photo delivery or streaming, the lossy class fits. Fewer bits does not automatically mean less information; name what is being traded before naming the class.
Justify with the priority the scenario states
A strong justification names three things: the stated priority, the class that matches it, and the reconstruction consequence. A team archiving source code needs every character back, so lossless fits; a news site serving thumbnails to phones prioritizes load time and accepts approximation, so lossy fits. The same photo can legitimately take either path because the scenarios state different priorities, not because the data itself changed.
Watch for the reversal trap: an option that argues lossless because it compresses more, or lossy because it is safer, has swapped the two classes. Rebuild the sentence from the priority and from the reconstruction promise each class makes: more reduction with approximation, exact reconstruction with weaker size guarantees. Keeping those two promises apart makes the choice mechanical rather than memorized, and it gives every answer a checkable sentence instead of a preference.
Apply the guide
A clinic stores scanned patient records that must be retrievable character-for-character. Which compression class fits, and what decides it?Reveal explanation
Lossless: the scenario makes exact reconstruction the priority, so the guarantee of complete reconstruction decides the choice even if lossy compression would save more space.
A weather site serves rapidly refreshed radar images to phones on metered data plans. Which class fits, and what would change the answer?Reveal explanation
Lossy: the stated priority is size and delivery speed with tolerable fidelity loss. A stated requirement for pixel-exact archival copies would flip the choice to lossless.
Turn the idea into practice.
Apply the rule to a new case, then explain your choice.
Practice this skillSources & authorship
Conceptual facts checked against linked references; all teaching scenarios, comparisons and tasks are original. No textbook prose, pictures or exercises reproduced.
Original OpenExam guide
Independent educator review is pending. This guide is not an official exam paper or a video transcript.
AP Computer Science Principles Course and Exam Description (CED)