Discrete Mathematics : Sequences

Contents

Sequences

Types of sequences

Recursive and non-recursive definitions

Growth of sequences

Term and sequence

Sum and product definition

Sum and product properties

Factorial function

Ordinary Mathematical Induction

Core idea

proofs-induction

Template

Proposition: For all integers $n \ge a$, a property $P(n)$ is true.

Proof

Why does the template work?

Proposition: For all integers $n \ge a$, a property $P(n)$ is true.

Proof

Why does the proof work?

  1. $P(a)$ (base case)
    $P(a) \rightarrow P(a + 1)$ (inductive hypothesis)
    $\therefore P(a + 1)$
  2. $P(a + 1)$ (conclusion from argument 1)
    $P(a+1) \rightarrow P(a + 2)$ (inductive hypothesis)
    $\therefore P(a + 2)$
  3. $P(a + 2)$ (conclusion from argument 2)
    $P(a+2) \rightarrow P(a + 3)$ (inductive hypothesis)
    $\therefore P(a + 3)$
  4. so on... $P(a+4), P(a+5), \ldots$

$1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}$

Pattern

Proposition: $1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}$ for all integers $n \ge 1$.

Proof

Let $P(n)$ denote $1 + 2 + \cdots + n = \frac{n(n+1)}{2}$.

$\left( 1 - \frac{1}{2} \right) \left( 1 - \frac{1}{3} \right) \cdots \left( 1 - \frac{1}{n} \right) = \frac{1}{n}$

Proposition: $\left( 1 - \frac{1}{2} \right) \left( 1 - \frac{1}{3} \right) \cdots \left( 1 - \frac{1}{n} \right) = \frac{1}{n}$ for all integers $n \ge 2$.

Proof

Let $P(n)$ denote $\left( 1 - \frac{1}{2} \right) \left( 1 - \frac{1}{3} \right) \cdots \left( 1 - \frac{1}{n} \right) = \frac{1}{n}$.

$\frac{1}{1 \cdot 2} + \frac{1}{2 \cdot 3} + \cdots + \frac{1}{n \cdot (n+1)} = \frac{n}{n+1}$

Proposition: $\frac{1}{1 \cdot 2} + \frac{1}{2 \cdot 3} + \cdots + \frac{1}{n \cdot (n+1)} = \frac{n}{n+1}$ for all integers $n \ge 1$.

Proof

Let $P(n)$ denote $\frac{1}{1 \cdot 2} + \frac{1}{2 \cdot 3} + \cdots + \frac{1}{n \cdot (n+1)} = \frac{n}{n+1}$.

Problems for practice

For all integers $n \ge 1$:

$F(0)^2 + F(1)^2 + \cdots + F(n)^2 = F(n)F(n+1)$

Proposition: Fibonacci sequence is: $F(0) = 1$, $F(1) = 1$, and
$F(n) = F(n - 1) + F(n - 2)$ for $n \ge 2$. Prove that:
$F(0)^2 + F(1)^2 + \cdots + F(n)^2 = F(n)F(n+1)$ for all $n \ge 0$.

Proof

Let $P(n)$ denote $F(0)^2 + F(1)^2 + \cdots + F(n)^2 = F(n)F(n+1)$.

$1 + r + r^2 + \cdots + r^n = \frac{r^{n+1}-1}{r - 1}$

Proposition: $1 + r + r^2 + \cdots + r^n = \frac{r^{n+1}-1}{r - 1}$ for $r \ne 1$ and for all integers $n \ge 1$.

Proof

Let $P(n)$ denote $1 + r + r^2 + \cdots + r^n = \frac{r^{n+1}-1}{r - 1}$.

$2^{2n} - 1$ is divisible by $3$

Proposition: $2^{2n} - 1$ is divisible by $3$, for all integers $n \ge 0$.

Proof

Let $P(n)$ denote $2^{2n} - 1$ is divisible by $3$.

Problems for practice

For all integers $n \ge 0$:

$x^{n} - y^{n}$ is divisible by $x - y$

Proposition: $x^{n} - y^{n}$ is divisible by $x - y$, for all integers $x, y$ such that $x \ne y$, for all integers $n \ge 0$.

Proof

Let $P(n)$ denote $x^{n} - y^{n}$ is divisible by $x - y$, s.t. $x \ne y$.

$2^{n} < n!$

Proposition: $2^{n} < n!$, for all integers $n \ge 4$.

Proof

Let $P(n)$ denote $2^{n} < n!$.

$n^2 < 2^n$

Proposition: $n^2 < 2^n$, for all integers $n \ge 5$.

Proof

Let $P(n)$ denote $n^2 < 2^n$.

Tiling board with L-shaped trominoes

Proposition: If one square is removed from a $2^n \times 2^n$ board, the remaining squares can be completely covered by L-shaped trominoes, for all integers $n \ge 1$.

Example

Proposition: If one square is removed from a $2^n \times 2^n$ board, the remaining squares can be completely covered by L-shaped trominoes, for all integers $n \ge 1$.

Proof

Let $P(n)$ denote ''A $2^n \times 2^n$ board with a square removed can be completely covered by L-shaped trominoes.''

