Set6 - Induction and Recursion - Lecture Notes

Induction and Recursion

Themes of the Lecture

  • Principle of Mathematical Induction: This is the most important topic, especially concerning the exam, providing a method to prove statements for an infinite number of parameters like all natural numbers.
  • Well-Ordering Principle: It is logically equivalent to the principle of mathematical induction. This principle can help to show the principle of mathematical induction is true.
  • Sequences and Recursion: They're related to mathematical induction by providing examples where mathematical induction can be applied. This serves as the core motivation.
  • Transitive Closure: This topic relates back to lecture two and focuses on relations, ordering relations, and equivalence relations to complete the discussion.

Principle of Mathematical Induction

  • Used for theorems involving a statement ss that depends on an integer nn, denoted as sns_n, to prove it holds for all integers greater than or equal to a starting integer aa.
  • Proves an infinite number of statements by proving just two things:
    • Base Case: Prove the statement holds for the integer n=an = a. This is usually straightforward.
    • Inductive Step: Prove that if the statement holds for n=mn = m, then it also holds for n=m+1n = m + 1, i.e., s<em>m    s</em>m+1s<em>m \implies s</em>{m+1} for all mam \geq a.
  • After proving the inductive step showing that s<em>a    s</em>a+1s<em>a \implies s</em>{a+1}, we can show that sa+1s_{a+1} holds true.
  • Knowing that s<em>a+1s<em>{a+1} holds true, as s</em>a+1    s<em>a+2s</em>{a+1} \implies s<em>{a+2}, we can argue that s</em>a+2s</em>{a+2} holds true.
  • Iterating this way, we can prove that ss holds for any arbitrary integer nn.
  • The inductive step needs to be iterated nan - a times to reach the integer nn.
  • The principle of mathematical induction goes beyond first-order logic.
  • Formal Statement: Assuming s<em>as<em>a holds true (base case), and for all mam \geq a, s</em>m    s<em>m+1s</em>m \implies s<em>{m+1} (inductive step), then for all nan \geq a, s</em>ns</em>n holds true.

Practical Application of Mathematical Induction

  1. Base Case: Prove that sas_a is true. Often, this is trivial.
  2. Inductive Step: For any mam \geq a, prove that s<em>m    s</em>m+1s<em>m \implies s</em>{m+1}.
    • Choose an arbitrary mam \geq a. This is standard.
    • Assume that sms_m holds true (Induction Hypothesis or IH).
    • Show that this assumption implies sns_n for n=m+1n = m + 1.
Example 1

Prove that k=0n2k=2n+11\sum_{k=0}^{n} 2^k = 2^{n+1} - 1 for all non-negative integers nn.

  • Base Case: For n=0n = 0, the sum is just 20=12^0 = 1. And 20+11=21=12^{0+1} - 1 = 2 - 1 = 1.
  • Inductive Step:
    • Let m0m \geq 0 be arbitrary.
    • Assume that k=0m2k=2m+11\sum_{k=0}^{m} 2^k = 2^{m+1} - 1 (IH).
    • We want to show that k=0m+12k=2(m+1)+11=2m+21\sum_{k=0}^{m+1} 2^k = 2^{(m+1)+1} - 1 = 2^{m+2} - 1.
    • Starting with the left side, we have:
      <em>k=0m+12k=</em>k=0m2k+2m+1\sum<em>{k=0}^{m+1} 2^k = \sum</em>{k=0}^{m} 2^k + 2^{m+1}
    • Using the induction hypothesis, we replace the sum up to mm:
      =(2m+11)+2m+1= (2^{m+1} - 1) + 2^{m+1}
      =22m+11= 2 * 2^{m+1} - 1
      =2m+21= 2^{m+2} - 1
    • This matches the right side of the desired result.
Example 2

Prove that k=1nk=n(n+1)2\sum_{k=1}^{n} k = \frac{n(n+1)}{2} for all integers n1n \geq 1.

  • Base Case: For n=1n = 1, the sum is just 11. And 1(1+1)2=22=1\frac{1(1+1)}{2} = \frac{2}{2} = 1.
  • Inductive Step:
    • Let m1m \geq 1 be arbitrary.
    • Assume that k=1mk=m(m+1)2\sum_{k=1}^{m} k = \frac{m(m+1)}{2} (IH).
    • We want to show that k=1m+1k=(m+1)((m+1)+1)2=(m+1)(m+2)2\sum_{k=1}^{m+1} k = \frac{(m+1)((m+1)+1)}{2} = \frac{(m+1)(m+2)}{2}.
    • Starting with the left side, we have:
      <em>k=1m+1k=</em>k=1mk+(m+1)\sum<em>{k=1}^{m+1} k = \sum</em>{k=1}^{m} k + (m+1)
    • Using the induction hypothesis, we replace the sum up to mm:
      =m(m+1)2+(m+1)= \frac{m(m+1)}{2} + (m+1)
      =m(m+1)+2(m+1)2= \frac{m(m+1) + 2(m+1)}{2}
      =(m+1)(m+2)2= \frac{(m+1)(m+2)}{2}
    • This matches the right side of the desired result.

