Quiz 3 Reminder and Midterm Results

Size: px
Start display at page:

Download "Quiz 3 Reminder and Midterm Results"

Transcription

1 Quiz 3 Reminder and Midterm Results Reminder: Quiz 3 will be in the first 15 minutes of Monday s class. You can use any resources you have during the quiz. It covers all four sections of Unit 3. It has four questions, two of them will be choices. Analysis for choice questions are optional, and can get partial credit if the choice is wrong. Midterm has been graded. Average mark is much higher than that of quizzes. Great! Midterm papers and your notes will be returned after class. You can reuse the note for the final. Gradesource report on Midterm will be available after discussion session. 1

2 CSE 21 Mathematics for Algorithm and System Analysis Unit 3: Decision Trees and Recursion Section 4: Inductive Proofs and Recursive Equations 2

3 Review : Recursive Solution We have a recursive solution to the problem (proof, algorithm, data structure, etc.) if the following two conditions hold. 1. The set of simplest problems can be dealt with (proved, calculated, sorted, etc.). 2. The solution to any other problem can be built from solutions to simpler problems, and this process eventually leads back to the original problem. Example: recursive solution to binomial coefficients C(0, 0) = 1, C(0, k)=0 for k 0 C(n, k) = C(n 1, k 1) + C(n 1, k) for n > 0 3

4 Learning Outcomes By the end of this lesson, you should be able to Use induction, or inductive proof, to prove statements. Verify/prove a solution to a recursion. It might be tested in examinations. Derive solutions for two types of recursions. a n =ba n-1 +c a n =ba n-1 +ca n-2 4

5 Why do we need to learn them? Induction is a commonly used way to prove statements for all natural numbers, including many recursions. Recursion is one of the central ideas of computer science. We will show some recursions have direct solutions. 5

6 Induction Suppose A(n) is an assertion that depends on n. We use induction to prove that A(n) is true when we show that It is true for the smallest value of n and If it is true for everything less than n, then it is true for n. 6

7 Induction Suppose A(n) is an assertion that depends on n. We use induction to prove that A(n) is true when we show that It is true for the smallest value of n and If it is true for everything less than n, then it is true for n. 7

8 Induction and Recursion Commonalities between induction and recursion Both need something to get started; In both, each new thing depends on similar previous things. Differences between induction and recursion A recursion describes how to calculate a value from previously calculated values. An induction verifies whether the above description/statement is correct. 8

9 Theorem 6: Induction Let A(m) be an assertion, the nature of which is dependent on the integer m. Suppose that n 0 n 1, if we have proved the two statements: (a) A(n) is true for n 0 n n 1 and (b) If n > n 1 and A(k) is true for all k such that n 0 k n-1, then A(n) is true. Then A(m) is true for all m n 0. Proof by contradiction 9

10 Theorem 6: Weak Induction Let A(m) be an assertion, the nature of which is dependent on the integer m. If we have proved the two statements: (a) A(n 0 ) is true and (b) If n > n 0 and A(n-1) is true, then A(n) is true. Then A(m) is true for all m n 0. It is a special case of the first one, called weak induction because its statements are easier to check. The first one is called strong induction. 10

11 Definition 5 : Induction hypothesis In statement (a), A(n 0 ),..., A(n 1 ) are called the base cases or simplest cases. In statement (b), A(k) is true for all k such that n 0 k n-1 is called the induction assumption or induction hypothesis. proving the induction hypothesis implies A(n) is called the inductive step. 11

12 Example 24: Every integer is a product of primes A positive integer n > 1 is called a prime if its only divisors are 1 and n, e.g.,: 2, 3, 5, 7. If a number is not a prime, such as 12, it can be written as a product of primes (12 = 2 2 3). A prime p is a product of one prime, itself. Question: how to prove every integer n 2 is a product of primes? 12

13 Solution to Example 24 Base cases: n 0 =n 1 =2, A(n 0 ) is true. Induction hypothesis: suppose that for some n > 2, A(k) is true for all k such that n 0 k n-1. Inductive step: check A(n) based on the hypothesis If n is a prime, then it is a product of primes (itself). Otherwise, n = st where 1<s<n and 1<t<n. By the induction hypothesis, s and t are each a product of primes, hence n = st is a product of primes. 13

14 Example 25 : Sum of first n integers Formula for the sum of the first n integers S(n) = n. Prove S(n)=n(n+1)/2 using weak induction Base cases: n 0 =1, S(1)=(1 2)/2=1, so A(n 0 ) is true. Induction hypothesis: n > 1 and A(n-1) is true. Inductive step: S(n) = n = ( (n-1))+n = S(n-1)+n = (n-1)((n-1)+1)/2+n = n(n+1)/2 14

15 Terms for Recursion Recursion, or recursive equation, or recurrence relation: the equation that arises in the inductive proof and tells how to compute the value for n based on the value(s) for smaller number(s). e.g., S(n) = S(n-1) + n (for n > 1) initial condition(s): the value(s) for smallest number(s). It is the information on how to get started. e.g., S(1)=1 solution to the recursion: the equation on how to compute the value for n without having to compute the values for any smaller number(s). e.g., S(n) = n(n+1)/2 Differentiate this from recursive solution to a problem which is about how to solve the problem using recursion. 15

