L04 Dis.math

Embed Size (px)

Citation preview

  • 8/9/2019 L04 Dis.math.

    1/43

    Mathematical Induction I

    Lecture 4: Sep 16

  • 8/9/2019 L04 Dis.math.

    2/43

  • 8/9/2019 L04 Dis.math.

    3/43

    Proving For-All Statements

    Objective: +rove

    It is ver common to prove statements of this form. Some ,*amples:

    -or an odd number m' mi is odd for all nonne#ative inte#er i.

    )n inte#er n / 1 is divisible b a prime number.

    &0auchSchwar inequalit(  -or an a1'2'an' and an b1'2bn 

  • 8/9/2019 L04 Dis.math.

    4/43

    Universal Generalization

    ( )

    . ( )

     A R c

     A x R x

    →∀valid rule providin# c is independent of )

    3ne wa to prove a forall statement is to prove that &c( is true for an c'but this is often difficult to prove directl

    &e.#. consider the statements in the previous slide(.

    Mathematical induction provides another wa to prove a forall statement.

    It allows us to prove the statement step-by-step.

    Let us first see the idea in two e*amples.

  • 8/9/2019 L04 Dis.math.

    5/43

    O Po!ers Are O

    -act:  If m is odd and n is odd' then nm is odd.

    +roposition: for an odd number m' mi is odd for all nonne#ative inte#er i.

    Let +&i( be the proposition that m i is odd.

    $ +&1( is true b definition.$ +&5( is true b +&1( and the fact.

    $ +&( is true b +&5( and the fact.

    $ +&i71( is true b +&i( and the fact.

    $ So +&i( is true for all i.

    Idea of induction.

  • 8/9/2019 L04 Dis.math.

    6/43

    "ivisibility by a Prime

    Theorem#  )n inte#er n / 1 is divisible b a prime number.

    Idea of induction.

    $Let n be an inte#er.

    $If n is a prime number' then we are done.

    $3therwise' n 8 ab' both are smaller than n.

    $If a or b is a prime number' then we are done.

    $3therwise' a 8 cd' both are smaller than a.

    $If c or d is a prime number' then we are done.

    $3therwise' repeat this ar#ument' since the numbers are

      #ettin# smaller and smaller' this will eventuall stop and

      we have found a prime factor of n.

  • 8/9/2019 L04 Dis.math.

    7/43

    3b9ective: +rove

    $ea o% $nuction

    This is to prove

    The idea of induction is to first prove +&( unconditionall'

    then use +&( to prove +&1(

    then use +&1( to prove +&5(

    and repeat this to infinit2

  • 8/9/2019 L04 Dis.math.

    8/43

    The $nuction &ule

     and &from n to n 71('

    proves ' 1' 5' '2.

    + &(' ∀n ∈; + &n (+ &n 71(

    ∀m ∈; + &m (

  • 8/9/2019 L04 Dis.math.

    9/43

    This Lecture

    $ The idea of mathematical induction

    $ %asic induction proofs &e.#. equalit' inequalit' propert'etc(

    $ Inductive constructions

    $ ) parado*

  • 8/9/2019 L04 Dis.math.

    10/43

    Proving an '(uality

    Let +&n( be the induction hpothesis that the statement is true for n.

    %ase case: +&1( is true

    Induction step: assume +&n( is true' prove +&n71( is true.

    because both L>S and >S equal to 1

    That is' assumin#:

    ?ant to prove:

    This is much easier to prove than provin# it directl'

    because we alread =now the sum of the first n terms@

  • 8/9/2019 L04 Dis.math.

    11/43

    Proving an '(uality

    Let +&n( be the induction hpothesis that the statement is true for n.

    %ase case: +&1( is true

    Induction step: assume +&n( is true' prove +&n71( is true.

    b induction

    because both L>S and >S equal to 1

  • 8/9/2019 L04 Dis.math.

    12/43

    Proving an '(uality

    Let +&n( be the induction hpothesis that the statement is true for n.

    %ase case: +&1( is true

    Induction step: assume +&n( is true' prove +&n71( is true.

    b induction

  • 8/9/2019 L04 Dis.math.

    13/43

    Proving a Property

    %ase 0ase &n  8 1(:

    Induction Step: )ssume + &i ( for some i ≥ 1 and prove + &i  7 1(:

    )ssume is divisible b ' prove is divisible b .

    Aivisible b b inductionAivisible b

  • 8/9/2019 L04 Dis.math.

    14/43

    Proving a Property

    %ase 0ase &n  8 5(:

    Induction Step: )ssume + &i ( for some i ≥ 5 and prove + &i  7 1(:

    )ssume is divisible b 6

    is divisible b 6.

    Aivisible b 5b case analsis

    Aivisible b 6b induction

    +rove

  • 8/9/2019 L04 Dis.math.

    15/43

    Proving an $ne(uality

    %ase 0ase &n  8 5(: is true

    Induction Step: )ssume + &i ( for some i ≥ 5 and prove + &i  7 1(:

    b induction

  • 8/9/2019 L04 Dis.math.

    16/43

    )auchy-Sch!arz

    &0auchSchwar inequalit(  -or an a1'2'an' and an b1'2bn 

    +roof b induction &on n(: ?hen n81' L>S B8 >S.

    ?hen n85' want to show

    0onsider

  • 8/9/2019 L04 Dis.math.

    17/43

    )auchy-Sch!arz

    &0auchSchwar inequalit(  -or an a1'2'an' and an b1'2bn 

    Induction step: assume true for B8n' prove n71.

    induction

    b +&5(

  • 8/9/2019 L04 Dis.math.

    18/43

    This Lecture

    $ The idea of mathematical induction

    $ %asic induction proofs &e.#. equalit' inequalit' propert'etc(

    $ Inductive constructions

    $ ) parado*

  • 8/9/2019 L04 Dis.math.

    19/43

    Gray )oe

    0an ou find an orderin# of all the nbit strin#s in such a wa thattwo consecutive nbit strin#s differed b onl one bitC

    This is called the Dra code and has some applications.

    >ow to construct themC Thin= inductivel@

    5 bit

    1111

    bit

    11111111111

    1

    0an ou see the patternC

    >ow to construct 4bit #ra codeC

  • 8/9/2019 L04 Dis.math.

    20/43

    Gray )oe

    bit

    111

    111111111

    bit &reversed(

    111111

    111111

    111111111111111

    111111111

    11

    111111

    4 bit

    differed b 1 bitb induction

    differed b 1 bitb induction

    differed b 1 bitb construction

    ,ver 4bit strin# appears e*actl once.

  • 8/9/2019 L04 Dis.math.

    21/43

    Gray )oe

    n bit

    222

    222212

    n bit &reversed(

    1222

    22222

    222222212

    11

    111111

    n71 bit

    differed b 1 bitb induction

    differed b 1 bitb induction

    differed b 1 bitb construction12

    2

    222222

    So' b induction'

    Dra code e*ists for an n.

    ,ver &n71(bit strin# appears e*actl once.

  • 8/9/2019 L04 Dis.math.

    22/43

    Doal: tile the squares' e*cept one in the middle for %ill.

    n2

    n

    2

    Puzzle

  • 8/9/2019 L04 Dis.math.

    23/43

    There are onl trominos &Lshaped tiles( coverin# three squares:

    -or e*ample' for E * E pule mi#ht tile for %ill this wa:

    Puzzle

  • 8/9/2019 L04 Dis.math.

    24/43

    Theorem: -or an 5n  * 5n pule' there is a tilin# with %ill in the middle.

    +roof: &b induction on n (

    + &n ( ::8 can tile 5n  * 5n  with %ill in middle.

    %ase case: &n 8(

    &no tiles needed(

    Puzzle

    &Aid ou remember that we proved is divisble b C(

  • 8/9/2019 L04 Dis.math.

    25/43

    n

    2

    Induction step: assume can tile 5n

    * 5n 

    '  prove can handle 5n7 1 * 5n7 1.

    15 7n 

    Puzzle

    FowwhatCC

  • 8/9/2019 L04 Dis.math.

    26/43

    Puzzle

    $ea* It would be nice if we could control the locations of the empt square.

    n2

    n2

  • 8/9/2019 L04 Dis.math.

    27/43

    "one+

    Puzzle

    $ea* It would be nice if we could control the locations of the empt square.

  • 8/9/2019 L04 Dis.math.

    28/43

    The ne! iea*

    +rove that we can alwas find a tilin# with %ill any!here.

    Puzzle

    Theorem %: -or an 5n  * 5n plaa' there is a tilin# with %ill anwhere.

    Theorem: -or an 5n  * 5n plaa' there is a tilin# with %ill in the middle.

    0learl Theorem % implies Theorem.

    ) stron#er propert

  • 8/9/2019 L04 Dis.math.

    29/43

    Theorem %: -or an 5n  * 5n plaa' there is a tilin# with %ill anwhere.

    +roof: &b induction on n (

    + &n ( ::8 can tile 5n  * 5n  with %ill anwhere.

    %ase case: &n 8(

    &no tiles needed(

    Puzzle

  • 8/9/2019 L04 Dis.math.

    30/43

    Induction step:

    )ssume we can #et %ill anwhere in 5n  * 5n .

    +rove  we can #et %ill anwhere in 5n 71 * 5n 71.

    Puzzle

  • 8/9/2019 L04 Dis.math.

    31/43

    Puzzle

    Induction step:

    )ssume we can #et %ill anwhere in 5n  * 5n .

    +rove  we can #et %ill anwhere in 5n 71 * 5n 71.

    n2

    n2

  • 8/9/2019 L04 Dis.math.

    32/43

    Method: Fow #roup the squares to#ether'

      and fill the center with a tile.

    "one+

    Puzzle

  • 8/9/2019 L04 Dis.math.

    33/43

    Some &emar,s

    ote .: It ma help to choose a stron#er hpothesis 

      than the desired result &e.#. G%ill in anwhereH(.

      ?e need to prove a stron#er statement' but in

      return we can assume a stron#er propert in

    the induction step.

    ote /: The induction proof of G%ill anwhereH implicitl

    defines a recursive al#orithm for findin# such a tilin#.

  • 8/9/2019 L04 Dis.math.

    34/43

    0aamar 1atri2

    0an ou construct an n*n matri* with all entries 71 and

    all the rows are ortho#onal to each otherC

    Two rows are ortho#onal if their inner product is ero.

    That is' let a 8 &a1' 2' an( and b 8 &b1' 2' bn('

    their inner product ab 8 a1b1 7 a5b5 7 2 7 anbn

    This matri* is famous and has applications in codin# theor.

    To thin= inductivel' first we come up with small e*amples.

    1 1

    1 1

  • 8/9/2019 L04 Dis.math.

    35/43

    0aamar 1atri2

    Then we use the small e*amples to build lar#er e*amples.

    Suppose we have an n*n >adamard matri* >n.

    ?e can use it to construct an 5n*5n >adamard matri* as follows.

    >n >n

    >n >n

    So b induction there is a 5= * 5= >ardmard matri* for an =.

    It is an e*ercise to chec= that the rows are ortho#onal to each other.

  • 8/9/2019 L04 Dis.math.

    36/43

    $nuctive )onstruction

    This technique is ver useful.

    ?e can use it to construct:

    codes

    #raphs

    matrices

    circuits

    al#orithms

    desi#ns

    proofs

    buildin#s

    2

  • 8/9/2019 L04 Dis.math.

    37/43

    This Lecture

    $ The idea of mathematical induction

    $ %asic induction proofs &e.#. equalit' inequalit' propert'etc(

    $ Inductive constructions

    $ ) parado*

  • 8/9/2019 L04 Dis.math.

    38/43

    Parao2

    Theorem:  )ll horses have the same color.

    +roof:  &b induction on n (

    Induction hpothesis:

    + &n ( ::8 an set of n  horses have the same color

    %ase case &n 8(:

    Fo horses so obviousl  true@

  • 8/9/2019 L04 Dis.math.

    39/43

    &Inductive case(

    )ssume an n  horses have the same color.

    +rove that an n7 1 horses have the same color.

    Parao2

    …n+1

  • 8/9/2019 L04 Dis.math.

    40/43

    2

    -irst set of n  horses have the same color

    Second set of n  horses have the same color

    &Inductive case(

    )ssume an n  horses have the same color.

    +rove that an n7 1 horses have the same color.

    Parao2

  • 8/9/2019 L04 Dis.math.

    41/43

    2

    Therefore the set of n 71 have the same color@

    &Inductive case(

    )ssume an n  horses have the same color.

    +rove that an n7 1 horses have the same color.

    Parao2

  • 8/9/2019 L04 Dis.math.

    42/43

    ?hat is wron#C

    +roof that + &n ( → + &n 71(

    is false if  n  8 1' because the two

    horse #roups do not overlap .

    -irst set of n8 1 horses

    n 81

    Second set of n8 1 horses

    Parao2

    &%ut proof wor=s for all n 3  1(

  • 8/9/2019 L04 Dis.math.

    43/43

    4uic, Summary

    ou should understand the principle of mathematical induction well'

    and do basic induction proofs li=e

    $ provin# equalit

    $ provin# inequalit

    $ provin# propert

    Mathematical induction has a wide ran#e of applications in computer science.

    In the ne*t lecture we will see more applications and more techniques.