levo

Exchanging Data

Compression

  • 3 things to know
  • Component 01

Overview

Recall questions on lossy and lossless compression and when each is used, run length encoding and dictionary coding with worked examples, the data each suits, and comparing the two methods.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Explain the difference between lossy and lossless compression.

Key term

Give a typical use for lossy compression and explain why the loss is acceptable there.

Key term

A student claims run length encoding always makes a file smaller. Explain why that is wrong.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is compression, and what is it actually for?

    Model answer

    Compression is the process of reducing the number of bits needed to store or transmit a file. It is used to save storage space, to reduce the bandwidth a transfer consumes, and so to shorten download, upload and streaming times. It can also reduce cost where storage or data transfer is charged by volume.

  2. 2

    Explain the difference between lossy and lossless compression.

    Model answer

    Lossy compression permanently discards some of the original data, usually detail a human is unlikely to notice, so the decompressed file is only an approximation of the original and the discarded data can never be recovered. Lossless compression removes only redundancy by recording the data more efficiently, so the original file can be reconstructed bit for bit exactly when it is decompressed.

  3. 3

    Lossy compression generally produces much smaller files than lossless. Why, then, is lossless ever used?

    Model answer

    Because for many kinds of data any loss at all destroys the file's meaning. Lossless is used whenever the exact original bits are needed, and the price of that guarantee is a smaller reduction in size. Lossy is only acceptable where an approximation is good enough for the human viewer or listener.

  4. 4

    Why would you never apply lossy compression to an executable program or a spreadsheet?

    Model answer

    Because every bit in them is significant. In an executable, changing or discarding bits alters machine code instructions or addresses, so the program will crash, misbehave or fail to run at all. In a spreadsheet, altered bits change the actual figures and formulae, producing silently wrong numbers. Neither file has any perceptually redundant detail that could be thrown away safely, so only lossless compression is appropriate.

  5. 5

    Give a typical use for lossy compression and explain why the loss is acceptable there.

    Model answer

    Photographs on a website, streamed music and streamed video. In a photograph, fine differences between adjacent shades are discarded; in audio, frequencies outside normal hearing or masked by louder sounds are removed. Human perception cannot detect most of what is thrown away, so the file looks or sounds close enough to the original while being far smaller, which matters greatly for fast page loading and smooth streaming.

  6. 6

    Name three kinds of file for which lossless compression is essential.

    Model answer

    Any three of: executable programs and other machine code, text documents and source code, spreadsheets and databases, archived files such as ZIP archives, medical or scientific images used for diagnosis or analysis, and any file whose hash or digital signature must still match after decompression. In each case an exact reconstruction of the original is required.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Exchanging Data, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.