Bogus proofs

Proposition: All dogs in the world have the same color.

Proof

Let $P(n)$ denote ''In any collection of $n$ dogs, all of them have the same color.''

Proposition: All sand in the world cannot make a heap.

Proof

Let $P(n)$ denote ''$n$ grains of sand is not a heap.''

Proposition: We are nonliving things.

Proof

Let $P(n)$ denote ''$n$ atoms of matter is nonliving.''

Strong Mathematical Induction

Equivalence

Equivalence: Ordinary and strong mathematical induction techniques are equivalent to each other. In other words, Any statement that can be proved with ordinary mathematical induction can be proved with strong mathematical induction and vice versa.

Why strong induction?

There are many propositions for which strong mathematical induction seems both simpler and more natural way of proving

Template

Proposition: For all integers $n \ge a$, a property $P(n)$ is true.

Proof

$a_n = 5^n - 1$

Proposition: Consider the sequence: $a_0 = 0$, $a_1 = 4$, and
$a_k = 6 a_{k - 1} - 5 a_{k - 2}$ for all integers $k \ge 2$.
Prove that $a_n = 5^n - 1$ for all integers $n \ge 0$.

Proof

Let $P(n)$ denote ''$a_n = 5^n - 1$.''

Problems for practice

$n > 1$ is divisible by prime

Proposition: Any integer greater than 1 is divisible by a prime number.

Proof

Let $P(n)$ denote ''$n$ is divisible by a prime number.''

3-cent and 5-cent coins

Proposition: $n$ cents can be obtained using a combination of 3- and 5-cent coins, for all integers $n \ge 8$.
(Assume you have an infinite supply of 3- and 5-cent coins.)

Proof

Let $P(n)$ denote ''$n$ cents can be obtained using a combination of 3- and 5-cent coins.''

Proof (improved)

Let $P(n)$ denote ''$n$ cents can be obtained using a combination of 3- and 5-cent coins.''

3-cent and 5-cent coins (Ordinary induction)

Solve the previous problem using ordinary induction.

Proof (invalid)

Let $P(n)$ denote ''$n$ cents can be obtained using a combination of 3- and 5-cent coins.''

Incorrect! What's wrong?

Proof (invalid)

Let $P(n)$ denote ''$n$ cents can be obtained using a combination of 3- and 5-cent coins.''

Incorrect! What's wrong?

Proof

Let $P(n)$ denote ''$n$ cents can be obtained using a combination of 3- and 5-cent coins.''

Problems for practice

Recursion

Some recursive functions

Relationship between induction and recursion

Recursion Ordinary induction Strong induction
Base case Basis: $f(a)$ Basis: $f(a), f(a + 1), \ldots, f(b)$
Recursive case Induction: Prove $f(n)$ from $f(n-1)$ Induction: Prove $f(n)$ from $f(n - 1), f(n - 2), \ldots, f(a)$

Arithmetic sequence

Definitions

Example

Problem: A skydiver's speed upon leaving an airplane is approx. 9.8 m/sec one second after departure, 9.8 + 9.8 = 19.6 m/sec two seconds after departure, and so forth. How fast would the skydiver be falling 60 seconds after leaving the airplane?

Solution:

Geometric sequence

Definition

Example

Problem: Suppose you deposit 100,000 dollars in your bank account for your newborn baby. Suppose you earn 3% interest compounded annually.
How much will be the amount when your kid hits 21 years of age?

Solution:

Problem: Suppose you deposit 100,000 dollars in your bank account for your newborn baby. Suppose you earn 3% interest compounded quarterly.
How much will be the amount after 84 quarters (or periods)?

Solution:

Towers of Hanoi

Problem: There are $k$ disks on peg 1. Your aim is to move all $k$ disks from peg 1 to peg 3 with the minimum number of moves. You can use peg 2 as an auxiliary peg. The constraint of the puzzle is that at any time, you cannot place a larger disk on a smaller disk.
What is the minimum number of moves required to transfer all $k$ disks from peg 1 to peg 3?
proofs-toh-initial.png proofs-toh-final.png

Workout

Suppose $k = 1$. Then, the 1-step solution is:
  1. Move disk 1 from peg $A$ to peg $C$.
proofs-hanoi-1.png
Source: http://mathforum.org/dr.math/faq/faq.tower.hanoi.html
Suppose $k = 2$. Then, the 3-step solution is:
  1. Move disk 1 from peg $A$ to peg $B$.
  2. Move disk 2 from peg $A$ to peg $C$.
  3. Move disk 1 from peg $B$ to peg $C$.
proofs-hanoi-2.png
Source: http://mathforum.org/dr.math/faq/faq.tower.hanoi.html
Suppose $k = 3$. Then, the 7-step solution is:
  1. Move disk 1 from peg $A$ to peg $C$.
  2. Move disk 2 from peg $A$ to peg $B$.
  3. Move disk 1 from peg $C$ to peg $B$.
  4. Move disk 3 from peg $A$ to peg $C$.
  5. Move disk 1 from peg $B$ to peg $A$.
  6. Move disk 2 from peg $B$ to peg $C$.
  7. Move disk 1 from peg $A$ to peg $C$.
