Discrete Mathematics for Computer Science

(Romina) #1
Chapter Review 281

bers 534-27-3175, 289-13-3754,413-39-4431, 978-65-4891, 534-75-9614. How many
students in your class can have their Social Security numbers hashed this way without
generating a collision?


  1. Define a hashing function on a Social Security number as follows: Let the digits of
    the Social Security number be XlX2X3X 4 X 5 X 6 X 7 x8x 9 and form the three digit number
    Y1Y2y3 as follows:


Y1 = (xl + x4 + x7) (mod 5) (use the remainder when Xl + X4 + X7 is divided by 5)

Y2 = (x2 + X5 + x8) (mod 10)
Y3 = (x3 + X6 + X9) (mod 10)

Calculate the hash value for the following social security numbers:
(a) 234-54-7654
(b) 534-37-9021
(c) 435-54-6782
(d) 537-98-9092
(e) 239-67-4397
Do not deal with collisions, if any occur.


  1. A half-adder takes two boolean inputs and produces a sum digit and a carry digit. The
    output for a half-adder can be represented by a function as


Input and Output
For a Half-Adder
input Output

I 1 0 1
1 0 1 0
0 1 1 0
0 0 0 t

Draw a combinatorial network that represents this network with two outputs.
Free download pdf