2008.semester.2.key

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

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

View Full Document Right Arrow Icon
* 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 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.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/10/2009 for the course CS 2102 taught by Professor Knight during the Spring '08 term at UVA.

Page1 / 6

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

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

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