NOVENO. Que el artículo 24 del Reglamento de Elecciones del Instituto Nacional Electoral dispone que las designaciones de los titulares de las áreas ejecutivas de dirección y unidades técnicas,
2. Verificación de requisitos legales y documentación comprobatoria. Que para efecto de cumplimentar lo dispuesto por el Reglamento de Elecciones del Instituto Nacional Electoral en su
The Huffman code comes out as clearly the more effective of the two in terms of space saving based on the experimental results shown in figure 5. This is achieved by allocating the size of the bits according to the frequency, thereby saving space by assigning shorter code lengths to the more frequent characters. Another advantage of the Huffman code is that we do not have the limit of represent 256 characters only, since the tree can be infinitely large to accommodate however many characters are present in the text.
The Huffman code is limited because the representation changes from text to text, by simply adding one extra occurrence of as character in the text we can completely change the code assignment required. This also necessitates that the tree be saved together with the text so that it can be translated correctly, since without the tree it would not be possible to interpret the text. In the present era of computing storage, space is no longer expensive, and 256 characters are normally sufficient to capture the set of characters required by most users, for this reason the ASCII code is used. Unicode is also available as standard to for larger sets of characters. Plus the easy of implementation and constant codes make it ideal for everyday use.
The Huffman code on the other hand is more suited to customised compression implementations, where space rather than ease of interpreting the file, is more important. It can also be used as a means of increased security for one-time transmission of a sensitive text document. Based on the experimental results shown in figure 5, the ASCII number of bits (Y) follows a straight line Y = 8n, where n is the size of the text file. This compares with an approximate straight line Y = 4.4n for the number of Huffman bits required for the same text string. This corresponds to an approximate space saving of 45%.
ASCII vs Huffman Bit Requirement
(for the same text file representation)
0 1000 2000 3000 4000 5000 6000 0 100 200 300 400 500 600 700 800 Size of Textfile (n) No. of bits (Y)
ASCII Bits Huffman Bits ASCII
Huffman
Figure 5. A plot of the number of bits required for the same text string using ASCII
and Huffman.
2.8 EXERCISES
1. For the small alphabet { c, d, e, n, o }, consider the two binary codes shown in figure Q1.
Symbol Code 1 Code 2
c 001 000
d 001 11
e 010 01
n 011 001
o 100 10
Figure Q1: Code 1 is a fixed length code and Code 2 has the prefix property.
(a) Encode the characters of the word ENCODE using each code.
(b) Using the answer in part (a), calculate the percentage saving for Code 2 compared to Code1.
(c) Assuming a right-to-left reading and no errors, explain at least two reasons why the string:
1101000101101
must have used Code 2. (d) Decode the string in part (c).
2. The following are famous names associated with data compression. Prepare a concise web biography of each in a format similar to that shown for Albert Einstein at
http://www.algana.co.uk/FamousNames/E/einstein.htm
(a) David Huffman (Huffman code), (b) Samuel Morse (Morse code), (c) Abraham Lempel (LZW algorithm)
(a) David John Wheeler (Burrows-Wheeler transform).
3. Carry out an experimental investigation to test the assertion that “Compared with ASCII, the Huffman code saves approximately 50% storage space for large files containing natural English text characters, such as a chapter from English novel or a large readme file”. In the course of your investigation, you should create an appropriate computer program containing the following features:
(a) The capacity to read characters from a large text input file, (b) The capacity to count and record the frequency of each character, (c) The means of generating the associated Huffman code,
Algorithms: An Approach Using Puzzles and Brainteasers Compression
4. Consider a hypothetical single graphics scan line, with B representing a black pixel and W representing white:
WWWWWWWWWWWWBBBBBBBBWW
(a) How many binary bits are contained in the full binary equivalent of the scan line using the appropriate ASCII codes for W and B.
(b) Write down the result of applying a simple run-length code to the scan line, in the form Wn1Bn2Wn3, where ni (i = 1, 2, 3) represents decimal numbers.
(c) Converting the W and B characters to 8-bit ASCII and the decimal numbers to
4-bit binary, write down binary string for the answer in part (b).
(d) Calculate the percentage saving for the binary run-length code in (c) compared to the full binary equivalent found in (a).
5. Discuss briefly the fundamental idea behind zipping files. Carry out an experimental investigation to test the relative disk storage space saved using a zipped and unzipped version of several word-processed documents. Choose unzipped word-processed documents of approximately 1K, 10K, 100K, and 1000K sizes.
6. Discuss briefly the fundamental idea behind JPEG files. Carry out an experimental investigation to test the relative disk storage space saved using a JPEG and Bitmap version of several graphics files. Choose graphics files of approximately 10K, 100K, 1000K and 10000K sizes.
7. How would you expect the results obtained in question 3 to change if the frequency of words, rather than individual characters, was used for the compression? Assume the Huffman code assignment is made to each word.
8. By visiting the International Standards website at www.iso.ch or otherwise, identify the specific ISO/IEC standards that apply to each of the following:
(i) Information technology -- Digital compression and coding of continuous-tone still images: Requirements and guidelines
(ii) Information technology -- Digital compression and coding of continuous-tone still images: Registration of JPEG profiles, SPIFF profiles, SPIFF tags, SPIFF colour spaces, APPn markers, SPIFF compression types and Registration Authorities (REGAUT)
(iii) Information technology -- Coded representation of picture and audio information -- Progressive bi-level image compression
(iv) Information technology -- Data compression for information interchange -- Adaptive coding with embedded dictionary -- DCLZ Algorithm
(v) Information technology -- Procedure for the registration of algorithms for the lossless compression of data.
2.9 BIBLIOGRAPHY & WEB REFERENCES 1. http://www.algana.co.uk/FamousNames/H/huffman.htm 2. http://www.algana.co.uk/Algorithms/Compression/Huffman/challenge.html 3. http://www.jpeg.org/ 4. http://www.iso.org/iso/en/ISOOnline.frontpage 5. http://www.cs.sfu.ca/CourseCentral/365/li/material/notes/Chap4/Chap4.2/Chap4.2.html 6. http://www.cs.sfu.ca/CourseCentral/365/li/material/cgi-bin/whichjpeg.cgi 7. http://computer.howstuffworks.com/file-compression1.htm 8. http://www.lyvedon-way.fsnet.co.uk/compression/compress.html 9. http://datacompression.info/RLE.shtml 10. http://www.campusprogram.com/reference/en/wikipedia/l/lz/lzw_compression_algorithm.ht ml
11. Sayood, K., “Introduction to Data Compression”, Morgan Kaufmann, 2nd edition, 2000, ISBN: 1558605584
12. Miano, J., “Compressed Image File Formats: JPEG, PNG, GIF, XBM, BMP”, ACM Press, Pearson Education, 1999, ISBN: 0201604434
13. Salomon, D., “Data Compression: The Complete Reference”, Springer-Verlag, 3rd edition, 2004, ISBN: 0387406972
Algorithms: An Approach Using Puzzles and Brainteasers Graph algorithms