Algorithm
Algorithm
ECE 606
Dis/proof strategies
All our strategies are based on logical deduction.
Strategies:
• Case analysis
• Contrapositive: p =⇒ q ≡ ¬q =⇒ ¬p.
y
x
!
X X
Given x, y ∈ Z+ , i= i =⇒ (x = y)
i=1 i=1
• Induction
n(n+1)(2n+1)
– 12 + 22 + . . . + n2 = 6
k−1
X
– Suppose n ∈ N whose digits are nk−1 nk−2 . . . n0 . If ni is divisible by 3, then
i=0
n is divisible by 3.
1
To disprove a statement S, we prove it’s negation, ¬S.
• ¬(∀n ∈ N, n2 − n + 11 is prime) ≡ ∃n ∈ N, n2 − n + 11 is not prime.
Can prove this by construction, i.e., a “counterexample.”