proofs-hanoi-3.png
Suppose $k = 4$. Then, the 15-step solution is:
  1. Move disk 1 from peg $A$ to peg $B$.
  2. Move disk 2 from peg $A$ to peg $C$.
  3. Move disk 1 from peg $B$ to peg $C$.
  4. Move disk 3 from peg $A$ to peg $B$.
  5. Move disk 1 from peg $C$ to peg $A$.
  6. Move disk 2 from peg $C$ to peg $B$.
  7. Move disk 1 from peg $A$ to peg $B$.
  8. Move disk 4 from peg $A$ to peg $C$.
  9. Move disk 1 from peg $B$ to peg $C$.
  10. Move disk 2 from peg $B$ to peg $A$.
  11. Move disk 1 from peg $C$ to peg $A$.
  12. Move disk 3 from peg $B$ to peg $C$.
  13. Move disk 1 from peg $A$ to peg $B$.
  14. Move disk 2 from peg $A$ to peg $C$.
  15. Move disk 1 from peg $B$ to peg $C$.

Solution

For any $k \ge 2$, the recursive solution is:
  1. Transfer the top $k - 1$ disks from peg $A$ to peg $B$.
  2. Move the bottom disk from peg $A$ to peg $C$.
  3. Transfer the top $k - 1$ disks from peg $B$ to peg $C$.
proofs-toh-initial.png proofs-toh-mid1.png
proofs-toh-mid2.png proofs-toh-final.png

Algorithm

\begin{algorithm}
\begin{algorithmic}
\FUNCTION{Towers-of-Hanoi}{$k, A, C, B$}
  \IF{$k = 1$}
    \STATE Move disk $k$ from $A$ to $C$
  \ELSIF{$k \ge 2$}
    \STATE \CALL{Towers-of-Hanoi}{$k - 1, A, B, C$}
    \STATE Move disk $k$ from $A$ to $C$
    \STATE \CALL{Towers-of-Hanoi}{$k - 1, B, C, A$}
  \ENDIF
\ENDFUNCTION
\end{algorithmic}
\end{algorithm}
  

Greatest common divisor (GCD)

Problem: Compute the greatest common divisor (GCD) of two integers efficiently.

Definition

Solution

Algorithm

\begin{algorithm}
\begin{algorithmic}
\FUNCTION{GCD}{$a, b$}
  \IF{$b = 0$} \RETURN $a$
  \ELSE \RETURN \CALL{GCD}{$b, a \bmod b$}
  \ENDIF
\ENDFUNCTION
\end{algorithmic}
\end{algorithm}
  

More Induction Problems

$1/1^2 + 1/2^2 + \cdots + 1/n^2$

Problem: Prove that $\frac{1}{1^2} + \frac{1}{2^2} + \cdots + \frac{1}{n^2} < 2$ for all natural numbers $n \ge 1$.

Solution

It is difficult to solve the problem directly.
It is sometimes easier to prove a stronger result.
We prove the stronger statement that $\sum_{i=1}^n \frac{1}{i^2} < 2 - \frac{1}{n}$.
Let $P(n)$ denote $\sum_{i=1}^n \frac{1}{i^2} < 2 - \frac{1}{n}$ for $n \ge 2$.

$x^n + 1/x^n$

Problem: Suppose $x \in \mathbb{R}^+$ and $(x + 1/x) \in \mathbb{Z}$. Prove using strong induction that $(x^n + 1/x^n) \in \mathbb{Z}$ for all natural numbers $n$.

Solution

Let $P(n)$ denote $(x^n + 1/x^n) \in \mathbb{Z}$ for $n \ge 1$.

Chocolate bar

Problem: Prove that breaking a chocolate bar with $n \ge 1$ pieces into individual pieces requires $n - 1$ breaks.

Solution

Let $P(n)$ denote ''Breaking a chocolate bar with $n$ pieces into individual pieces requires $n - 1$ breaks''.
chocolatebar

McCarthy's 91 function

Problem: Let $M : \mathbb{Z} \to \mathbb{Z}$ be the following function. \begin{align*} M(n) &= \begin{cases} n - 10 & \text{if } n \ge 101, \\ M(M(n + 11)) & \text{if } n \le 100. \end{cases} \end{align*} Prove that $M(n) = 91$ for all integers $n \le 100$.

Solution

Staircase problem

Problem: You need to ascend a staircase consisting of $n$ steps. The number of steps you can climb at a time is at most $b$. What is the number of ways of ascending the staircase?

Solution

Steps Ways #Ways
$1$ $1$ $1$
$2$ $1+1$, $2$ $2$
$3$ $1+1+1$, $1+2$, $2+1$, $3$ $4$
$4$ $1+1+1+1$, $1+1+2$, $1+2+1$, $2+1+1$, $2+2$, $1+3$, $3+1$, $4$ $8$

Continued fractions

Problem: Prove that every rational number can be written as a continued fraction.

Basics

Proof

Let $P(d)$ denote ''Any rational with denominator $d$ has a continued fraction''.