Review for Examination (Fall, 2008)

Mathematics 488 (Digital Codes)

Prepared by:

Joseph Malkevitch
Department of Mathematics and Computer Studies
York College (CUNY)
Jamaica, New York 11451

email:

malkevitch@york.cuny.edu

web page:

http://york.cuny.edu/~malk/

1. Find the value of the numbers below:

a. mod 5 b. mod 10 c. mod 8

i. 14

ii. -12

iii. 15

iv. 22

v. -33

2. Which of the pairs below are equivalent mod 7?

a. 5, 32

b. 49, -21

c. 23, 2

d. 23, -5

3. Using the zipcode dictionary from the digits 0 - 9, write down the bar representation (including guard bars and check digits) for:

a. 11451-0001

b. 11321-3289

4. Determine the check digit (?) for the "fake" credit card numbers below:

a. 7799-1234-5678-915 (?)

b. 7799-4321-5678-915 (?)

c. 4444-2212-3313-442 (?)

d. 5555-6666-7777-885 (?)

5. Determine if the following are "legal" credit card numbers by seeing if the check digit is consistent with the other digits:

a. 7799-1234-5465-1110

b. 7799-1234-5645-1112

c. 7799-4321-5465-1112

d. 7799-4323-5465-1112

(If the number is not correct, what digit has to be placed in the last position to make it correct?)

6. Compute the Hamming distance between the following strings of the same length:

a. 11100011 and 11101100

b. 11001111 and 11001100

c. ACGTTAG ATGTATG

d. TAGTAGTTT TATTTATGT

e. 21223366445565 21211223345575

f. ++++***++ ++****++*

g. 12111 212222

7. What is the decimal check digit associated with these (not all real) zipcodes:

a. 11451-0001

b. 11753-0321

c. 67544-1215

8. Design a Huffman code for items that must be coded and have the following frequencies:

a. 1, 3, 4, 11, 12, 30, 100

b. 2, 100, 7, 3, 15, 54
c. 4, 10, 8, 1, 3, 40, 100

d. 1, 1, 3, 3, 4, 12, 56, 100

Note: For each of the above cases how many bits are required for a block code? How many bits are required when the Huffman code is used? How many bits are saved by using compression?

9. Compute the frequencies of the digits in the numbers below and then design a Huffman code to compress the information:

a. 11433254432443555525555

b. 66607600067988899000000000660000000

10. What would the check digit (?) be for these (non-real) Universal Product Codes:

a. 0 12345 67890 ?

b. 0 50743 11502 ?

c. 3 08694 22052 ?

Are these legal UPC numbers?

a. 4 21343 34219 8

b. 0 12354 56789 2

11. Determine if the following are "legal" ISBN numbers.

a. 1-55953-407-9

b. 0-13-309600-9

c. 0-13-100191-3

If any of the check digits above are not correct, determine what would be the correct digit for the prior numbers.