Mathematical Preliminaries for COMP372 Algorithms
Methematical Proof Techniques
Throughtout the courses in COMP272 and COMP372, we use quite often two most commonly used proof techniques: proof by contradiction and proof by mathemetical induction.
Proof by Contradition
To prove a statement by contradiction, we first assume that the statement is false, then we find a logical contradiction stemming from this assumption. If the logic used to find the contradiction is correct, then the only way to resolve the contradiction is to recognize that the assumption that the theorem is false must be incorrect, that is, to conclude that the statement must be true.
Example 1: To prove that there is no largest integer.
Proof: Let us prove it with Proof by contradiction.
Step 1: Contrary assumption: assume that the statement "there is no largest integer." is incorrect. That is, there is a largest integer, called it \(m\).
Step 2: Show this assumption leads to a contradiction: consider \(n = m + 1\). \( n \) is an integer as it is the sum of two integers. Also, \( n > m \). Thus, we have reached a contradiction. The only flaw in our reasoning is the initial assumption - the statement is false. Thus, we conclude that the statement is correct.
Proof by Mathematical Induction
Let \( T \) be a theorem to prove, and express \( T \) in terms of a positive integer parameter \( n \).
T is true for any \( n \leq c \), where c is some small constant, if: 1. Base case : \( T \) holds for \( n = c \), and
2. Induction step : If \( T \) holds for \( n-1 \), then \(T\) holds for \( n \).
An alternative formulation of the induction step is known as Strong induction.
The induction step for strong induction is:
2a. Induction step: if \(T \) holds for all \( k: c \leq k < n,\) then \( T \) holds for \( n. \) What makes mathematically induction so powerful is that we can take advantage of the assumption that \( T \) holds for all values less than \( n \) help us prove that \(T \) holds for \(n \). This is known as the induction hypothesis . Having this assumption to work with makes the induction step easier to prove than tackling the original theorem itself.
Example 2 To prove: The sum of the first \( n \) numbers is \( \frac{n(n+1)}{2} \).
Proof: The proof is by mathemetical induction.
1. Check the base case: For \( n = 1, \) the sum is simply 1. The formula states that for \( n =1 \), 1(1+1)/2 =1. Thus, the formula is correct for the base case.
2. State the induction hypothesis. The induction hypothesis is
3. Use the assumption from the induction hypothesis for \(n-1\) to show that the result is true for \(n\).
Since \( \sum_{i=1}^{n} {i} = \sum_{i=1}^{n-1} {i} + n \), we have \( \sum_{i=1}^{n} {i} = \sum_{i=1}^{n-1} {i} + n = \frac{(n-1)n}{2} + n = \frac{n^2-n+2n}{2} = \frac{n(n+1)}{2} \)
Thus, by mathemetical induction,
Self-Testing Quizzes
Your grade is: __