Assignments | Course Home | Schedule & Lecture Notes | Submit

Saint Louis University

Computer Science 140
Introduction to Computer Science

Michael Goldwasser

Fall 2006

Dept. of Math & Computer Science

Assignment ;h\

Data Representation and Compression

Contents:


Overview

Topic: Data Representation and Compression
Related Reading: Ch. 1.4, 1.8 and notes
Due: 8pm Wednesday, 20 September 2006


Practice Problems


Problems to be Submitted (20 points)

  1. (5 points)

    Chapter 1, Review Problem 20 (page 72).

    Hint: Appendix A of your book has the entire ASCII code, albeit with binary patterns rather than hexadecimal. Alternatively, you can get each character by using the ascii/unicode demo software.

  2. (6 points)

    Consider the following Huffman code.
    codecharacter
    00A
    11E
    010T
    0110C
    0111L
    1000S
    1011R
    10010O
    10011I
    101000N
    101001F
    101010H
    101011D

    Decode each of the following bit strings according to that code.

    1. 1000110110101111010
    2. 1010111101101001010101111
    3. 01101001010100001011101000010

  3. (4 points)

    The following color patch was taken from a section of SLU's front web page.

    Try to perform a manual color match for this color using the RGB color settings applet that we explored in class.

    Indicate your answer as a 24-bit color specifying individual RGB values. Please use the decimal system for expressing the color components, as in (255,255,255), which is the RGB color for white.

    Advice: Though in class we worked with a tool that tells you exactly what color components are used for any color on the screen that you point to, we ask that you not use such a tool for this problem. Please try to see how well you can do manually.

  4. (5 points)

    Let's say that you are taking pictures at a resolution of 1024x768 pixels and that it stores 24-bit color for each individual pixel. Assuming that pictures are stored in raw form (that is, not using any compressed file format), please answer the following questions.

    1. Calculate how many bits of information would be used to represent a single such picture. Express your answer using the most natural unit of magnitude (e.g., bytes, KB, MB, GB). Please explain the details of your calculations so that we can better understand your method in case of a wrong answer.

    2. Approximately how many pictures could be stored on a 512MB memory stick?

Overall, please type your answers to all of the problems in a single document to be submitted electronically. Please see details about the submission process.


Extra Credit (2 points)

Read through the description and examples of LZW compression from Ch. 1.8 of the text, and then answer Chapter Review Question 54.


CSCI 140, Fall 2006
Michael Goldwasser
goldwamh at our university domain

Last modified: Sunday, 25 March 2007
Assignments | Course Home | Schedule & Lecture Notes | Submit