16 Theorem 7 : Verifying the solution to a recursion We often use the same induction pattern to prove a formula for the solution to a recursion is correct. Theorem 7: Suppose we have initial conditions that give a n for n 0 n n 1 and a recursion that allows us to compute a n when n > n 1. To verify that a n = f(n), it suffices to do two things: Step 1. Verify that f satisfies the initial conditions. Step 2. Verify that f satisfies the recursion. 16

17 Example 26 : Proving a formula for the solution to a recursion Let S(n) be the sum of the first n integers. The initial condition S(1) = 1 and the recursion S(n) = S(n-1) + n allow us to compute S(n) for all n 1. Prove f(n) = n(n+1)/2= S(n). Step 1: f(1)=1 (1+1)/2=1=S(1) Step 2: for n > 1, S(n)=n + S(n 1) = n + f(n 1) = n + n(n 1)/2 = n(n + 1)/2 = f(n) 17

18 Example 26 : Proving a formula for the solution to a recursion(2) Initial conditions: a 0 = 2, a 1 = 7 Recursion: a n = 3a n 1 2a n 2 when n > 1 Prove that a n = 5 2 n 3 for n 0. Step 1: f(0)= =2, f(1)= = 7 Step 2: 3 f(n 1) 2 f(n 2) =3 (5 2 n 1 3)-2 (5 2 n 2 3) = ( )2 n 2 3 = 5 2 n 3 = f(n) 18

19 How to get solutions to recursions? Some solutions are easy to guess Let r k = r k 1 /k for k 1, with r 0 = 1. Its first few terms are 1, 1, 1/2, 1/6, 1/24. It looks like r k = ( 1) k /k! is a solution. Some solutions are hard to guess b n = b 1 b n 1 + b 2 b n b n 1 b 1 for n 2, with b 1 = 1. Some recursions do not have solutions partitions number of an n-set having exactly k blocks: S(n, k) = S(n 1, k 1) 1 + k S(n 1, k) Solutions to two types of recursion can be easily derived a n =ba n-1 +c a n =ba n-1 +ca n-2 Generally, it is usually easy to verify a solution to a recursion, but hard to find the solution on our own. 19

20 Theorem 8 : Solutions to Recursion a n = ba n 1 +c Let a 0, a 1,..., a n,... be a sequence of numbers. Suppose there are constants b and c such that b is not 0 or 1 and a n = ba n 1 +c for n 1. Then a n = Ab n + K where K = c/(1 b), and A = a 0 K = a 0 c/(1 b). It can be proved using the steps in Theorem 7: Initial Condition: Recursion: 20

21 Solutions to Some Recursions Let t k = 2t k for k > 0, t 0 = 0. Compute its solution. K = c/(1 b) = 1/(1 2)= 1 A = a 0 K = 0 ( 1) = 1. So the solution is t k = 2 k 1. 21

22 Example 28 : I forgot the formulas for A and K Let a 1 = 3 and a n = 4a n 1 7 for n > 1. Compute its solution. Tricky part: We cannot use A = a 0 K directly because we do not know a 0. Since solution should be a n = A4 n + K a 1 = 3 = A4 1 + K a 2 = 4 3 7= A4 2 + K Solve the above two equations to get values of A and K. Solution: a n = 4 n /6+ 7/3. If you forgot formula for b, just add one more equation based on a 3 and solve the equations. 22

23 Theorem 9 : Solutions to Recursion a n = ba n 1 +ca n 2 Let a 0, a 1,..., a n,... be a sequence of numbers. Suppose there are constants b and c such that a n = ba n 1 +ca n 2 for n 2. Let r 1 and r 2 be the roots of the polynomial x 2 bx c. n n If r 1 r 2, then n 1 2 for n 0, where K 1 and K 2 are solutions to the equations K 1 + K 2 = a 0 and r 1 K 1 + r 2 K 2 = a 1. n n If r 1 = r 2, then an = K1 r1 + K 2nr2 for n 0, where K 1 and K 2 are solutions to the equations: K 1 = a 0 and r 1 K 1 + r 2 K 2 = r 1 K 1 + r 1 K 2 = a 1. Values of r 1 and r 2 : a = K1 r + K r2 r, r 1 2 b ± = b c 23

24 Example 29 : Applying Theorem 9 Let a 0 = 2, a 1 = 7 and a n = 3a n 1 2a n 2 for n > 2. Compute its solution. We have b = 3 and c = 2. Solving equation x 2 3x+2 = 0, we can get r 1 = 2 and r 2 = 1. r 1 r 2, so solve equation K 1 + K 2 = 2 and 2K 1 + K 2 = 7. Result is K 1 = 5, K 2 = 3. Solution is a n = 5 2 n 3 1 n = 5 2 n 3. 24

25 Example 29 : Applying Theorem 9 (2) A recursion is a 0 = 0, a 1 = 1, and a n = 4a n 1 4a n 2 for n > 2. Compute its solution. We have b = 4 and c = 4. Solving equation x 2 4x+4 = 0, we get r 1 = r 2 = 2. r 1 = r 2, so solve equation K 1 = 0, 2K 1 +2K 2 = 1. Result is: K 1 = 0, K 2 = 1/2. Solution is a n = K 1 2 n + K 2 n2 n = (1/2)n2 n = n2 n-1. 25

