1
1
John Magee
15 July 2013
CS101 Lecture 13: Text Representation and Data Compression
2
Overview/Questions How do computers store text information? Why do - - PDF document
CS101 Lecture 13: Text Representation and Data Compression John Magee 15 July 2013 1 Overview/Questions How do computers store text information? Why do some characters show up as s on my browser? What is compression, and why
1
15 July 2013
2
3
4
5
6
7
8
Carnegie Mellon professor Scott E. Fahlman Proposed ASCII emoticons, Sept. 19, 1982. Source: http://www.wired.com/science/discoveries/news/2008/09/dayintech_0919
9
10
11
12
13
keyword encoding run-length encoding Huffman encoding
14
15
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness. That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and
likely to effect their Safety and Happiness.
16
17
18
19
Original text bbbbbbbbjjjkllqqqqqq+++++ Encoded text *b8jjjkll*q6*+5 (Why isn't l encoded? J?) The compression ratio is 15/25 or .6 Encoded text *x4*p4l*k7 Original text xxxxpppplkkkkkkk
20
21
ballboard would be
1010001001001010110001111011
compression ratio is 28/72 or 0.39 as compared to ASCII Try to encode roadbed
22
23
1011111001010
24
25
26