Professional Documents
Culture Documents
ANALYSIS OF
ALGORITHMS
Course Code : AR212
Credit Hours :3
Prerequisite : AR211
Instructor Information
[Pre-req. AR211
Textbook: Introduction to Algorithms, Thomas Cormen, Charls Leiserson & Ronald Rivest. 3rd Edition,
MIT Press, 2009.
Chapter 2
Mathematica
l
Background
Dr. Aryaf Al-Adwan
Autonomous Systems Dept.
Design and Analysis of algorithms
Course Dr. Aryaf Al-Adwan
8
Outlin
e1. Review of Necessary Mathematics
2. Summations
3. Mathematical Induction
4. Functions In particular, it is not assumed that you
have studied calculus. However, a
5. Logarithms certain amount of mathematics is
6. Recurrences Later necessary for the analysis of algorithms.
This chapter reviews that necessary
mathematics. You may already be
familiar with much or all of this material.
• We use Σ to represent the sum of the first 100 positive integers as follows:
• Similarly, the sum of the squares of the first n positive integers can be represented by
5.
6.
If we knock over the first domino, it will knock over the second, the second will knock over the third,
and so on. In theory, we can have an arbitrarily large number of dominoes, and they all will fall.
17
Dr. Aryaf Al-
Cont
.
• An induction proof works in the same way. We first show that what we are trying to prove is true for n = 1.
Next we show that if it is true for an arbitrary positive integer n, it must also be true for n + 1. Once we have
shown this, we know that because it is true for n = 1, it must be true for n = 2; because it is true for n = 2, it
must be true for n = 3; and so on, ad infinitum (to infinity). We can therefore conclude that it is true for all
positive integers n.
• When using induction to prove that some statement concerning the positive integers is true, we use the
following terminology:
1. The induction base is the proof that the statement is true for n = 1 (or some other initial value).
2. The induction hypothesis is the assumption that the statement is true for an arbitrary n ≥ 1 (or some
other initial value)
3. The induction step is the proof that if the statement is true for n, it must also be true for n + 1.
Example
1 Show using the mathematical induction for all positive integers n, that
Equation 1
Assignment 1
Prove Rule 5 in slide 8 using the
mathematical induction.