26 Example 29 : Applying Theorem 9 for Fibonacci recursion The recursion is : F 0 = F 1 = 1 and F k = F k 1 + F k 2 when k 2. We have b = 1 and c = 1. Solve equation is x 2 x 1 = 0, we get r 1 r 2, so solve K 1 + K 2 = 1 and r 1 K 1 + r 2 K 2 = 1. Result is r1 r2. K 1 = r 1, K 5 = and r 2 2 = 5 2 = 2 Solution is Fn = n n+ 1 26

27 Example 30 : A shifted index Let a 1 = 0, a 2 = 1 and a n = 5a n 1 6a n 2 for n 3. Compute its solution. Tricky part: it starts with a 1 instead of a 0, so the equations for K 1 and K 2 cannot be directly used. Because b = 5 and c = 6, solve equation x 2 5x 6 = 0. We get r 1 = 6 and r 2 = 1. So a n = K 1 6 n K 2 ( 1) n. Based on a 1 and a 2, we have a 1 =0=6K 1 K 2 and a 2 =1=6 2 K 1 + K 2. Solve the equations, we get K 1 = 1/42, K 2 = 1/7. Solution is a n = (1/42) 6 n (1/7) ( 1) n. 27

28 Homework and Pre-Reading Assignment Homework: Exercise 4.1, 4.4, 4.5, 4.9, 4.11, in page DT-50 to DT-52 Prepare for Quiz 3 on Monday For next class, please read Section 1 of Unit Basic Concepts in Graph Theory (GT-1 to GT-7). Try to understand definitions of Graph from examples. Try to understand Equivalence Relation and how to use it to get isomorphic graphs. 28

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Preparing for the CS 173 (A) Fall 2018 Midterm 1 Preparing for the CS 173 (A) Fall 2018 Midterm 1 1 Basic information Midterm 1 is scheduled from 7:15-8:30 PM. We recommend you arrive early so that you can start exactly at 7:15. Exams will be collected

More information

Algorithm Analysis Recurrence Relation. Chung-Ang University, Jaesung Lee

Algorithm Analysis Recurrence Relation. Chung-Ang University, Jaesung Lee Algorithm Analysis Recurrence Relation Chung-Ang University, Jaesung Lee Recursion 2 Recursion 3 Recursion in Real-world Fibonacci sequence = + Initial conditions: = 0 and = 1. = + = + = + 0, 1, 1, 2,

More information

INDUCTION AND RECURSION. Lecture 7 - Ch. 4

INDUCTION AND RECURSION. Lecture 7 - Ch. 4 INDUCTION AND RECURSION Lecture 7 - Ch. 4 4. Introduction Any mathematical statements assert that a property is true for all positive integers Examples: for every positive integer n: n!

More information

Binomial Coefficient Identities/Complements

Binomial Coefficient Identities/Complements Binomial Coefficient Identities/Complements CSE21 Fall 2017, Day 4 Oct 6, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ permutation P(n,r) = n(n-1) (n-2) (n-r+1) = Terminology

More information

Try the assignment f(1) = 2; f(2) = 1; f(3) = 4; f(4) = 3;.

Try the assignment f(1) = 2; f(2) = 1; f(3) = 4; f(4) = 3;. I. Precisely complete the following definitions: 1. A natural number n is composite whenever... See class notes for the precise definitions 2. Fix n in N. The number s(n) represents... 3. For A and B sets,

More information

Recursion: Introduction and Correctness

Recursion: Introduction and Correctness Recursion: Introduction and Correctness CSE21 Winter 2017, Day 7 (B00), Day 4-5 (A00) January 25, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Today s Plan From last time: intersecting sorted lists and

More information

Recurrences COMP 215

Recurrences COMP 215 Recurrences COMP 215 Analysis of Iterative Algorithms //return the location of the item matching x, or 0 if //no such item is found. index SequentialSearch(keytype[] S, in, keytype x) { index location

More information

Discrete Mathematics. Spring 2017

Discrete Mathematics. Spring 2017 Discrete Mathematics Spring 2017 Previous Lecture Principle of Mathematical Induction Mathematical Induction: Rule of Inference Mathematical Induction: Conjecturing and Proving Mathematical Induction:

More information

Math 10850, fall 2017, University of Notre Dame

Math 10850, fall 2017, University of Notre Dame Math 10850, fall 2017, University of Notre Dame Notes on first exam September 22, 2017 The key facts The first midterm will be on Thursday, September 28, 6.15pm-7.45pm in Hayes-Healy 127. What you need

More information

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis Lecture 14 Class URL: http://vlsicad.ucsd.edu/courses/cse21-s14/ Lecture 14 Notes Goals for this week Big-O complexity

More information

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis Lecture 15 Class URL: http://vlsicad.ucsd.edu/courses/cse21-s14/ Lecture 15 Notes Goals for this week Big-O complexity

More information

Warm-up Simple methods Linear recurrences. Solving recurrences. Misha Lavrov. ARML Practice 2/2/2014

Warm-up Simple methods Linear recurrences. Solving recurrences. Misha Lavrov. ARML Practice 2/2/2014 Solving recurrences Misha Lavrov ARML Practice 2/2/2014 Warm-up / Review 1 Compute 100 k=2 ( 1 1 ) ( = 1 1 ) ( 1 1 ) ( 1 1 ). k 2 3 100 2 Compute 100 k=2 ( 1 1 ) k 2. Homework: find and solve problem Algebra

More information

Chapter 5.1: Induction

