Induction. Induction and Recursion. Induction is a very useful proof technique

Similar documents
By the end of this section you will be able to prove the Chinese Remainder Theorem apply this theorem to solve simultaneous linear congruences

Algoritmalar, Tamsayılar ve Matrisler

Introduction Common Divisors. Discrete Mathematics Andrei Bulatov

Recursion. Algorithm : Design & Analysis [3]

BINOMIAL THEOREM SOLUTION. 1. (D) n. = (C 0 + C 1 x +C 2 x C n x n ) (1+ x+ x 2 +.)

PROGRESSION AND SERIES

MATH 118 HW 7 KELLY DOUGAN, ANDREW KOMAR, MARIA SIMBIRSKY, BRANDEN LASKE

Counting Functions and Subsets

2002 Quarter 1 Math 172 Final Exam. Review

Fermat s Little Theorem. mod 13 = 0, = }{{} mod 13 = 0. = a a a }{{} mod 13 = a 12 mod 13 = 1, mod 13 = a 13 mod 13 = a.

ICS141: Discrete Mathematics for Computer Science I

EXERCISE - 01 CHECK YOUR GRASP

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:

M3P14 EXAMPLE SHEET 1 SOLUTIONS

5. Solving recurrences

Chapter 3: Theory of Modular Arithmetic 38

For this purpose, we need the following result:

Similar idea to multiplication in N, C. Divide and conquer approach provides unexpected improvements. Naïve matrix multiplication

Semiconductors materials

Using Difference Equations to Generalize Results for Periodic Nested Radicals

SOME ARITHMETIC PROPERTIES OF OVERPARTITION K -TUPLES

M5. LTI Systems Described by Linear Constant Coefficient Difference Equations

Lower Bounds for Cover-Free Families

We show that every analytic function can be expanded into a power series, called the Taylor series of the function.

ANSWER KEY PHYSICS. Workdone X

Chapter 7 Infinite Series

Divisibility. c = bf = (ae)f = a(ef) EXAMPLE: Since 7 56 and , the Theorem above tells us that

Exam 2 CMSC 203 Fall 2009 Name SOLUTION KEY Show All Work! 1. (16 points) Circle T if the corresponding statement is True or F if it is False.

Lacunary Weak I-Statistical Convergence

Lecture 6: October 16, 2017

Crosscorrelation of m-sequences, Exponential sums and Dickson

On the k-lucas Numbers of Arithmetic Indexes

Merge Sort. Outline and Reading. Divide-and-Conquer. Divide-and-conquer paradigm ( 4.1.1) Merge-sort ( 4.1.1)

Mathematical Statistics

We will begin by supplying the proof to (a).

PLANCESS RANK ACCELERATOR

Interpolation. 1. What is interpolation?

Technical Report: Bessel Filter Analysis

«A first lesson on Mathematical Induction»

Induction: Solutions

Mathematical Induction (selected questions)

Induction proofs - practice! SOLUTIONS

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

Trial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014

Numbers (Part I) -- Solutions

INFINITE SERIES. ,... having infinite number of terms is called infinite sequence and its indicated sum, i.e., a 1

Graphing Review Part 3: Polynomials

CHAPTER 5 : SERIES. 5.2 The Sum of a Series Sum of Power of n Positive Integers Sum of Series of Partial Fraction Difference Method

Relating to, connected or concerned with, quality or qualities. Now usually in implied or expressed opposition to quantitative.

= 5! 3! 2! = 5! 3! (5 3)!. In general, the number of different groups of r items out of n items (when the order is ignored) is given by n!

Conditional Convergence of Infinite Products

a) The average (mean) of the two fractions is halfway between them: b) The answer is yes. Assume without loss of generality that p < r.

SUTCLIFFE S NOTES: CALCULUS 2 SWOKOWSKI S CHAPTER 11

[ 20 ] 1. Inequality exists only between two real numbers (not complex numbers). 2. If a be any real number then one and only one of there hold.

On the Basis Property of Eigenfunction. of the Frankl Problem with Nonlocal Parity Conditions. of the Third Kind

MATH Midterm Solutions

Pre-Calculus - Chapter 3 Sections Notes

Disjoint Sets { 9} { 1} { 11} Disjoint Sets (cont) Operations. Disjoint Sets (cont) Disjoint Sets (cont) n elements

Summary: Binomial Expansion...! r. where

Convergence rates of approximate sums of Riemann integrals

Data Structures. Element Uniqueness Problem. Hash Tables. Example. Hash Tables. Dana Shapira. 19 x 1. ) h(x 4. ) h(x 2. ) h(x 3. h(x 1. x 4. x 2.

Math 4318 : Real Analysis II Mid-Term Exam 1 14 February 2013

Some Properties of the K-Jacobsthal Lucas Sequence

Discrete Mathematics I Tutorial 12

UNIT V: Z-TRANSFORMS AND DIFFERENCE EQUATIONS. Dr. V. Valliammal Department of Applied Mathematics Sri Venkateswara College of Engineering

9.1 The multiplicative group of a finite field. Theorem 9.1. The multiplicative group F of a finite field is cyclic.

The Area of a Triangle

Mathematical Induction. How do you program a robot to climb infinite stairs? Let s use that as a proof method. 22c:19 Chapter 4 Hantao Zhang

Geometric Sequences. Geometric Sequence. Geometric sequences have a common ratio.

These Two Weeks. Mathematical Induction Chapter 4 Lecture 10 & Lecture 13. CPRE 310 Discrete Mathematics. Mathematical Induction Problems

MATH 304: MIDTERM EXAM SOLUTIONS

CH 39 USING THE GCF TO REDUCE FRACTIONS


A note on random minimum length spanning trees

2012 GCE A Level H2 Maths Solution Paper Let x,

When two numbers are written as the product of their prime factors, they are in factored form.

Einstein Classes, Unit No. 102, 103, Vardhman Ring Road Plaza, Vikas Puri Extn., Outer Ring Road New Delhi , Ph. : ,

Finite q-identities related to well-known theorems of Euler and Gauss. Johann Cigler

The Pigeonhole Principle 3.4 Binomial Coefficients

A proof of the binomial theorem

Homework 1 Solutions CSE 101 Summer 2017

Sect Simplifying Radical Expressions. We can use our properties of exponents to establish two properties of radicals: and

MATH /19: problems for supervision in week 08 SOLUTIONS

Week 13 Notes: 1) Riemann Sum. Aim: Compute Area Under a Graph. Suppose we want to find out the area of a graph, like the one on the right:

Solutions to Math 347 Practice Problems for the final

Eigenfunction Expansion. For a given function on the internal a x b the eigenfunction expansion of f(x):

ON EUCLID S AND EULER S PROOF THAT THE NUMBER OF PRIMES IS INFINITE AND SOME APPLICATIONS

(II.G) PRIME POWER MODULI AND POWER RESIDUES

Einstein Classes, Unit No. 102, 103, Vardhman Ring Road Plaza, Vikas Puri Extn., Outer Ring Road New Delhi , Ph. : ,

Lecture 4 Recursive Algorithm Analysis. Merge Sort Solving Recurrences The Master Theorem

0 otherwise. sin( nx)sin( kx) 0 otherwise. cos( nx) sin( kx) dx 0 for all integers n, k.

Expansion by Laguerre Function for Wave Diffraction around an Infinite Cylinder

( ) ( ) ( ) ( ) Solved Examples. JEE Main/Boards = The total number of terms in the expansion are 8.

Week 8. Topic 2 Properties of Logarithms

PROGRESSIONS AND SERIES

x a y n + b = 1 0<b a, n > 0 (1.1) x 1 - a y = b 0<b a, n > 0 (1.1') b n sin 2 + cos 2 = 1 x n = = cos 2 6 Superellipse (Lamé curve)

Chapter Real Numbers

MTH 146 Class 16 Notes

Convergence rates of approximate sums of Riemann integrals

GRAPHING LINEAR EQUATIONS. Linear Equations. x l ( 3,1 ) _x-axis. Origin ( 0, 0 ) Slope = change in y change in x. Equation for l 1.

Transcription:

Iductio Iductio is vey useul poo techique Iductio d Recusio CSC-59 Discete Stuctues I compute sciece, iductio is used to pove popeties o lgoithms Iductio d ecusio e closely elted Recusio is desciptio method o lgoithms Iductio is poo method suitble o ecusive lgoithms Kostti Busch - LSU Kostti Busch - LSU Use iductio to pove tht popositio P() is tue: Iductive Bsis: Pove tht P() is tue Iductive ypothesis: Assume P() is tue (o y positive itege ) Iductive Step: Pove tht P( ) is tue Iductive ypothesis: Assume P() is tue (o y positive itege ) Iductive Step: Pove tht P( ) is tue I othe wods i iductive step we pove: P( ) P( ) o evey positive itege Kostti Busch - LSU Kostti Busch - LSU

Iductive bsis P() Tue Iductive Step P( ) P( ) Tue Iductio s ule o ieece: [ P() ( P( ) P( ))] P( ) Popositio tue o ll positive iteges P( ) P() P() P() Kostti Busch - LSU 5 Kostti Busch - LSU 6 Theoem: P( ) : ( ) Poo: Iductive Bsis: P() : ( ) Iductive ypothesis: ssume tht it holds P( ) : ( ) Iductive Step: We will pove P( ) : ( )(( ) ) ( ) K. Busch - LSU 7 Iductive Step: P( ) : ( ) ( ) ( ) ( ) ( ) ( )(( ) ) (iductive hypothesis) Ed o Poo Kostti Busch - LSU 8

Kostti Busch - LSU 9 moic umbes j j 5 Exmple:,,, j Kostti Busch - LSU Theoem: Poo: Iductive Bsis: Kostti Busch - LSU Iductive ypothesis: Suppose it holds: Iductive Step: We will show: Kostti Busch - LSU Ed o Poo om iductive hypothesis

Theoem: Iductive ypothesis: Poo: Suppose it holds: Iductive Bsis: Iductive Step: We will show: ( ) Kostti Busch - LSU Kostti Busch - LSU om iductive hypothesis ( ) Ed o Poo Kostti Busch - LSU 5 We hve show: log It holds tht: log log (log ) Kostti Busch - LSU 6 log

Tiomios Theoem: Evey, checebod with oe sque emoved c be tiled with tiomioes Poo: Iductive Bsis: hole hole hole Kostti Busch - LSU 7 hole Kostti Busch - LSU 8 Iductive ypothesis: Assume tht checebod c be tiled with the hole ywhee Iductive Step: ole c be ywhee Kostti Busch - LSU 9 Kostti Busch - LSU 5

By iductive hypothesis with hole c be tiled sques x cse: dd thee tiicil holes Kostti Busch - LSU Kostti Busch - LSU x cse: Replce the thee holes with tiomio Now, the whole e c be tiled Kostti Busch - LSU Ed o Poo Kostti Busch - LSU 6

Iductive Bsis: Stog Iductio Iductive ypothesis: Assume P() To pove : Iductive Step: Pove tht Pove tht P() P( ) P() P( ) P( ) is tue is tue is tue Kostti Busch - LSU 5 Theoem: Evey itege is poduct o pimes (t lest oe pime i the poduct) Poo: Iductive Bsis: Numbe is pime Iductive ypothesis: Suppose tht evey itege betwee d is poduct o pimes (Stog Iductio) Kostti Busch - LSU 6 Iductive Step: b, b I is pime the the poo is iished By the iductive hypothesis: I is ot pime the it is composite: b, b i, j p p b q q pimes p i q j b p p q pimes i q j Ed o Poo Kostti Busch - LSU 7 Kostti Busch - LSU 8 7

Theoem: Evey postge mout c be geeted by usig -cet d 5-cet stmps Poo: (Stog Iductio) Iductive Bsis: 5 We exmie ou cses (becuse o the iductive step) 5 5 5 5 5 5 Iductive ypothesis: Assume tht evey postge mout betwee d c be geeted by usig -cet d 5-cet stmps Iductive Step: b 5 I the the iductive step ollows diectly om iductive bsis Kostti Busch - LSU 9 Kostti Busch - LSU Coside: 5 ( ) ( ) Iductive hypothesis ( ) b5 ( ) ( ) b5 Ed o Poo Kostti Busch - LSU Recusio Recusio is used to descibe uctios, sets, lgoithms Exmple: Fctoil uctio ( )! Recusive Bsis: ( ) Recusive Step: ( ) ( ) ( ) Kostti Busch - LSU 8

Recusive lgoithm o ctoil ctoil( ) { i the //ecusive bsis etu else //ecusive step etu ctoil(-) Recusive Bsis: Recusive Step: Fibocci umbes,,,,,,,, Kostti Busch - LSU Kostti Busch - LSU 7 5 5 6 5 5 8 8 5 6 5 Recusive lgoithm o Fibocci uctio ibocci( ) { i {, the //ecusive bsis etu else //ecusive step etu ibocci( -) ibocci( -) Kostti Busch - LSU 5 Kostti Busch - LSU 6 9

Itetive lgoithm o Fibocci uctio ibocci( ) { i the else { x y o to do { etu y i z x y x y y z y Kostti Busch - LSU 7 Theoem: o 5 Poo: Poo by (stog) iductio Iductive Bsis: (golde tio) Kostti Busch - LSU 8 Iductive ypothesis: is the solutio to equtio x x Suppose it holds Iductive Step: ( ) We will pove ( ) o Kostti Busch - LSU 9 iductio hypothesis Ed o Poo Kostti Busch - LSU

Getest commo diviso Recusive lgoithm o getest commo diviso Recusive Bsis: gcd(,) Recusive Step: gcd(, b) gcd( b, mod b) b gcd(,b ) { //ssume >b i the //ecusive bsis etu else //ecusive step etu gcd(b, mod b) b Kostti Busch - LSU Kostti Busch - LSU Lmes Theoem: The Euclidi lgoithm o gcd(, b), b uses t most 5log b divisios (itetios) Poo: We show tht thee is Fibocci eltio i the divisios o the lgoithm divisios / / / / gcd( b q q q q ist zeo emide, ) gcd(, ) gcd(,) esult gcd(, b) gcd(, ) gcd(, ) gcd(, ) Kostti Busch - LSU Kostti Busch - LSU

Kostti Busch - LSU 5 q q q q This holds sice d is itege q Kostti Busch - LSU 6 5 This holds sice ), gcd( b Kostti Busch - LSU 7 b 5 b log ) ( log b log 5 log log b b b 5log Ed o Poo Kostti Busch - LSU 8 Algoithm Megesot 8 6 9 7 5 8 6 9 7 5 6 8 9 5 7 5 6 7 8 9 split sot sot mege

Iput vlues o ecusive clls sot(,,, ) { i the { A sot(,,, m) B sot( m, m,, ) etu mege( A, B) else etu m / Kostti Busch - LSU 9 8 6 9 7 5 8 6 9 7 5 8 6 9 7 5 8 6 9 8 7 7 5 Kostti Busch - LSU 5 Iput d output vlues o megig 5 6 7 8 9 6 8 9 5 7 8 6 9 7 5 8 6 9 8 7 7 5 Kostti Busch - LSU 5 mege( ) { //two soted lists L while A d B do { Remove smlle ist elemet o om its list d iset it to i A o B the { pped emiig elemets to L etu L A, B A, B Kostti Busch - LSU 5 L

A 8 8 8 8 megig B 6 9 6 9 6 9 9 9 6 8 9 8 6 9 L Compiso <6 <6 6 6<8 6 8 8<9 6 8 9 The totl umbe o compisos to mege two lists is t most: A, B Meged size # compisos A B Legth o A Legth o B Kostti Busch - LSU 5 Kostti Busch - LSU 5,,, Recusive ivoctio tee,,,,,,,,,,,,,,,,,,,,,, Recusive ivoctio tee / / / / / Elemets pe list / / / log log log log (log ) log (log ) log log Assume Kostti Busch - LSU 55 Assume #levels o tee = log Kostti Busch - LSU 56

,,,,,, megig tee,,,,,,,,,,,,,,,,,,, megig tee / / / / / / Elemets pe list / / Kostti Busch - LSU 57 Kostti Busch - LSU 58 megig tee / / / / / Totl cost: (# levels -) log Compisos pe level / / / / / Elemets pe mege Meges pe level Kostti Busch - LSU 59 I the umbe o compisos is t most log I the umbe o compisos is t most mlog m O( log ) m log Time complexity o mege sot: O( log ) Kostti Busch - LSU 6 5