------------------------------------------------------------------------------ Mohamed G. Gouda CS 311 Spring 2015 Midterm 1 ------------------------------------------------------------------------------ 50 minutes ------------------------------------------------------------------------------ 1. (5 points) Let Dx be the set {0, 1, 2, ...}. For the following quantified predicate, write an equivalent quantified predicate that does not have the Boolean operator "not": not (All x, not P(x) and not Q(x) or not R(x)) 2. (5 points) Let Dx be the set {0, 1, 2, ...}. Use indirect inference to prove the following quantified predicate: (All x, (not(3x is even)) => (not(x is even))) 3. (5 points) Write a by-contradiction proof that proves the predicate: (100 is even) 4. (5 points) An induction proof of the predicate (All x, x>=3, (3+4+ ... +x) = (x-2)*(x+3)/2) consists of two proofs: a base case proof and an induction step proof. Write the induction step proof for this predicate. --------------------------------------------------------------------------------- Solutions: --------------------------------------------------------------------------------- 1. not (All x, not P(x) and not Q(x) or not R(x)) = {binding of and is stronger than binding of or} not (All x, (not P(x) and not Q(x)) or not R(x)) = {De_Morgan's several times} (Exist x, (P(x) or Q(x)) and R(x)) --------------------------------------------------------------------------------- 2. (x is even) => {deintion of even} (x = 2m for some positive integer m) => {multiply 3 to both sides of =} (3x = 2*(3*m)) for some positive integer m) => {3m is a positive integer r} (3x = 2r for some positive integer r) => {definition of even} (3x is even) ---------------------------------------------------------------------------------- 3. not (100 is even) => {100 is either odd or even} (100 is odd) => {definition of odd} (100 = 2m+1 for some non-negative integer m} => {arithmetics} (49.5 = m for some non-negative integer m) => {49.5 is not a non-negative integer} F ----------------------------------------------------------------------------------- 4. P(x) => {definition of P(x)} (3+4+ ...+x) = (x-2)*(x+3)/2 => {add x+1 to both sides of =} (3+4+ ...+x+(x+1)) = (x-2)*(x+3)/2 + 2(x+1)/2 => {arithmetics} (3+4+ ...+x+(x+1)) = (x^2 + 3x - 4)/2 => {arithmetics} (3+4+ ...+x+(x+1)) = (x-1)*(x+4)/2 => {definition of P(x+1)} P(x+1) -------------------------------------------------------------------------------------