Chapter 5.1: Induction Chapter.1: Induction Monday, July 1 Fermat s Little Theorem Evaluate the following: 1. 1 (mod ) 1 ( ) 1 1 (mod ). (mod 7) ( ) 8 ) 1 8 1 (mod ). 77 (mod 19). 18 (mod 1) 77 ( 18 ) 1 1 (mod 19) 18 1 (mod

More information

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011 Math 31 Lesson Plan Day 2: Sets; Binary Operations Elizabeth Gillaspy September 23, 2011 Supplies needed: 30 worksheets. Scratch paper? Sign in sheet Goals for myself: Tell them what you re going to tell

More information

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 CS17 Integrated Introduction to Computer Science Klein Contents Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 1 Tree definitions 1 2 Analysis of mergesort using a binary tree 1 3 Analysis of

More information

Recitation 7: Existence Proofs and Mathematical Induction

Recitation 7: Existence Proofs and Mathematical Induction Math 299 Recitation 7: Existence Proofs and Mathematical Induction Existence proofs: To prove a statement of the form x S, P (x), we give either a constructive or a non-contructive proof. In a constructive

More information

1 Examples of Weak Induction

1 Examples of Weak Induction More About Mathematical Induction Mathematical induction is designed for proving that a statement holds for all nonnegative integers (or integers beyond an initial one). Here are some extra examples of

More information

CSCE 222 Discrete Structures for Computing. Review for Exam 2. Dr. Hyunyoung Lee !!!

CSCE 222 Discrete Structures for Computing. Review for Exam 2. Dr. Hyunyoung Lee !!! CSCE 222 Discrete Structures for Computing Review for Exam 2 Dr. Hyunyoung Lee 1 Strategy for Exam Preparation - Start studying now (unless have already started) - Study class notes (lecture slides and

More information

What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt

What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt Lecture 3 The Analysis of Recursive Algorithm Efficiency What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Asymptotic Analysis, recurrences Date: 9/7/17

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Asymptotic Analysis, recurrences Date: 9/7/17 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Asymptotic Analysis, recurrences Date: 9/7/17 2.1 Notes Homework 1 will be released today, and is due a week from today by the beginning

More information

After linear functions, the next simplest functions are polynomials. Examples are

After linear functions, the next simplest functions are polynomials. Examples are Mathematics 10 Fall 1999 Polynomials After linear functions, the next simplest functions are polynomials. Examples are 1+x, x +3x +, x 3. Here x is a variable. Recall that we have defined a function to

More information

Mathematical Induction

Mathematical Induction Mathematical Induction Let s motivate our discussion by considering an example first. What happens when we add the first n positive odd integers? The table below shows what results for the first few values

More information

CS2223 Algorithms D Term 2009 Exam 3 Solutions

CS2223 Algorithms D Term 2009 Exam 3 Solutions CS2223 Algorithms D Term 2009 Exam 3 Solutions May 4, 2009 By Prof. Carolina Ruiz Dept. of Computer Science WPI PROBLEM 1: Asymptoptic Growth Rates (10 points) Let A and B be two algorithms with runtimes

More information

Math Lecture 4 Limit Laws

Math Lecture 4 Limit Laws Math 1060 Lecture 4 Limit Laws Outline Summary of last lecture Limit laws Motivation Limits of constants and the identity function Limits of sums and differences Limits of products Limits of polynomials

More information

CS173 Lecture B, September 10, 2015

CS173 Lecture B, September 10, 2015 CS173 Lecture B, September 10, 2015 Tandy Warnow September 11, 2015 CS 173, Lecture B September 10, 2015 Tandy Warnow Examlet Today Four problems: One induction proof One problem on simplifying a logical

More information

Mathematical Induction

Mathematical Induction Mathematical Induction MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 1 / 21 Outline 1 Mathematical Induction 2 Strong Mathematical

More information

CS 2110: INDUCTION DISCUSSION TOPICS

CS 2110: INDUCTION DISCUSSION TOPICS CS 110: INDUCTION DISCUSSION TOPICS The following ideas are suggestions for how to handle your discussion classes. You can do as much or as little of this as you want. You can either present at the board,

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2012 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/2001 9/6/2012 CSE

More information

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n.

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n. 11 Recurrences A recurrence equation or recurrence counts things using recursion. 11.1 Recurrence Equations We start with an example. Example 11.1. Find a recurrence for S(n), the number of subsets of

More information

Math 3000 Section 003 Intro to Abstract Math Homework 6

Math 3000 Section 003 Intro to Abstract Math Homework 6 Math 000 Section 00 Intro to Abstract Math Homework 6 Department of Mathematical and Statistical Sciences University of Colorado Denver, Spring 01 Solutions April, 01 Please note that these solutions are

More information

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4 Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement

More information

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3 EECS 70 Discrete Mathematics and Probability Theory Spring 014 Anant Sahai Note 3 Induction Induction is an extremely powerful tool in mathematics. It is a way of proving propositions that hold for all

More information

Fall 2017 Test II review problems

Fall 2017 Test II review problems Fall 2017 Test II review problems Dr. Holmes October 18, 2017 This is a quite miscellaneous grab bag of relevant problems from old tests. Some are certainly repeated. 1. Give the complete addition and

More information

MATH10040: Numbers and Functions Homework 1: Solutions

MATH10040: Numbers and Functions Homework 1: Solutions MATH10040: Numbers and Functions Homework 1: Solutions 1. Prove that a Z and if 3 divides into a then 3 divides a. Solution: The statement to be proved is equivalent to the statement: For any a N, if 3

More information

CmSc 250 Intro to Algorithms. Mathematical Review. 1. Basic Algebra. (a + b) 2 = a 2 + 2ab + b 2 (a - b) 2 = a 2-2ab + b 2 a 2 - b 2 = (a + b)(a - b)

CmSc 250 Intro to Algorithms. Mathematical Review. 1. Basic Algebra. (a + b) 2 = a 2 + 2ab + b 2 (a - b) 2 = a 2-2ab + b 2 a 2 - b 2 = (a + b)(a - b) CmSc 250 Intro to Algorithms Mathematical Review 1. Basic Algebra (a + b) 2 = a 2 + 2ab + b 2 (a - b) 2 = a 2-2ab + b 2 a 2 - b 2 = (a + b)(a - b) a/x + b/y = (ay + bx)/xy 2. Exponents X n = XXX..X, n

More information

4 Linear Recurrence Relations & the Fibonacci Sequence

4 Linear Recurrence Relations & the Fibonacci Sequence 4 Linear Recurrence Relations & the Fibonacci Sequence Recall the classic example of the Fibonacci sequence (F n ) n=1 the relations: F n+ = F n+1 + F n F 1 = F = 1 = (1, 1,, 3, 5, 8, 13, 1,...), defined

More information

Algebra 1: Hutschenreuter Chapter 10 Notes Adding and Subtracting Polynomials

Algebra 1: Hutschenreuter Chapter 10 Notes Adding and Subtracting Polynomials Algebra 1: Hutschenreuter Chapter 10 Notes Name 10.1 Adding and Subtracting Polynomials Polynomial- an expression where terms are being either added and/or subtracted together Ex: 6x 4 + 3x 3 + 5x 2 +

More information

What is proof? Lesson 1

What is proof? Lesson 1 What is proof? Lesson The topic for this Math Explorer Club is mathematical proof. In this post we will go over what was covered in the first session. The word proof is a normal English word that you might

More information

CSC236 Week 4. Larry Zhang

CSC236 Week 4. Larry Zhang CSC236 Week 4 Larry Zhang 1 Announcements PS2 due on Friday This week s tutorial: Exercises with big-oh PS1 feedback People generally did well Writing style need to be improved. This time the TAs are lenient,

More information

Algorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February)

Algorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February) Algorithms and Data Structures 016 Week 5 solutions (Tues 9th - Fri 1th February) 1. Draw the decision tree (under the assumption of all-distinct inputs) Quicksort for n = 3. answer: (of course you should

More information

CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction. Linda Shapiro Spring 2016

CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction. Linda Shapiro Spring 2016 CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction Linda Shapiro Spring 2016 Background on Induction Type of mathematical proof Typically used to establish a given statement for all natural

More information

Lecture 3. Big-O notation, more recurrences!!

Lecture 3. Big-O notation, more recurrences!! Lecture 3 Big-O notation, more recurrences!! Announcements! HW1 is posted! (Due Friday) See Piazza for a list of HW clarifications First recitation section was this morning, there s another tomorrow (same

More information

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic 11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic Bezout s Lemma Let's look at the values of 4x + 6y when x and y are integers. If x is -6 and y is 4 we

More information

CMSC250 Homework 9 Due: Wednesday, December 3, Question: Total Points: Score:

CMSC250 Homework 9 Due: Wednesday, December 3, Question: Total Points: Score: Name & UID: Circle Your Section! 0101 (10am: 3120, Ladan) 0102 (11am: 3120, Ladan) 0103 (Noon: 3120, Peter) 0201 (2pm: 3120, Yi) 0202 (10am: 1121, Vikas) 0203 (11am: 1121, Vikas) 0204 (9am: 2117, Karthik)

More information

Welcome to Math Video Lessons. Stanley Ocken. Department of Mathematics The City College of New York Fall 2013

Welcome to Math Video Lessons. Stanley Ocken. Department of Mathematics The City College of New York Fall 2013 Welcome to Math 19500 Video Lessons Prof. Department of Mathematics The City College of New York Fall 013 An important feature of the following Beamer slide presentations is that you, the reader, move

More information

Polynomial and Synthetic Division

Polynomial and Synthetic Division Polynomial and Synthetic Division Polynomial Division Polynomial Division is very similar to long division. Example: 3x 3 5x 3x 10x 1 3 Polynomial Division 3x 1 x 3x 3 3 x 5x 3x x 6x 4 10x 10x 7 3 x 1

More information

MATH 2200 Final LC Review

MATH 2200 Final LC Review MATH 2200 Final LC Review Thomas Goller April 25, 2013 1 Final LC Format The final learning celebration will consist of 12-15 claims to be proven or disproven. It will take place on Wednesday, May 1, from

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1 CS 70 Discrete Mathematics and Probability Theory Fall 013 Vazirani Note 1 Induction Induction is a basic, powerful and widely used proof technique. It is one of the most common techniques for analyzing

More information

In-Class Soln 1. CS 361, Lecture 4. Today s Outline. In-Class Soln 2

In-Class Soln 1. CS 361, Lecture 4. Today s Outline. In-Class Soln 2 In-Class Soln 1 Let f(n) be an always positive function and let g(n) = f(n) log n. Show that f(n) = o(g(n)) CS 361, Lecture 4 Jared Saia University of New Mexico For any positive constant c, we want to

More information

Mathematical Fundamentals

Mathematical Fundamentals Mathematical Fundamentals Sets Factorials, Logarithms Recursion Summations, Recurrences Proof Techniques: By Contradiction, Induction Estimation Techniques Data Structures 1 Mathematical Fundamentals Sets

More information

Divide and Conquer Algorithms

Divide and Conquer Algorithms Divide and Conquer Algorithms T. M. Murali February 19, 2013 Divide and Conquer Break up a problem into several parts. Solve each part recursively. Solve base cases by brute force. Efficiently combine

More information

CS173 Lecture B, November 3, 2015

CS173 Lecture B, November 3, 2015 CS173 Lecture B, November 3, 2015 Tandy Warnow November 3, 2015 CS 173, Lecture B November 3, 2015 Tandy Warnow Announcements Examlet 7 is a take-home exam, and is due November 10, 11:05 AM, in class.

More information

Sequences of Real Numbers

Sequences of Real Numbers Chapter 8 Sequences of Real Numbers In this chapter, we assume the existence of the ordered field of real numbers, though we do not yet discuss or use the completeness of the real numbers. In the next

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.eecs.yorku.ca/course/2001 9/10/2013

More information

Lesson 3: Advanced Factoring Strategies for Quadratic Expressions

Lesson 3: Advanced Factoring Strategies for Quadratic Expressions Advanced Factoring Strategies for Quadratic Expressions Student Outcomes Students develop strategies for factoring quadratic expressions that are not easily factorable, making use of the structure of the

More information

MATH 55 - HOMEWORK 6 SOLUTIONS. 1. Section = 1 = (n + 1) 3 = 2. + (n + 1) 3. + (n + 1) 3 = n2 (n + 1) 2.

MATH 55 - HOMEWORK 6 SOLUTIONS. 1. Section = 1 = (n + 1) 3 = 2. + (n + 1) 3. + (n + 1) 3 = n2 (n + 1) 2. MATH 55 - HOMEWORK 6 SOLUTIONS Exercise Section 5 Proof (a) P () is the statement ( ) 3 (b) P () is true since ( ) 3 (c) The inductive hypothesis is P (n): ( ) n(n + ) 3 + 3 + + n 3 (d) Assuming the inductive

More information

b + O(n d ) where a 1, b > 1, then O(n d log n) if a = b d d ) if a < b d O(n log b a ) if a > b d

b + O(n d ) where a 1, b > 1, then O(n d log n) if a = b d d ) if a < b d O(n log b a ) if a > b d CS161, Lecture 4 Median, Selection, and the Substitution Method Scribe: Albert Chen and Juliana Cook (2015), Sam Kim (2016), Gregory Valiant (2017) Date: January 23, 2017 1 Introduction Last lecture, we

More information

CS 4349 Lecture August 30th, 2017

CS 4349 Lecture August 30th, 2017 CS 4349 Lecture August 30th, 2017 Main topics for #lecture include #recurrances. Prelude I will hold an extra office hour Friday, September 1st from 3:00pm to 4:00pm. Please fill out prerequisite forms

More information

Basics of Proofs. 1 The Basics. 2 Proof Strategies. 2.1 Understand What s Going On

Basics of Proofs. 1 The Basics. 2 Proof Strategies. 2.1 Understand What s Going On Basics of Proofs The Putnam is a proof based exam and will expect you to write proofs in your solutions Similarly, Math 96 will also require you to write proofs in your homework solutions If you ve seen

More information

McGill University Faculty of Science. Solutions to Practice Final Examination Math 240 Discrete Structures 1. Time: 3 hours Marked out of 60

McGill University Faculty of Science. Solutions to Practice Final Examination Math 240 Discrete Structures 1. Time: 3 hours Marked out of 60 McGill University Faculty of Science Solutions to Practice Final Examination Math 40 Discrete Structures Time: hours Marked out of 60 Question. [6] Prove that the statement (p q) (q r) (p r) is a contradiction

More information

Math Circle: Recursion and Induction

Math Circle: Recursion and Induction Math Circle: Recursion and Induction Prof. Wickerhauser 1 Recursion What can we compute, using only simple formulas and rules that everyone can understand? 1. Let us use N to denote the set of counting

More information

12 Sequences and Recurrences

12 Sequences and Recurrences 12 Sequences and Recurrences A sequence is just what you think it is. It is often given by a formula known as a recurrence equation. 12.1 Arithmetic and Geometric Progressions An arithmetic progression

More information

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive Announcements Homework 2 Due Homework 3 Posted Due next Monday Quiz 2 on Wednesday Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Exam 1 in two weeks Monday, February 19

More information

Math Lecture 18 Notes

Math Lecture 18 Notes Math 1010 - Lecture 18 Notes Dylan Zwick Fall 2009 In our last lecture we talked about how we can add, subtract, and multiply polynomials, and we figured out that, basically, if you can add, subtract,

More information

Ex. Here's another one. We want to prove that the sum of the cubes of the first n natural numbers is. n = n 2 (n+1) 2 /4.

Ex. Here's another one. We want to prove that the sum of the cubes of the first n natural numbers is. n = n 2 (n+1) 2 /4. Lecture One type of mathematical proof that goes everywhere is mathematical induction (tb 147). Induction is essentially used to show something is true for all iterations, i, of a sequence, where i N.

More information

A SUMMARY OF RECURSION SOLVING TECHNIQUES

A SUMMARY OF RECURSION SOLVING TECHNIQUES A SUMMARY OF RECURSION SOLVING TECHNIQUES KIMMO ERIKSSON, KTH These notes are meant to be a complement to the material on recursion solving techniques in the textbook Discrete Mathematics by Biggs. In

