Homework 5 Solutions

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

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

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

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

View Full Document
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
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

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

View Full Document
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 = - - 3 1 2 1 - 6 1 1 0 220 1400 = - - 19 3 10 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern