CS311H Syllabus Calendar Office Hours Readings Assignments Resources

CS311H Discrete Mathematics for Computer Science

In-Class Activity: Mathematical Induction – Solutions

Oct 6, 2026


Recursively-Defined Sets and Functions

Problem 1: Recursively-defined sets

Give a recursive definition of the following. No need to mentions the exclusion rule.

  1. the set of even integers

    Show solution

    Let \(E\) be the set of even integers.

    Basis: \(0 \in E\)
    Recursive Step: if \(x \in E\), then \(x+2 \in E\) and \(x-2 \in E\).

  2. the set of positive integers such that for some positive integer \(x\), \(x-2\) is a multiple of 3.

    Show solution

    Let \(T\) be the set of positive integers such that for some positive integer \(x\), \(x-2\) is a multiple of 3.

    Basis: \(2 \in T\)
    Recursive Step: if \(x \in T\), then \(x+3 \in T\).

    Note: The set we described above can also be known as the set of positive integers congruent to 2 modulo 3.

  3. the set of positive integers not divisible by 5.

    Show solution

    Let \(F\) the set of positive integers not divisible by 5.

    Basis: \(1 \in F, 2 \in F, 3 \in F, 4 \in F\)
    Recursive Step: if \(x \in F\), then \(x+5 \in F\).

Problem 2: Recursively-defined sets

Let \(S\) be the subset of the set of ordered pairs of integers defined recursively by

Basis: \((0,0) \in S\)
Recursive Step: If \((a,b) \in S\), then \((a+2, b+3) \in S\), and \((a+3, b+2) \in S\).

List the elements of \(S\) produced by the first five applications of the recursive step.

Show solution

First Recursive Step: \((2,3), (3,2)\).
Second Recursive Step: \((4,6), (5,5), (6,4)\).
Third Recursive Step: \((6,9), (7,8), (8,7), (9,6)\).
Fourth Recursive Step: \((8,12), (9,11), (10,10), (11,9), (12,8)\).
Fifth Recursive Step: \((10,15), (11,14), (12,13), (13,12), (14,11), (15,10)\)

Problem 3: Recursively-defined functions

Find \(f(2), f(3), f(4), f(5)\) if \(f\) is defined recursively by
Basis: \(f(0)=f(1)=1\) and the following recursive steps

  1. \(f(n+1) = f(n) - f(n-1)\) for \(n \geq 1\)

    Show solution \[ \begin{array}{r c l} f(2) & = & f(1) - f(0) = 0 \\ f(3) & = & f(2) - f(1) = -1 \\ f(4) & = & f(3) - f(2) = -1 \\ f(5) & = & f(4) - f(3) = 0 \end{array} \]
  2. \(f(n+1) = f(n)f(n-1)\) for \(n \geq 1\)

    Show solution \[ \begin{array}{r c l} f(2) & = & f(1)f(0) = 1 \\ f(3) & = & f(2)f(1) = 1 \\ f(4) & = & f(3)f(2) = 1 \\ f(5) & = & f(4)f(3) = 1 \end{array} \]
  3. \(f(n+1) = f(n)^2 + f(n-1)^3\) for \(n \geq 1\)

    Show solution \[ \begin{array}{r c l} f(2) & = & f(1)^2 + f(0)^3 = 2 \\ f(3) & = & f(2)^2 + f(1)^3 = 5 \\ f(4) & = & f(3)^2 + f(2)^3 = 33 \\ f(5) & = & f(4)^2 + f(3)^3 = 1214 \end{array} \]
  4. \(f(n+1) = \dfrac{f(n)}{f(n-1)}\) for \(n \geq 1\)

    Show solution \[ \begin{array}{r c l} f(2) & = & \frac{f(1)}{f(0)} = 1 \\ f(3) & = & \frac{f(2)}{f(1)} = 1 \\ f(4) & = & \frac{f(3)}{f(2)} = 1 \\ f(5) & = & \frac{f(4)}{f(3)} = 1 \end{array} \]

Problem 4: Closed-formed formula

Find the closed-formed formula of the following recursively-defined functions:

  1. Basis: \(f(1) = 2\)
    Recursive Step: \(f(n) = f(n-1) + 4\) for \(n > 1\)

    Show solution

    \(f(n) = 4n - 2\)

  2. Basis: \(f(1) = 1\)
    Recursive Step: \(f(n) = f(n-1) + 2n - 1\) for \(n > 1\)

    Show solution

    \(f(n) = n^2\)

