{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw4-soln - CS 173 Discrete Structures Spring 2010 Homework...

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

CS 173: Discrete Structures, Spring 2010 Homework 4 Solution This homework contains 5 problems worth a total of 50 points. It is due on Friday, 19 February at 4pm. 1. Set Operations [16 points] Suppose you were given the following sets: A = { Piano , { Violin , Viola , Cello } , Guitar } B = {{ Flute, Piccolo } , Cymbals } C = { Piano , Flute } D = {{ Violin, Viola, Cello } , { Flute, Piccolo }} List the elements of the set for the following expressions: (a) A D Solution: { Piano, { Violin, Viola, Cello } , Guitar, { Flute,Piccolo } } (b) B C Solution: (c) A - ( B - C ) Solution: ( B - C ) = { { Flute, Piccolo } , Cymbols } A - ( B - C ) = { Piano, { Violin, Viola, Cello } , Guitar } (d) A P ( B C ) Solution: P ( B C ) = P ( ) = {∅} A ∩ {∅} = (e) ( B D ) × C Solution: ( B D ) = {{ Flute, Piccolo }} ( B D ) × C = { ( { Flute, Piccolo } , Piano), ( { Flute, Piccolo } , Flute) } (f) | P ( B D ) | Solution: | { {{ Flute, Piccolo }} , ∅ } | = 2 (g) { X P ( A ) : | X | is not prime } Solution: { { Piano } , {{ Violin, Viola, Cello }} , { Guitar } , ∅ } (h) { X ( P ( A ) P ( B )) : | X | ≡ 3 (mod 2) } Solution: { { Piano } , {{ Violin, Viola, Cello }} , { Guitar } , { Cymbals } , {{ Flute, Piccolo }} , { Piano, { Violin, Viola, Cello } , Guitar } } 1

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

View Full Document
2. Euclidean algorithm [4 points] Trace the execution of the Euclidean algorithm (lecture 10 or p 229 in Rosen) on the inputs a = 837 and b = 2015. 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
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