zoukankan      html  css  js  c++  java
  • mathematical induction and wellordering principle

    1. Mathematical induction

    Mathematical induction can be used to prove the statement that asserts P(n) is true for all positive integers n, where P(n) is a propositional function. A prove by mathematical induction has two parts, basis step and inductive step.

    Base step: P(1) is true;

    Inductive step:  if P(k) is true, then P(k+1) is true, for all positive integer k (k>=1)

    Note 1: in inductive step, the inductive hypothesis is P(k) is true

    Note 2: an important part in mathematical induction is to define P(n), the other important part is how to reduce the problem of k+1 to k in order to use the inductive hypothesis

    2. Strong induction

    To prove that P(n) is true for all positive integers n, where P(n) is a propositional function, we complete two steps:

    BASIS STEP: we verify that the proposition P(1) is true

    INDUCTIVE STEP: we prove that the conditional statement P(1)^P(2)^…P(k)->P(k+1) for all positive integers k.

    Note: let b be a fix integer and j a fixed positive integer, the form of strong induction to prove that P(n) is true for all integers n with n>=b is consist of two steps:

    Basis step: we verify the propositions P(b), P(b+1),…, P(b+j) are true.

    Inductive step: we prove that P(b)^P(b+1)^P(b+2)^…^P(k) -> P(k+1) is true for all positive integers k>=b+j

    3. The well-ordering property

    Every nonempty set of nonnegative integers has a least element.

    4. Recursively defined functions

    We use two steps to recursively define a function with the set of nonnegative integers as its domain:

    Basis step: specify the value of the function at 0.

    Recursive step: give a rule for finding its value at an integer from the values at smaller integers

    5. Recursively defined sets

    Basis step: define a initial collection of elements in the set

    Recursive step: give a rule for forming new elements in the set from those already known to be in the set

    6. Structural induction

    We can use structural induction to prove a proposition about recursively defined set:

    Basis step: show that the results hold for all elements defined in the basis step of recursive definition of the set

    Recursive step: prove that if the statement is true for each of the element used to construct new elements in the recursive step of the definition, the results holds for these new elements.

    7. Generalized induction

    We can extend mathematical induction to prove results about other sets that have the well ordering property besides the set of nonnegative intergers, e.g. a set having lexicographic ordering

    8. Recursive algorithms

    An algorithm is called recursive if it solves a problem by REDUCING it to an instance of the same problem with smaller input.

    Note: we can use mathematical induction and strong induction to prove the correctness of a recursive algorithm

    9. Recursive and iteration

    10. Program correctness

    i. A program is said to be CORRECT if it produces the correct result for every possible input. A proof that a program is correct consists of two parts. The first part shows the correct result is obtained if the program terminates. This part of proof establishes the partial correctness of the program. The second part of the proof shows that the program always terminates.

    ii. A program, or program segment , S is said to be PARTIAL CORRECT with respect to the initial assertion p and final assertion q if whenever p is true for the input values of S, and S terminates, then q is true for the output value of S, which can be expressed by the notation p{s}q.

    iii. Rules of inference

    a) Composition rule

    p{S1}q

    q{S2}r

    So, p{S1;S2}r

    b) Conditional statement

    If condition then

           S

    p^condition{S}q

    p^(not condition)->q

    p{if condition then S}q

    c) Loop invariants

    While condition

    S

    p^condition{S}p

    p{while condition S} (p ^ (not condition))

    Note: here p is loop invariant. P is true for initial step before while, and stays true after each loop.

    11. Prove the well-ordering principle is equivalent to mathematical induction.

    a) prove that mathematic induction implies the well-ordering principle

     let P(n) be the proposition that if integer n belongs to set A, then A has a least element for every n>=0.

    Basis step: P(0) is abviously true since if a set contains element 0, then 0 is the least element in the set.

    Inductive step: the hypothesis is P(0)^P(1)^...P(k) is true for k>=0, so if integer k+1 belongs to set A,

    there are two cases,

    i) there exist one integer in [0, k] belonging to set A, by the hypothesis, A has a least element

    ii) no elements in [0, k] belonging to set A, so k+1 is the least element in A

    based on the basis step and inductive step, we can draw a conclusion that every non-empty set of non-negative integer has a least element.

    b) prove that the well-ordering principle implies mathematic induction

    use proof by contradiction to prove this statement.

    mathematic induction says if base step P(0) and inductive step, P(k)->P(k+1) for every integer k>=0, both hold, then P(n) is true for all n>=0.

    So assume P(n) is false for some integers, the set A={n | P(n) is false, n is a non-negative integer}. According to the well-ordering principle, A has a least element, b. We can draw the conclusion that b doesn't equal 0 since P(0) is true from the basis step, so b > 0. For the definition of b, P(b-1) is true, where b-1>=0, from the inductive step, P(b) must be true. On the other hand, P(b) is false. So a contradiction happens. Our assumption is false. If both basis step and inductive step hold, by the well-ordering principle, P(n) must be true for all integer n>=0

  • 相关阅读:
    1.1 What is the plug-in?
    Chapter 8 The Simplest Plug-in Solution
    Chapter 7 Resources in Plug-In(1)
    Chapter 1: Plug-in programing from past to the future
    Android插件化的兼容性(下):突破Android P中灰黑名单的限制
    Android插件化的兼容性(中):Android P的适配
    Android插件化的兼容性(上):Android O的适配
    pandas 学习 第12篇:DataFrame 避免链式赋值
    NumPy 学习 第三篇:矢量化和广播
    Wait Type 整理
  • 原文地址:https://www.cnblogs.com/Torstan/p/2675657.html
Copyright © 2011-2022 走看看