Introduction to Computer Science
CSCI 125, Spring 2004
Test 2
- Please answer each question carefully and thoughtfully.
- Please use as much paper as you wish and answer in any order, but make
sure that you label each question.
- Make sure that your name is on each page.
- Make sure that you answer all questions.
- Point values for each question are noted by the question.
- When performing mathematics, please show all work. If the work is
not present and the answer is wrong, no partial credit will be assigned.
- (2 points) Define Algorithm.
- (10 points) Data Compression.
- What is data compression? Give a definition.
- How do you calculate a compression ratio for a compressed file?
- Assuming a file was 100K uncompressed and is 20K compressed,
what was the compression ratio?
- Define lossy and lossless compression.
- Give an example where it is acceptable, and an example where
it is unacceptable to use lossy compression. Justify your examples.
- (10 points) Compression Schemes
- Name and describe a compression scheme.
- Give an example of compressing data in this scheme. Give
the original data, show how it was compressed, and give
the compressed data. Make sure you label each of these items.
If this compression scheme requires any addition information
(tables or such) provide these as well.
- Discuss where this compression scheme will work well and where it
will not work well. Justify this answer.
- (5 points) Computer Science.
- Define Computer Science.
- Describe how data compression is related to computer science
in light of the definition given in the first part of this
question.
- (5 points) Analog vs Digital.
- Describe the difference between representing data in an
analog and a digital manner.
- Define digitize.
- Discuss the relationship between the sampling rate, digital
quality, and file size.
- (5 points) Representation systems.
- Describe how a good representation system can reduce the burden
of performing computation. Give an example. Justify your example.
- (8 points) Sign Magnitude
- Represent 4 and -9 in 5 bit sign magnitude.
- Show how to add the two quantities above (using sign magnitude
representation)
- Convert your answer to signed integer in decimal form.
- Describe two weaknesses of sign magnitude representation.
- (5 points) Two's Compliment
- Represent 4 and -9 in 5 bit two's compliment.
- Show how to add the two quantities above (using sign magnitude
representation)
- Convert your answer to signed integer in decimal form.