MELJUN CORTES Automata Lecture Turing Machines 2

Embed Size (px)

Citation preview

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    1/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 1 of 27

    Types of Proofs

    Types of ProofsMathematical Definitions and

    Theorems

    v  Definitions

    • A math emat ic al d ef in it io n  

    describes a concept or an

    object in math.

    • Definitions must clearly state

    what constitutes that object

    and what does not.

    • After defining a concept or anobject, mathematical

    statements can be made about

    them usually stating whether 

    or not they possess a certain

    property.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    2/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 2 of 27

    Types of Proofs

    v  Theorems

    • Mathematical statements may

    be true or not.

     A theorem   is a mathematicalstatement that has been

    proven to be true.

    Lemmas    are similar to

    theorems except that theyhave minor significance and

    are often used in proving

    theorems. In other words,

    they are stepping stones in the

    process of proving a theorem.

    Corol lar ies   are statements

    that can be proven deductively

    by applying other theorems.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    3/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 3 of 27

    Types of Proofs

    Types of Proof 

    v  Direct Proof 

    • One of the popular methods of 

    proving the correctness of 

    statements is by using

    established facts without

    making any further  

    assumptions.

    This is usually done by using

    proven theorems or lemmas in

    establishing the correctness of 

    the statement.

    This type of proof is called the

    d irec t p roo f    or  direct 

    argument .

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    4/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 4 of 27

    Types of Proofs

    Examples:

    Prove that the statement

    “division is transitive”,

    meaning, if  x   is divisible by  y ,

    and y  is divisible by z , then x  is

    divisible by z .

    Proof:

     x  is divisible by y  means

     x  = (a)y 

    y  is divisible by z  means

    y  = (b)z

    where   a   and   b   are

    integers.

     x  = (a)y  = (a)(b)z 

     x  = (ab)z 

    Since ab is also an integer,

    this means that   x    is

    divisible by z .

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    5/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 5 of 27

    Types of Proofs

    Prove that If  x  and y  are odd,

    then   xy   is also odd, where   x and y  are integers.

    Proof:

     x  is an odd integer means:

     x  = (2a + 1)

    y  is an odd integer means:

    y  = (2b + 1)

    where   a   and   b   are

    integers.

     xy  = (2a + 1 )(2b + 1)

    = 4ab + 2a +

    2b + 1

     xy  = 2 (2ab + a + b)+ 1

    Since (2ab  +  a  +  b) is an

    integer, this means that  xy 

    is also an odd integer.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    6/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 6 of 27

    Types of Proofs

    Prove that the sum of two

    rational numbers is a rationalnumber.

    Proof:

     x   is a rational number 

    means

     x  = a/b

    y   is a rational number 

    means

    y  = c/d

    where   a,   b,   c , and   d   are

    integers.

     x +y  = a/b + c /d = (ad  + cb)/(bd )

    Since (ad   +   cb) and (bd )

    are both integers, this

    means that   x   +   y   is a

    rational number.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    7/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 7 of 27

    Types of Proofs

    v  Proof by Contradiction

    • Proof b y c on trad ic t io n    starts

    by assuming the statement tobe proven is false and then

    deriving consequences or 

    outcomes.

    In the process, if acontradiction to what is known

    to be true is reached, then it

    implies that the initial

    assumption that the statement

    is false is incorrect.

    Therefore, the statement must

    be true.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    8/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 8 of 27

    Types of Proofs

    Examples:

    Prove that if 3 x   + 2 is odd,

    then  x   is odd, where   x   is an

    integer.

    Proof:

     Assume that 3 x  + 2 is odd

    but x  is even.

     x  is even means

     x  = 2awhere a is an integer.

    3 x  + 2 = 3(2a) + 2

    = 6a + 2

    = 2(3a + 1)Since (3a +1) is an integer,

    that means 3 x  + 2 is even

    (a contradiction).

    Therefore the statement istrue.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    9/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 9 of 27

    Types of Proofs

    Prove that if  x 2 is even, then x 

    is even.

    Proof:

     Assume that x 2 is even, but

     x  is odd.

     x  is odd means

     x  = 2a + 1

    where a is an integer.

     x 2 = (2a + 1)2

    = 4a2 + 4a + 1

    = 2(2a2 +2a) + 1

    Since (2a2 + 2a) is an

    integer, that means   x 2 is

    odd (a contradiction).

    Therefore the statement is

    true.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    10/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 10 of 27

    Types of Proofs

    Prove that the square root of 

    two is irrational.

    Proof:

     Assume that the square

    root of two is rational.

    If the square root of 2 is

    rational, then it means that

    where   a   and   b   are

    integers.

    Take note that   a   and   bmust not have common

    factors so that the fraction

    will be in its simplest form.

    This implies that either  a or 

    b must be odd (or both).

    b

    a=2

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    11/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 11 of 27

    Types of Proofs

    2 = a2/b2

    2b2 = a2

    This implies   a2

    is even. And if  a2 is even, then a is

    also even.

    Since   a   is even, this

    means that

    a = 2 x 

    where x  is an integer.

    2b2 = a2

    = (2 x )2

    = 4 x 2

    b2 = 2 x 2

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    12/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 12 of 27

    Types of Proofs

    This again implies that  b2

    is even which makes   beven also.

    Since both   a   and   b   are

    even, this produces a

    contradiction to thestatement earlier that at

    least one of them must be

    odd.

    This proves that the square

    root of two is irrational.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    13/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 13 of 27

    Types of Proofs

    v  Proof by Induction

    • Proo f by induc t ion    is useful

    in proving that all elements of 

    an infinite set, such as the set

    of natural numbers, possess a

    certain property.

    • Proof of induction starts off by

    first proving that the property

    in question is true for one of 

    the elements of the set,

    usually the first one.

    • The second step is to prove

    that if the property is true for 

    one element of the set, it is

    also true for the next element.

    • Once these two proofs have

    been established, then it can

    be concluded that the property

    is true for all members of the

    set.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    14/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 14 of 27

    Types of Proofs

    • The first step is called the

    bas is s tep    while the second

    step is called the i nduc t ion 

    step .

    • Formal Definition:

    Let   P   be the property to be

    proven true for an infinite set.

    Basis Step:

    Prove that P (1) is true.

    Induction Step:

    Prove that if   P (k ) is true,

    then  P (k  + 1) is also true

    for every positive integer  k .

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    15/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 15 of 27

    Types of Proofs

    Examples:

    Prove that 1 + 2 + … + n =

    ½ n(n+ 1) for all n  ≥ 1 (the sum

    of the first n integers).

    Basis Step: Prove P (1) is true.

    Let n = 1:

    1 = ½ (1) (1 + 1)

    1 = 1

    Induction Step: Prove that if 

    P (k ) is true, then  P (k  + 1) is

    also true for all k .

     Assume first that  P (k ) is true.

    That is,

    ( )12

    1...21   +=+++   k k k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    16/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 16 of 27

    Types of Proofs

    Now prove that   P (k   + 1) istrue. That is,

    ( ) ( )( )212

    11...21   ++=++++   k k k 

    ( ) ( )( )212

    11...21   ++=+++++   k k k k 

    ( ) ( ) ( )( )212

    111

    2

    1++=+++   k k k k k 

    ( ) ( )[ ]   ( )( )212

    1121

    2

    1++=+++   k k k k k 

    [ ]   ( )( )212

    122

    2

    1   2++=+++   k k k k k 

    [ ]   ( )( )212

    123

    2

    1   2++=++   k k k k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    17/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 17 of 27

    Types of Proofs

    This proves that if  P (k ) is true,

    the P (k  + 1) is also true for all

    k .

    Therefore, the property 1 + 2 +

    … + n = ½ n(n+ 1) for all n  ≥ 1

    is true.

    [ ]   ( )( )212

    123

    2

    1   2++=++   k k k k 

    ( ) ( )( )212

    1)2(1

    2

    1++=++   k k k k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    18/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 18 of 27

    Types of Proofs

    Prove that the sum of the first

    n odd positive integers is n2 .

    Basis Step: Prove P (1) is true.

    Let n = 1:

    1 = (1)2

    1 = 1

    Induction Step: Prove that if 

    P (k ) is true, then  P (k  + 1) is

    also true for all k .

     Assume first that  P (k ) is true.

    That is,

    2)12(...531   k k    =−++++

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    19/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 19 of 27

    Types of Proofs

    Now prove that   P (k   + 1) istrue. That is,

    This proves that if  P (k ) is true,

    then P (k  + 1) is also true for allk .

    Therefore, the statement that

    the sum of the first   n   odd

    positive integers is n2  is true.

    ( ) ( )2112...531   +=+++++   k k 

    ( ) ( ) ( )211212...531   +=++−++++   k k k 

    ( ) ( )22 112   +=++   k k k 

    ( ) ( )22 11   +=+   k k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    20/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 20 of 27

    Types of Proofs

    Prove that n3 – n is divisible by

    3 whenever   n   is a positive

    integer.

    Basis Step: Prove P (1) is true.

    Let n = 1:

    13 - 1 = 0

    0 is divisible by 3.

    Induction Step: Prove that if 

    P (k ) is true, then  P (k  + 1) is

    also true for all k .

     Assume first that  P (k ) is true.

    That is:

    is divisible by 3.

    k k    −3

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    21/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 21 of 27

    Types of Proofs

    Now prove that   P (k   + 1) is

    true. That is:

    is divisible by 3.

    ( ) ( )11   3 +−+   k k 

    ( )   ( )1133   23 +−+++   k k k k 

    1133   23 −−+++   k k k k 

    k k k k    −++   33   23

    k k k k    33   23 ++−

    k k k k    ++−  23 3

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    22/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 22 of 27

    Types of Proofs

    Take note that it was

    established earlier that  k 3  –  k 

    is divisible by 3. The term 3(k 2+ k ) is also divisible by 3. This

    makes the entire term divisible

    by 3.

    This proves that if  P (k ) is true,then P (k  + 1) is also true for all

    k .

    Therefore, the statement that

    n3  –   n   is divisible by 3

    whenever    n   is a positive

    integer is true.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    23/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 23 of 27

    Types of Proofs

    Prove that 7n – 1 is divisible by

    6 for all n  ≥ 1.

    Basis Step: Prove P (1) is true.

    Let n = 1:

    71 - 1 = 6

    6 is divisible by 6.

    Induction Step: Prove that if 

    P (k ) is true, then  P (k  + 1) is

    also true for all k .

     Assume first that  P (k ) is true.

    That is:

    is divisible by 6.

    17   −k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    24/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 24 of 27

    Types of Proofs

    Now prove that   P (k   + 1) is

    true. That is:

    is divisible by 6.

    17   )1( −+k 

    17   )1( −+k 

    177   −⋅  k 

    6777   +−⋅  k 

    6177   +−k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    25/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 25 of 27

    Types of Proofs

    Take note that it was

    established earlier that  7 k  – 1is divisible by 6. Therefore,

    the term 7(7k   – 1) is also

    divisible by 6.

    This proves that if  P (k ) is true,then P (k  + 1) is also true for all

    k .

    Therefore, the statement that

    7n – 1 is divisible by 6 for all n

    ≥ 1 is true.

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    26/27

    Theory of Computation (With Automata Theory)

    * Property of STI 

    Page 26 of 27

    Types of Proofs

    Prove that 20 + 21 + 22 + … +

    2n = 2(n+1) – 1 for all n  ≥ 0.

    Basis Step: Prove P (0) is true.

    Let n = 0:

    20 = 2(0+1) – 1

    1 = 2 – 1

    1 = 1

    Induction Step: Prove that if 

    P (k ) is true, then  P (k  + 1) is

    also true for all k .

     Assume first that  P (k ) is true.

    That is,

    ( )122...222

      1210−=++++

      +k k 

  • 8/21/2019 MELJUN CORTES Automata Lecture Turing Machines 2

    27/27

    Theory of Computation (With Automata Theory)

    Now prove that   P (k   + 1) is

    true. That is,

    ( ) ( )122...222

      111210−=++++

      +++   k k 

    ( ) ( )1222...222

      21210−=+++++

      ++   k k k 

    ( ) ( ) ( ) 12212   211 −=+−   +++   k k k 

    ( ) ( ) ( ) 12122   211 −=−+   +++   k k k 

    ( ) ( ) 12122   21 −=−⋅   ++   k k 

    ( ) ( ) 1212   22 −=−   ++   k k