File+Compression

If you are a frequent downloaer you would have already come across a **Zip** file. This compression system is extremely useful especially for people who are forever on the internet. This is because Zip files let you compress the bit and bytes in a file so that it can be transferred faster, especially through slow internet connections, or can be used to savepace on a disk. Once a file has been downloaded the PC uses either a //**WinZip**// or a //**Stuffit**// program to expand the file to its original size. If performed correctly the expanded file will be identical to the original from which it has been copied.

Most types of computer files are fairly redundant, they have the same information listed over and over again. File Compression programs simply get rid of the redundancy. Instead of listing a piece of information over and over again, a file-compression program lists that information once and then refers back to it whenever it appears in the original program.

As an example, let's look at a type of information we're all familiar with: words. In John F. Kennedy's 1961 inaugural address, he delivered this famous line:

The quote has 17 words, made up of 61 letters, 16 spaces, one dash and one period. If each letter, space or punctuation mark takes up one unit of memory, we get a total file size of 79 units. To get the file size down, we need to look for redundancies. Immediately, we notice that:
 * //"Ask not what your country can do for you -- ask what you can do for your country."//**
 * **"ask" appears two times**
 * **"what" appears two times**
 * **"your" appears two times**
 * **"country" appears two times**
 * **"can" appears two times**
 * **"do" appears two times**
 * **"for" appears two times**
 * **"you" appears two times**

Ignoring the difference between capital and lower-case letters, roughly half of the phrase is redundant. Nine words; ask, not, what, your, country, can, do, for, you -- give us almost everything we need for the entire quote. To construct the second half of the phrase, we just point to the words in the first half and fill in the spaces and punctuation.