Data

  C o m p r e s s i o n  

CPT 105 · Franklin College · Erich Prisner · 2002-2007

Look at how much space different data requires. Note that even the smallest files reserve 4096 bytes.
Data Compression: Reducing redundancy, for instance by replacing subsequences that occur more than once by reference to it. Use Lempel and Zivīs adaptive dictionary-based algorithm.

Example: The original file: 

"Ask not what your country can do for you -- ask what you can do for your country"

(for simplicity we assume that no numbers occur in the file. compare "www.howstuffworks.com")

The zipped file: "1=ask, 2=what, 3=your, 4=country, 5=can, 6=do, 7=for, 8=you//
1,not,2,3,4,5,6,7,8,--,1,2,8,5,6,7,3,4
"

another zipped file: "1=ask_, 2=what_, 3=you, 4=r_country, 5=_can_do_for_you//
1,not_,2,3,4,5,_--_,1,2,3,5,4
"

Zip the files and see how much you can gain for each.

How much file reduction can you achieve?

Compression is not only useful for storage but also before communicating/transfering data

Here is a page comparing certain compression programs, here is another good page on compression, and here is one about kids inventing a new compression algorithm. Here is a list of three freeware zip programs

For Compression of graphics pixel files, see the graphics pages.

Compression of Music Files

...