More information

F 2k 1 = F 2n. for all positive integers n.

F 2k 1 = F 2n. for all positive integers n. Question 1 (Fibonacci Identity, 15 points). Recall that the Fibonacci numbers are defined by F 1 = F 2 = 1 and F n+2 = F n+1 + F n for all n 0. Prove that for all positive integers n. n F 2k 1 = F 2n We

More information

Mathematical Induction

Mathematical Induction Mathematical Induction MAT30 Discrete Mathematics Fall 018 MAT30 (Discrete Math) Mathematical Induction Fall 018 1 / 19 Outline 1 Mathematical Induction Strong Mathematical Induction MAT30 (Discrete Math)

More information

CS 340: Discrete Structures for Engineers

CS 340: Discrete Structures for Engineers CS 340: Discrete Structures for Engineers Instructor: Prof. Harry Porter Office: FAB 115-06 harry@cs.pdx.edu Hours: Mon 3-4, Wed 3-4, or by appointment Website: web.cecs.pdx.edu/~harry/discrete Class Mailing

More information

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018 The principle of mathematical induction is a useful tool for proving that a certain predicate is true for all natural numbers. It cannot be used to discover theorems, but only to prove them. If we have

More information

Lecture 1: Asymptotics, Recurrences, Elementary Sorting

Lecture 1: Asymptotics, Recurrences, Elementary Sorting Lecture 1: Asymptotics, Recurrences, Elementary Sorting Instructor: Outline 1 Introduction to Asymptotic Analysis Rate of growth of functions Comparing and bounding functions: O, Θ, Ω Specifying running

More information

Notes on induction proofs and recursive definitions

Notes on induction proofs and recursive definitions Notes on induction proofs and recursive definitions James Aspnes December 13, 2010 1 Simple induction Most of the proof techniques we ve talked about so far are only really useful for proving a property

More information

2.3 Differentiation Formulas. Copyright Cengage Learning. All rights reserved.

2.3 Differentiation Formulas. Copyright Cengage Learning. All rights reserved. 2.3 Differentiation Formulas Copyright Cengage Learning. All rights reserved. Differentiation Formulas Let s start with the simplest of all functions, the constant function f (x) = c. The graph of this

More information

Section 4.2: Mathematical Induction 1

Section 4.2: Mathematical Induction 1 Section 4.: Mathematical Induction 1 Over the next couple of sections, we shall consider a method of proof called mathematical induction. Induction is fairly complicated, but a very useful proof technique,

More information

MATHEMATICAL INDUCTION

MATHEMATICAL INDUCTION MATHEMATICAL INDUCTION MATH 3A SECTION HANDOUT BY GERARDO CON DIAZ Imagine a bunch of dominoes on a table. They are set up in a straight line, and you are about to push the first piece to set off the chain

More information

Learning Packet. Lesson 5b Solving Quadratic Equations THIS BOX FOR INSTRUCTOR GRADING USE ONLY

Learning Packet. Lesson 5b Solving Quadratic Equations THIS BOX FOR INSTRUCTOR GRADING USE ONLY Learning Packet Student Name Due Date Class Time/Day Submission Date THIS BOX FOR INSTRUCTOR GRADING USE ONLY Mini-Lesson is complete and information presented is as found on media links (0 5 pts) Comments:

More information

Lesson 8: Graphs of Simple Non Linear Functions

Lesson 8: Graphs of Simple Non Linear Functions Student Outcomes Students examine the average rate of change for non linear functions and learn that, unlike linear functions, non linear functions do not have a constant rate of change. Students determine

More information

Divide and Conquer Algorithms

Divide and Conquer Algorithms Divide and Conquer Algorithms T. M. Murali March 17, 2014 Divide and Conquer Break up a problem into several parts. Solve each part recursively. Solve base cases by brute force. Efficiently combine solutions

More information

Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 =

Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 = Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 = 0 a 1 = 2 0 + 1 = 1 a 2 = 2 1 + 1 = 3 a 3 = 2 3 + 1

More information

Data structures Exercise 1 solution. Question 1. Let s start by writing all the functions in big O notation:

Data structures Exercise 1 solution. Question 1. Let s start by writing all the functions in big O notation: Data structures Exercise 1 solution Question 1 Let s start by writing all the functions in big O notation: f 1 (n) = 2017 = O(1), f 2 (n) = 2 log 2 n = O(n 2 ), f 3 (n) = 2 n = O(2 n ), f 4 (n) = 1 = O

More information

CSCE 750 Final Exam Answer Key Wednesday December 7, 2005

CSCE 750 Final Exam Answer Key Wednesday December 7, 2005 CSCE 750 Final Exam Answer Key Wednesday December 7, 2005 Do all problems. Put your answers on blank paper or in a test booklet. There are 00 points total in the exam. You have 80 minutes. Please note

More information

3 Finite continued fractions

3 Finite continued fractions MTH628 Number Theory Notes 3 Spring 209 3 Finite continued fractions 3. Introduction Let us return to the calculation of gcd(225, 57) from the preceding chapter. 225 = 57 + 68 57 = 68 2 + 2 68 = 2 3 +