Proof by Mathematical Induction

Problem 5: Principles of Mathematical Induction

Using Principles of Mathematical Induction, prove that \[ \sum_{i=0}^{n} i = \frac{n(n+1)}{2}, \] where \(n\) is a non-negative integer.

Show solution

Proof:

Base case: \(n = 0\)
We need to show that \(\sum\limits_{i=0}^0 i = \frac{0(0+1)}{2}.\)

\[ \begin{array}{l} \sum\limits_{i=0}^0 i \\ = \langle \text{summation} \rangle \\ 0 \\ = \langle \text{arithmetic} \rangle \\ \frac{0(0+1)}{2} \end{array} \]

This proves the base case.

Inductive step: Inductive Hypothesis (IH): Assume that \(\sum\limits_{i=0}^k i = \frac{k(k+1)}{2},\) for \(k \geq 0\)

We need to show that \(\sum\limits_{i=0}^{k+1} i = \frac{(k+1)((k+1)+1)}{2}.\)

\[ \begin{array}{l} \sum\limits_{i=0}^{k+1} i \\ = \langle \text{algebra} \rangle \\ \sum\limits_{i=0}^{k} i + \sum\limits_{k+1}^{k+1} i \\ = \langle \text{IH} \rangle \\ \frac{k(k+1)}{2} + \sum\limits_{k+1}^{k+1} i \\ = \langle \text{algebra} \rangle \\ \frac{k(k+1)}{2} + (k+1) \\ = \langle \text{algebra} \rangle \\ \frac{k(k+1)}{2} + \frac{2(k+1)}{2} \\ = \langle \text{algebra} \rangle \\ \frac{(k+1)(k+2)}{2} \\ = \langle \text{algebra} \rangle \\ \frac{(k+1)((k+1)+1)}{2} \end{array} \]

This proves the inductive step.

By the Principle of Mathematical Induction, \(\sum\limits_{i=0}^n i = \frac{n(n+1)}{2},\) where \(n\) is a nonnegative integer.

Problem 6: Induction

The Fibonacci numbers \(f_n\), where \(n \geq 0\) are defined by \(f_0 = 0\), \(f_1 = 1\), and \(f_n = f_{n-1} + f_{n-2}\), when \(n \geq 2\). Using induction, prove that for all \(n \geq 0\), \(\sum\limits_{i=0}^{n} f_i = f_{n+2} - 1.\)

Clearly state which type of induction you used.

Show solution

Proof:

Base case: \(n = 0\). For this case we must show that \(\sum\limits_{i=0}^0 f_i = f_{0+2} - 1.\)

Also, \(f_2 = f_0 + f_1 = 0 + 1 = 1\)

\[ \begin{array}{l} \sum\limits_{i=0}^0 f_i \\ = \langle \text{summation} \rangle \\ f_0 \\ = \langle \text{base case of recursive def} \rangle \\ 0 \\ = \langle \text{arithmetic} \rangle \\ 1 - 1 \\ = \langle \text{substitution} \rangle \\ f_2 - 1 \end{array} \]

This proves the base case.

Inductive step: Inductive Hypothesis (I.H.): Assume that for \(k \geq 0\), \(\sum\limits_{i=0}^k f_i = f_{k+2} - 1.\) We have to show that \(\sum\limits_{i=0}^{k+1} f_i = f_{(k+1)+2} - 1.\)

\[ \begin{array}{l} \sum\limits_{i=1}^{k+1} f_i \\ = \langle \text{split-off last term} \rangle \\ \sum\limits_{i=1}^{k} f_i + f_{k+1} \\ = \langle \text{I.H.} \rangle \\ f_{k+2} - 1 + f_{k+1} \\ = \langle \text{algebra} \rangle \\ f_{k+2} + f_{k+1} - 1 \\ = \langle \text{recursive def} \rangle \\ f_{(k+2)+1} - 1 \end{array} \]

This proves the inductive step.

Therefore, by Principles of Mathematical Induction, for \(n \geq 0\), \(\sum\limits_{i=0}^n f_i = f_{n+2} - 1\)

Problem 7: Proof by Induction

