Homework 5 Solutions - Solutions to Homework Five CS 191 :...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Solutions to Homework Five CS 191 : Discrete Structures I Apr. 3 , Winter 2007 Due Date: Apr. 17, 2007, Tuesday, before the class meeting. Section 5.2, p205 In Exercise 26-31, express each hexadecimal number in decimal. Exercise (30) 209D Answer : (209D) 16 = 2 × 16 3 + 9 × 16 + 13 = 8349 Exercise (32) for (10) Express each binary number in Exercises 8-13 in hexadecimal. 11011011 Answer : (11011011) 2 = DB 16 Exercise (33) for (17) Express each decimal number in Exercise 14-19 in hexadecimal. 400 Answer : 16) 4 0 0 ………. . 0 (remainder) 16 ) 2 5 ………. . 9 16 )1 ………. . 1 0 Therefore, 400 10 = 190 16 Exercise (34) for (27) Express each hexadecimal number in Exercise 26, 27, and 29 in binary. 1E9 16 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Answer : 1 1110 1001 2 In Exercises 42-47, express each octal number in decimal. Exercise (43) (7643) 8 Answer : (7643) 8 = 7 × 8 3 + 6 × 8 2 + 4 × 8 + 3 = 3584 + 384 + 32 + 3 = 4003 2
Background image of page 2
Section 5.3, p213 Use the Euclidean algorithm to find the greatest common divisor of each pair of integers in Exercises 1-10. Exercise (3) 220, 1400 Answer : 1400 mod 220 = 80 220 mod 80 = 60 80 mod 60 = 20 60 mod 20 = 0 Therefore, gcd (220, 1400) = 20 Exercise (11) for (3) For each number pair a, b in Exercises 1-10, find integer s and t such that sa + tb = gcd ( a , b ). 220, 1400 Answer : 1400 = 6 × 220 + 80 220 = 2 × 80 + 60 80 = 1 × 60 + 20 60 = 3 × 20 + 0 So, 20 = 80 – 60 = 80 – (220 - 2 × 80) = - 220 + 3 × 80 = - 220 + 3(1400- 6 × 220) = (-19) × 220 + 3 × 1400 Therefore, s = -19, t = 3. Another method (use matrix multiplications) From 1400 = 6 × 220 + 80, we have 80 220 = - 6 1 1 0 220 1400 From 220 = 2 × 80 + 60, we have 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
60 80 = - 2 1 1 0 80 220 From 80 = 1 × 60 + 20, we have 20 60 = - 1 1 1 0 60 80 Therefore, 20 60 = - 1 1 1 0 - 2 1 1 0 - 6 1 1 0 220 1400
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/12/2008 for the course CS 191 taught by Professor Shen during the Winter '06 term at University of Missouri-Kansas City .

Page1 / 8

Homework 5 Solutions - Solutions to Homework Five CS 191 :...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online