More information

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction Math 4 Summer 01 Elementary Number Theory Notes on Mathematical Induction Principle of Mathematical Induction Recall the following axiom for the set of integers. Well-Ordering Axiom for the Integers If

More information

Divide & Conquer. CS 320, Fall Dr. Geri Georg, Instructor CS320 Div&Conq 1

Divide & Conquer. CS 320, Fall Dr. Geri Georg, Instructor CS320 Div&Conq 1 Divide & Conquer CS 320, Fall 2017 Dr. Geri Georg, Instructor georg@colostate.edu CS320 Div&Conq 1 Strategy 1. Divide the problem up into equal sized sub problems 2. Solve the sub problems recursively

More information

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City? Any Wizard of Oz fans? Discrete Math Basics Dorothy: How does one get to the Emerald City? Glynda: It is always best to start at the beginning Outline Sets Relations Proofs Sets A set is a collection of

More information

Some Review Problems for Exam 1: Solutions

Some Review Problems for Exam 1: Solutions Math 3355 Fall 2018 Some Review Problems for Exam 1: Solutions Here is my quick review of proof techniques. I will focus exclusively on propositions of the form p q, or more properly, x P (x) Q(x) or x

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

COM S 330 Lecture Notes Week of Feb 9 13

COM S 330 Lecture Notes Week of Feb 9 13 Monday, February 9. Rosen.4 Sequences Reading: Rosen.4. LLM 4.. Ducks 8., 8., Def: A sequence is a function from a (usually infinite) subset of the integers (usually N = {0,,, 3,... } or Z + = {,, 3, 4,...

More information

MA008/MIIZ01 Design and Analysis of Algorithms Lecture Notes 3

MA008/MIIZ01 Design and Analysis of Algorithms Lecture Notes 3 MA008 p.1/37 MA008/MIIZ01 Design and Analysis of Algorithms Lecture Notes 3 Dr. Markus Hagenbuchner markus@uow.edu.au. MA008 p.2/37 Exercise 1 (from LN 2) Asymptotic Notation When constants appear in exponents

More information

Main topics for the First Midterm

Main topics for the First Midterm Main topics for the First Midterm Midterm 2 will cover Sections 7.7-7.9, 8.1-8.5, 9.1-9.2, 11.1-11.2. This is roughly the material from the first five homeworks and and three quizzes. In particular, I

More information

Generating Functions

Generating Functions 8.30 lecture notes March, 0 Generating Functions Lecturer: Michel Goemans We are going to discuss enumeration problems, and how to solve them using a powerful tool: generating functions. What is an enumeration

More information

Lesson 2-6: Graphs of Absolute Value Equations

Lesson 2-6: Graphs of Absolute Value Equations Where we re headed today Today we re going to take the net graphing step we ll learn how to graph absolute value equations. Here are the three things you are going to need to be able to do: 1. Match an

More information

Basic Proof Examples

Basic Proof Examples Basic Proof Examples Lisa Oberbroeckling Loyola University Maryland Fall 2015 Note. In this document, we use the symbol as the negation symbol. Thus p means not p. There are four basic proof techniques

More information

Chapter 4 Divide-and-Conquer

Chapter 4 Divide-and-Conquer Chapter 4 Divide-and-Conquer 1 About this lecture (1) Recall the divide-and-conquer paradigm, which we used for merge sort: Divide the problem into a number of subproblems that are smaller instances of

More information

BMT 2016 Orthogonal Polynomials 12 March Welcome to the power round! This year s topic is the theory of orthogonal polynomials.

BMT 2016 Orthogonal Polynomials 12 March Welcome to the power round! This year s topic is the theory of orthogonal polynomials. Power Round Welcome to the power round! This year s topic is the theory of orthogonal polynomials. I. You should order your papers with the answer sheet on top, and you should number papers addressing

More information

Main topics for the First Midterm Exam

Main topics for the First Midterm Exam Main topics for the First Midterm Exam The final will cover Sections.-.0, 2.-2.5, and 4.. This is roughly the material from first three homeworks and three quizzes, in addition to the lecture on Monday,

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms CSE 101, Winter 2018 Design and Analysis of Algorithms Lecture 5: Divide and Conquer (Part 2) Class URL: http://vlsicad.ucsd.edu/courses/cse101-w18/ A Lower Bound on Convex Hull Lecture 4 Task: sort the

More information

MULTIPLYING TRINOMIALS

MULTIPLYING TRINOMIALS Name: Date: 1 Math 2 Variable Manipulation Part 4 Polynomials B MULTIPLYING TRINOMIALS Multiplying trinomials is the same process as multiplying binomials except for there are more terms to multiply than

More information

Midterm 3 Review. Terms. Formulas and Rules to Use. Math 1010, Fall 2011 Instructor: Marina Gresham. Odd Root ( n x where n is odd) Exponent

Midterm 3 Review. Terms. Formulas and Rules to Use. Math 1010, Fall 2011 Instructor: Marina Gresham. Odd Root ( n x where n is odd) Exponent Math 1010, Fall 2011 Instructor: Marina Gresham Terms Midterm 3 Review Exponent Polynomial - Monomial - Binomial - Trinomial - Standard Form - Degree - Leading Coefficient - Constant Term Difference of

More information