Data Compression : Looking it Up

Most compression programs use a variation of the LZ adaptive dictionary-based algorithm to shrink files.

"LZ" refers to Lempel and Ziv, the algorithm's creators

"dictionary" refers to the method of cataloging pieces of data.

Our Dictionary :

  1. ask
  2. what
  3. your
  4. country
  5. can
  6. do
  7. for
  8. you

The compressed sentence : from "Ask not what your country can do for you; ask what you can do for your country" (79 char) to ...

"1 not 2 3 4 5 6 7 8; 1 2 8 5 6 7 3 4"

36 + 36 (dictionary 29+7) = 72

"Ask not what your country can do for you; 1 3 9 6 7 8 4 5" = 57

Source: http://computer.howstuffworks.com/file-compression1.htm