Well-Ordering Principle

  • Given a partially ordered set BB and a subset AA of BB, an element bBb \in B is a lower bound for AA if bab \leq a for all aAa \in A.
  • Zero is a lower bound for the set of all positive integers, rational numbers, and real numbers.
  • The Well-Ordering Principle states that every non-empty subset AA of the set of integers Z\mathbb{Z} that has a lower bound also has a smallest element.
  • The set of rational numbers does not satisfy the well-ordering principle. Zero is a lower bound for the set of all positive rational numbers, but there is no smallest positive rational number.
  • The well-ordering principle is logically equivalent to the principle of mathematical induction.
Well-Ordering Implies Mathematical Induction
  • Assume the base case s<em>as<em>a holds true, and the inductive step s</em>m    sm+1s</em>m \implies s_{m+1} is true for all mam \geq a.
  • Define the set AA as the set of all integers nan \geq a for which sns_n is false.
  • If A is non-empty, it has a lower bound, aa. If true then A has a smallest element. Let it be nn. The n must be greater than aa.
  • Therefore, s<em>ns<em>n is false, but s</em>n1s</em>{n-1} is true. However, the inductive step states that if s<em>n1s<em>{n-1} is true, then s</em>ns</em>n must also be true. This is a contradiction.
  • Therefore, A must be empty, implying that sns_n is true for all nan \geq a.
Mathematical Induction Implies Well-Ordering
  • Assume that every subset of the integers having a lower bound has a smallest element and assume by contradiction that a subset has no smallest element, then we deduce that it must be empty.
  • For all integers k < n, and for all integers nbn \geq b, show that k cannot belong to A.
  • Prove the base case. In the case where n=bn = b, and for all k < n, k will not belong to A because b is the lower bound.
  • Apply the inductive step and you can conclude that A has to be empty.

Sequences and Recursion

  • A sequence is a function from the set of natural numbers to an arbitrary set A. For any natural number nn, it assigns an element in the set A.
  • A common notation is t<em>nt<em>n, where n is a parameter and t</em>nt</em>n is the nth term of the sequence.
  • Sequences are often defined recursively.
  • Geometric Sequence: Defined recursively with a base case t<em>0=ct<em>0 = c and t</em>n+1=rt<em>nt</em>{n+1} = rt<em>n, where r is a real number. The closed formula is t</em>n=crnt</em>n = cr^n.
  • Factorials: Defined recursively with t<em>0=1t<em>0 = 1 and t</em>n+1=(n+1)tnt</em>{n+1} = (n+1)t_n. This results in multiplying all natural numbers up to n. No closed formula for this, and it is abbreviated by n!n!. n!=n(n1)(n2)1n! = n * (n-1) * (n-2) … 1
Example: Number of Diagonals of an nn-gon
  • tnt_n is the number of diagonals of an n-gon.
  • Recursive definition:
    • t<em>3=0t<em>3 = 0, t</em>4=2t</em>4 = 2, t5=5t_5 = 5
    • t<em>n+1=t</em>n+n1t<em>{n+1} = t</em>n + n - 1
  • Closed formula: tn=n(n3)2t_n = \frac{n(n-3)}{2}
Proof using Mathematical Induction:
  • Base Case: For n=3n=3, t3=0t_3 = 0. And 3(33)2=0\frac{3(3-3)}{2} = 0.
  • Inductive Step:
    • Let m3m \geq 3 be arbitrary.
    • Assume that tm=m(m3)2t_m = \frac{m(m-3)}{2} (IH).
    • We want to show that tm+1=(m+1)((m+1)3)2=(m+1)(m2)2t_{m+1} = \frac{(m+1)((m+1)-3)}{2} = \frac{(m+1)(m-2)}{2}.
    • Using the recursion formula and the induction hypothesis:
      t<em>m+1=t</em>m+m1=m(m3)2+m1t<em>{m+1} = t</em>m + m - 1 = \frac{m(m-3)}{2} + m - 1
      =m23m+2m22= \frac{m^2 - 3m + 2m - 2}{2}
      =m2m22= \frac{m^2 - m - 2}{2}
      =(m+1)(m2)2= \frac{(m+1)(m-2)}{2}
    • This matches the right side of the desired result.

Transitive Closure

  • A binary relation RR in a set AA is a subset of the Cartesian product of AA with itself, A×AA \times A.
  • The relation RnR^n is defined recursively by R1=RR^1 = R and Rn+1=RnRR^{n+1} = R^n \circ R, where \circ denotes the composition of relations.
  • RnR^n represents a path of exactly nn steps from xx to yy in the directed graph representation of RR.
  • The transitive closure of a binary relation RR, denoted as RR^*, is the smallest transitive relation containing RR.
  • RR^* is defined as the union of all RnR^n for n1n \geq 1, i.e., there's a path of finite length from xx to yy in the directed graph.
  • If the relation is already transitive, nothing changes.
  • If using a Hasse Diagram start by adding the reflexive arrows, that you may have an easier time interpreting it.