Let \(a_1 = 1\), and \(a_n = a_{n-1} + 3\) for all \(n > 1\). Using Induction, show that \(a_n = 3n-2\) for all positive integers \(n\). Clearly state which kind of induction you have used.

Show solution

Proof:

Base case: \(n = 1\)
For this case, we must show \(a_1 = 3 \cdot 1 - 2.\)

\[ \begin{array}{l} a_1 \\ = \langle \text{definition} \rangle \\ 1 \\ = \langle \text{algebra} \rangle \\ 3 \cdot 1 - 2 \end{array} \]

This proves the base case.

Inductive step: Inductive Hypothesis (I.H.): Assume that \(a_k = 3k-2\) for all positive integers \(k \geq 1\).

We have to show that \(a_{k+1} = 3(k+1) - 2.\)

\[ \begin{array}{l} a_{k+1} \\ = \langle \text{recursive definition} \rangle \\ a_k + 3 \\ = \langle \text{I.H} \rangle \\ 3 \cdot k - 2 + 3 \\ = \langle \text{algebra} \rangle \\ 3 \cdot k + 3 - 2 \\ = \langle \text{algebra} \rangle \\ 3 \cdot (k+1) - 2 \end{array} \]

This proves the inductive step.

By the Principle of Mathematical Induction, \(a_n = 3n-2\) for all positive integers \(n\).

Problem 8: Inequalities

Prove that \[ 2^n \lt n!, \] for every integer \(n\) with \(n \geq 4.\)

Show solution

Proof:

Base case: \(n = 4\)
For this case, we must show \(2^4 \lt 4!,\)

\[ \begin{array}{l} 2^4 \\ = \langle \text{arithmetic} \rangle \\ 16 \\ \lt \langle \text{arithmetic} \rangle \\ 24 \\ = \langle \text{algebra} \rangle \\ 4! \end{array} \]

This proves the base case.

Inductive step: Inductive Hypothesis (IH): Assume that the result is true for \(k\), where \(k \geq 4\) that is, \(2^k \lt k!\)

We will show that the result holds for \(k+1\): \(2^{k+1} \lt (k+1)!\)

\[ \begin{array}{l} 2^{k+1} \\ = \langle \text{algebra} \rangle \\ 2^k \times 2 \\ \lt \langle \text{IH} \rangle \\ k! \times 2 \\ \lt \langle k \geq 4;\ \therefore\ 2 \lt k+1 \rangle \\ k! \times (k+1) \\ = \langle \text{algebra} \rangle \\ (k+1)! \end{array} \]

This proves the inductive step.

By the Principle of Mathematical Induction, \(2^n \lt n!\), for every integer \(n\) with \(n \geq 4\).

Problem 9: Principle of Mathematical Induction

Using the principle of mathematical induction, prove that \[ \sum_{i=1}^{n} \frac{1}{2^i} = \frac{2^n - 1}{2^n}, \] where \(n\) is a positive integer.

Show solution

Proof:

Base case: \(n = 1\) For this case, we must show \(\sum\limits_{i=1}^1 \frac{1}{2^i} = \frac{2^n - 1}{2^n}.\)

\[ \begin{array}{l} \sum\limits_{i=1}^1 \frac{1}{2^i} \\ = \langle \text{def of summation} \rangle \\ \frac{1}{2} \\ = \langle \text{arithmetic} \rangle \\ \frac{2^1 - 1}{2^1} \end{array} \]

This proves the base case.

Inductive step: Inductive Hypothesis (IH): Assume \(\sum\limits_{i=1}^k \frac{1}{2^i} = \frac{2^k - 1}{2^k}\), where \(k \geq 1\).

We need to show that \(\sum\limits_{i=1}^{k+1} \frac{1}{2^i} = \frac{2^{(k+1)} - 1}{2^{(k+1)}}.\)

\[ \begin{array}{l} \sum\limits_{i=1}^{k+1} \frac{1}{2^i} \\ = \langle \text{split off last term} \rangle \\ \sum\limits_{i=1}^{k} \frac{1}{2^i} + \frac{1}{2^{(k+1)}} \\ = \langle \text{IH} \rangle \\ \frac{2^k - 1}{2^k} + \frac{1}{2^{(k+1)}} \\ = \langle \text{algebra} \rangle \\ \frac{2^k - 1}{2^k} + \frac{1}{2 \cdot 2^k} \\ = \langle \text{algebra} \rangle \\ \frac{2\left(2^k - 1\right) + 1}{2 \cdot 2^k} \\ = \langle \text{algebra} \rangle \\ \frac{2^{(k+1)} - 1}{2^{(k+1)}} \end{array} \]

