{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

2008.semester.2.key

2008.semester.2.key - CS202 DISCRETE MATHEMATICS SEMESTER...

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

* This is a closed book, closed notes examination. * SHOW ALL WORK * The numbers in parentheses after each question is the number of points allocated to that question. * Write your answers on the examination paper in legible ink or pencil. If your answer cannot be read or understood, or if your answer is vague or confused, it will be marked wrong. * NAME ( Print Legibly. All Capitals ): PLEDGE ( Write Out In Full And Sign ): CS202 - D ISCRETE M ATHEMATICS S EMESTER E XAMINATION 2 F ALL 2008 Time Limit - Seventy Five Minutes

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

View Full Document
Page 1 Department of Computer Science CS 202 University of Virginia Page score 1. Prove by induction that n 3 - n is divisible by three for any n 1. (10) Base case for n = 1: n 3 - n = 1 3 - 1 = 0 which is divisible by 3 (or if you prefer, base case for n = 2: n 3 - n = 2 3 - 2 = 6 which is divisible by 3). Inductive case: Assume n 3 - n is divisible by 3. Consider ( n +1) 3 - ( n +1) = ( n 3 +3 n 2 +3 n +1) - ( n +1) = n 3 +3 n 2 +2 n = ( n 3 - n )+3( n 2 + n ) Both terms are divisible by three and so is the sum. Thus, if n 3 - n is divisible by 3, so is ( n +1) 3 - ( n +1) Thus, we have shown that n 3 - n is divisible by 3 for any n > 1. QED 2. Prove using a direct proof that the difference between an even integer and an odd integer is odd. (10) To prove: for two integers, i and j , if even( i ) and odd( j ) then odd( i - j ) Assume that i is even and j is odd. Then, by definition there exist integers k and l such that i = 2 k and j = 2 l +1 for some Then i - j = 2( k - l - 1) + 1 2( k - l - 1) + 1 is odd. QED 3. Prove using a proof by contradiction that for any integer n , if 3 n + 2 is odd, then n is odd. (10 pts) Assume that if 3 n + 2 is odd, then n is even In that case, by definition of even and odd there are integers i and j such that: 3 n + 2 = 2 i + 1 n = 2 j Substituting for n in 3 n + 2 we get: 3 n + 2 = 6 j + 2 = 2(3 j + 1) which by definition implies that 3 n + 2 is even. But 3 n + 2 is assumed to be odd.
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