This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 173: Discrete Structures, Fall 2010 Homework 4 Solutions This homework contains 6 problems worth a total of 47 points. It is due on Friday, September 24th at 4pm. 1. Set Operations [12 points] Suppose you were given the following sets: A = { Vine , Tree , Shrub } B = {{ Tree }} C = { Vine , Moss } D = { Red , Green } E = { Red } List the elements of the set for the following expressions: (a) A B C (b) A B (c) D C (d) P ( B E ) (e)  A P ( A D )  (f) { S P ( A D ) :  S  is a multiple of 4 } Solution: (a) { Vine , Tree , Shrub , { Tree } , Moss } (b) . Notice that Tree isnt equal to { Tree } . (c) { (Red , Vine) , (Red , Moss) , (Green , Vine) , (Green , Moss) } (d) { , { Red } , {{ Tree }} , {{ Tree } , Red }} (e) 96.  A  = 3 and  P ( A D )  = 2 5 = 32 (f) { , { Vine , Tree , Shrub , Red } , { Vine , Tree , Shrub , Green } , { Tree , Shrub , Green , Red } , { Vine , Shrub , Green , Red } , { Vine , Tree , Green , Red }} 1 2. Euclidean algorithm [4 points] Trace the execution of the Euclidean algorithm (lecture 10 or p 229 in Rosen) on the inputs a = 2040 and b = 2737. That is, give a table showing the values of the main variables ( x , y , r ) for each pass through the loop. Explicitly indicate what the output value is....
View
Full
Document
This note was uploaded on 11/08/2010 for the course CS 173 taught by Professor Fleck@shaffer during the Spring '08 term at University of Illinois at Urbana–Champaign.
 Spring '08
 FLECK@SHAFFER

Click to edit the document details