This proves the inductive step.

By Principle of Mathematical Induction, \(\sum\limits_{i=1}^{k+1} \frac{1}{2^i} = \frac{2^n - 1}{2^n}\), where \(n\) is a positive integer.

Problem 10: Number of subsets of a finite set

Use mathematical induction to prove that a finite set with \(n\) elements, where \(n\) is a non-negative integer, has \(2^n\) subsets.

Show solution

Proof:

Base case: \(n = 0\)
We need to show that a set with zero elements has \(2^0\) subsets.

Let set \(S\) have zero elements then \(S\) is the empty set \(\emptyset\). The empty set \(\emptyset\) has one subset–itself.

\[ \begin{array}{l} 2^0 \\ = \langle \text{arithmetic} \rangle \\ 1 \end{array} \]

Therefore, the number of subsets of \(\emptyset = 1 = 2^0.\)

This proves the base case.

Inductive step: Inductive Hypothesis (IH): Assume that a set with \(k\) elements has \(2^k\) subsets.

We have to show that the set with \(k+1\) elements has \(2^{k+1}\) subsets.

Let \(T\) be a set with \(k+1\) elements. Let \(T\) be constructed by added one element to some set with \(k\) elements. Let this set of \(k\) elements be \(S\), and this one element we added be \(a\). Therefore, we have \(T = S \cup \{a\}\), where \(a \notin S\).

The subsets of \(T\) can be constructed in the following way: If \(X \subseteq S\), then \(X \subseteq T\) and \(X \cup \{a\} \subseteq T\). That is, for each subset \(X\) of \(S\), we have two distinct subsets of \(T\).

By IH, we have \(2^k\) subsets of \(S\). Therefore, we have \(2 \times 2^k\) subsets of \(T\) or in other words \(2^{k+1}\) subsets of \(T\).

This completes the inductive step.

By Principle of Mathematical Induction, a finite set with \(n\) elements, where \(n\) is a non-negative integer, has \(2^n\) subsets.

Problem 11: Exponentiation

We can recursively-define \(a^n\), where \(a \neq 0\) with the following recursive definition:

Base case: \(a^0 = 1\)
Recursive step: \(a^{n+1} = a^n \cdot a\), \(n \geq 0\).

For every real number \(a\) (\(a \neq 0\)) and all natural numbers \(m, n\), show that \(a^{m+n} = a^m \cdot a^n\).

Show solution

Proof: Let \(a\) (\(a \neq 0\)) be an arbitrary real number, and \(m\) be an arbitrary natural number. We will prove the given result by induction on \(n\).

Base Case: \(n = 0\)
We need to show that \(a^{m+0} = a^m \cdot a^0.\)

\[ \begin{array}{l} a^{m+0} \\ = \langle \text{algebra} \rangle \\ a^m \\ = \langle \text{algebra} \rangle \\ a^m \cdot 1 \\ = \langle \text{recursive defintion of exponentiation} \rangle \\ a^m \cdot a^0. \end{array} \]

This proves the base case.

Inductive Case: Inductive Hypothesis (I.H.): Assume that \(a^{m+k} = a^m \cdot a^k\), for \(k \geq 0\).

We need to show that \(a^{m+(k+1)} = a^m \cdot a^{k+1}.\)

\[ \begin{array}{l} a^{m+(k+1)} \\ = \langle \text{algebra} \rangle \\ a^{(m+k)+1} \\ = \langle \text{recursive definition of exponentiation} \rangle \\ a^{(m+k)} \cdot a^1 \\ = \langle \text{IH} \rangle \\ a^m \cdot a^k \cdot a^1 \\ = \langle \text{recursive definition of exponentiation} \rangle \\ a^m \cdot a^{k+1} \end{array} \]

Therefore, we have proven the inductive step.

By Principle of Mathematical Induction, for every real number \(a\) and all natural numbers \(m, n\), \(a^{m+n} = a^m \cdot a^n\).