AP CSP Unit 3: Data Compression and Using Data

22 multiple-choice questions on AP Computer Science Principles Unit 3, Data Compression and Using Data, organized by topic. They are not tied to any one class or teacher: they follow the College Board course framework. Learn the 7 key terms with the flashcards first, then test yourself. Every answer comes with a short explanation.

Take the practice test · Flashcards · All study tools

What it covers

  1. 3.1 Data compression
  2. 3.2 Extracting information from data

Key terms

3.2 Extracting information from data

Lossless compression
Reduces data size so the original can be fully reconstructed
Lossy compression
Reduces data size by removing some information permanently
Run-length encoding
Replacing runs of repeated values with a count and the value
Metadata
Data that describes other data
Data cleaning
Making data uniform and removing errors before analysis
Correlation vs causation
An association between variables does not prove one causes the other
Scalability
The ability of a system to handle growing amounts of data or users

Sample practice questions

  1. Lossless compression

    1. reduces file size while letting the original be fully restored
    2. permanently removes some data to save more space
    3. always reduces file size more than lossy compression
    4. is used only for images, never for text or audio

    Answer: A. reduces file size while letting the original be fully restored Lossless algorithms, like those in ZIP files, allow exact reconstruction.

  2. Metadata is

    1. the largest file stored anywhere on a computer system
    2. data that has been encrypted so that it can't be read
    3. data that has been deleted but can still be recovered
    4. data about data, such as the date or location of a photo

    Answer: D. data about data, such as the date or location of a photo Metadata describes other data and can help find and organize it.

  3. Lossy compression

    1. reduces file size while keeping all of the original data, so it can be fully restored
    2. greatly reduces file size by removing some data, so the original can't be fully restored
    3. is used when exact reproduction of the original file is required, such as for code
    4. increases file size by adding error-checking data, so files can be repaired later

    Answer: B. greatly reduces file size by removing some data, so the original can't be fully restored Lossy formats such as JPEG and MP3 discard detail people are unlikely to notice.

  4. Changing or deleting metadata about an image

    1. does not change the image itself
    2. always distorts the image
    3. deletes the image
    4. converts it to another format

    Answer: A. does not change the image itself Metadata is separate from the primary data.

  5. Which situation calls for lossless compression?

    1. Streaming a video to a phone, where a smaller file size matters most
    2. Sharing a vacation photo on social media, where small flaws aren't noticed
    3. Sending a text document or program code, where every character must be preserved
    4. Storing music for casual listening, where slight quality loss is acceptable

    Answer: C. Sending a text document or program code, where every character must be preserved If any change would corrupt meaning, the data must be restored exactly.

  6. Data cleaning is the process of

    1. making data uniform and fixing or removing incomplete, incorrect or duplicate entries
    2. deleting all of the data after it has been used so that it can't be misused later
    3. encrypting the data so that only authorized people are able to read or change it
    4. compressing the data so that it takes up less storage space on the computer

    Answer: A. making data uniform and fixing or removing incomplete, incorrect or duplicate entries For example, standardizing "CA", "Calif." and "California" before analysis.

  7. Run-length encoding would compress "AAAABBBCCD" as

    1. ABCD
    2. A4B3C2D1D
    3. 10ABCD
    4. 4A3B2C1D

    Answer: D. 4A3B2C1D Each run of repeated characters is replaced with a count and the character.

  8. A survey allows people to type their state of residence. Responses include "NY", "New York", and "new york". To analyze the data, you should first

    1. delete all of the responses and run the survey again
    2. count each spelling as a separate state in the results
    3. clean the data so the entries use a consistent format
    4. convert the responses to binary by hand before sorting

    Answer: C. clean the data so the entries use a consistent format Inconsistent entries must be standardized before they can be counted correctly.

  9. Which file is likely to compress the most with run-length encoding?

    1. An image of a solid blue sky
    2. A photograph of a crowded street
    3. Random noise
    4. An encrypted file

    Answer: A. An image of a solid blue sky Long runs of identical values compress well; random data has few repeats.

  10. Correlation found in a large data set

    1. doesn't by itself show that one variable causes the other
    2. always proves that one variable causes the other to change
    3. means the data are invalid and should be collected again
    4. only occurs in small data sets, not in large ones

    Answer: A. doesn't by itself show that one variable causes the other Additional research is needed to establish causation.

Practice all 22 questions

More AP Computer Science Principles

Studying for a test in your own class? Make a practice test from your class notes.