Video Notes

Lesson Objective + Essential Knowledge

  • Compare data compression algorithms to determine which is best in a particular context

  • Data compression can reduce the size of transmitted or stored data
  • Fewer bits does not = less info
  • The amount of size reduction from compression depends on both the amount of redundancy in the original data representation and the compression algorithm applied
  • Lossless data compression can usually reduce the number of bits stored or transmitted while gauranteeing complete reconstruction of the original data
  • Lossy data compression algorithms can significally reduce he number of bits stored or transmitted but only allow reconstruction of an approxomation of the original data
  • Lossy data compression algorithms can usually reduce the number of its stored or transmitted more than lossless compression algorithms
  • In situations where quality or ability to reconstruct the original is maximally important, lossless compression algorithms are typically chosen
  • In situations where minimizing data size or transmission time is maximally important, lossy compression algorithms are typically chosen

What is Data Compression?:

  • a reduction in the number of bits needed to represent data
  • used to save transmission time and storage space

How Does Compression Work?

  • When data is compressed, you are looking for repeated patterns and predictability
  • The larger the data file, the more patterns that can be pulled out

Test Compression

  • Remove all repeated characters and insert a single character or symbol in its

Data Compression Methods: Lossless vs Lossy

  • Lossless: reduces the number of bits stored or transmitted while guaranteeing complete reconstruction of the original data.
  • Lossy: significicantly reduces the number of bits stored or transmitted but only allow reconstruction of an approxomation of the original data.

Lossy vs Lossless

Lossless:

  • The typical approach where the loss of words or numbers would change the information
    • Executable files
    • Text
    • Spreadsheet files

Lossy:

  • The typical approach where the removal of some data has little or no discernible effect on the representation of the content since the data removed are redundant, unimportant or imperceptible
    • Graphics
    • Audio
    • Video
    • Images

Which is Better?

  • All data compression algorithms have trade offs.
    • Lossy data compression can reduce the data more than lossless but the original data can not be recovered
    • Lossless data compression lets you restore and recover the original data but it can’t be compressed as much as lossy algorithms
  • Need to recover the original?
    • Choose Lossless!
  • Data size or transmission time is important?
    • Choose Lossy!

Quiz!

Question 1: Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm?

  1. A lossless compression algorithm can guarantee that compressed information is kept secure, while a lossy compression algorithm cannot.

  2. A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot.

  3. A lossless compression algorithm typically allows for faster transmission speeds than does a lossy compression algorithm.

  4. A lossless compression algorithm typically provides a greater reduction in the number of bits stored or transmitted than does a lossy compression algorithm.

My Answer:

2, because while both compress lossless does not extract and remove useless data, it compresses the data and can confirm that all data will be able to be reconstructed.

Correction:

Already Correct!!!

Question 2: A user wants to save a data file on an online storage site. The user wants to reduce the size of the file, if possible, and wants to be able to completely restore the file to its original version. Which of the following actions best supports the user’s needs?

  1. Compressing the file using a lossless compression algorithm before uploading it

  2. Compressing the file using a lossy compression algorithm before uploading it

  3. Compressing the file using both lossy and lossless compression algorithms before uploading it

  4. Uploading the original file without using any compression algorithm

My Answer:

1, because if the user wants to reduce the size of the file and wants to be able to completely restore the file to its original version then lossless is the best option.

Correction:

Already Correct!!!

Question 3: A programmer is developing software for a social media platform. The programmer is planning to use compression when users send attachments to other users. Which of the following is a true statement about the use of compression?

  1. Lossless compression of video files will generally save more space than lossy compression of video files.

  2. Lossless compression of an image file will generally result in a file that is equal in size to the original file.

  3. Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does.

  4. Sound clips compressed with lossy compression for storage on the platform can be restored to their original quality when they are played.

My Answer:

3, because 1 is wrong because lossy compresses more because it’s able to delete data that is not needed, 2 is wrong because compression of a lossless file results in it being smaller than the original, and 4 is wrong because lossy deletes data that is not needed therefore the sound clip would not be restored to its original size.

Correction:

Already Correct!!!