235 Ch5-1 Induction离散数学英文版PPT.ppt

Mathematical Induction is Valid Prove that Mathematical Induction is Valid We prove by contradiction: If P(1) is true and P(k) ? P(k+1) is true (for all k ? 1), but there is a smallest n1 (by Well-Ordering Property) such that when n = n1, P(n1) is false but P(n1 – 1) is true By assumption, P(n1 – 1) ? P(n1) is true (for all k ? 1). By modus ponens law, P(n1) is true. This is a contradiction! Induction for Algorithm Correctness Prove that the Sum Algorithm is correct, or sum = a1,+ a2 + ?+ an procedure Sum(a1, ?, an: list, n: positive Integer) sum := 0 for i: = 1 to n sum := sum + ai endfor r

文档评论(0)

1亿VIP精品文档

相关文档