Recurrences, Phi and CF Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS 15-251 Spring 2006 Lecture 13 Feb 28, 2006 Carnegie Mellon.

Slides:



Advertisements
Similar presentations
By Christophe Dufour & Ming Au. Finding φ. The property that defines the golden ratio is: L = L+1 1 L a. Cross multiplying and rearranging the equation.
Advertisements

Publiczne Gimnazjum im. Jana Pawła II w Stróży Polish Team
Recurrences and Continued Fractions Great Theoretical Ideas In Computer Science V. Adamchik D. Sleator CS Spring 2010 Lecture 8 Feb 04, 2010 Carnegie.
CPE 130 Algorithms and Data Structures Recursion Asst. Prof. Dr. Nuttanart Facundes.
Ancient Wisdom: Primes, Continued Fractions, The Golden Ratio, and Euclid’s GCD Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall.
Fibonacci Sequences Susan Leggett, Zuzana Zvarova, Sara Campbell
The Fibonacci Numbers And An Unexpected Calculation. Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 7Feb 3, 2004Carnegie.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
Great Theoretical Ideas in Computer Science.
Whiteboardmaths.com © 2004 All rights reserved
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Lucas Numbers & Golden Triangles in the Regular Pentagon
Great Theoretical Ideas in Computer Science for Some.
“VITRUVIAN HOMER”.  The Golden ratio is a special number found by dividing a line into two parts so that the longer part divided by the smaller part.
Grade School Revisited: How To Multiply Two Numbers Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 18March.
Great Theoretical Ideas in Computer Science.
The Golden Ratio, Fibonacci Numbers, And Other Recurrences Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2006 Lecture 13October.
Chapter 3 Greek Number Theory The Role of Number Theory Polygonal, Prime and Perfect Numbers The Euclidean Algorithm Pell’s Equation The Chord and Tangent.
Advanced Counting Techniques
Fibonacci Numbers, Polynomial Coefficients, and Vector Programs.
Great Theoretical Ideas in Computer Science.
Slide 5-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
1 © 2010 Pearson Education, Inc. All rights reserved 10.1 DEFINITION OF A SEQUENCE An infinite sequence is a function whose domain is the set of positive.
The Mathematical Formula of Life
The Mathematical Formula of Art
Section 7.2 – The Quadratic Formula. The solutions to are The Quadratic Formula
Are You Perfect? Writing Prompt: What do you consider perfect?
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 4 Induction and Recursion 歐亞書局.
The Golden Ratio and Fibonacci Numbers in Nature
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
The Egytians used phi in the design of the Great Pyramids (c BC) Euclid (365 BC BC) referred to dividing a line at the point as.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 1 Equations and Inequalities.
Great Theoretical Ideas in Computer Science.
Layout Design With Mathamatics
COMPSCI 102 Introduction to Discrete Mathematics.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
Fibonacci Sequence & Golden Ratio Monika Bała. PLAN OF THE PRESENTATION: Definition of the Fibonacci Sequence and its properties Definition of the Fibonacci.
By Steven Cornell.  Was created by Leonardo Pisano Bogollo.  It show’s the growth of an idealized rabbit population.
A bc two other rotations Problem: Compute the other four permutations two other reflections Further discussion: there are 24 permutations of the set {a,b,c,d},
The Golden Ratio Volkan UYGUN.
Sequences and Summations ICS 6D Prof. Sandy Irani.
History Of Golden Section Ludovica Boncompagni – Italy Evaggelia Antonaki – Greece Team Coordinator – Enrica Maragliano - Italy.
“The two highways of the life: maths and English”
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
The proofs of the Early Greeks 2800 B.C. – 450 B.C.
The Fibonacci Sequence and The Goldens
SOLVING QUADRATIC EQUATIONS BY COMPLETING THE SQUARE
The Mathematical Formula of Life
A Number You Can Call Your Own
Induction: One Step At A Time
On the Divine Proportion (De divina proportione)
Great Theoretical Ideas in Computer Science
9 The Mathematics of Spiral Growth
The Fibonacci Numbers And An Unexpected Calculation
Number Theory and Modular Arithmetic
The Mathematical Formula of Life
Generating Functions II
The Golden Ratio, Fibonacci Numbers, And Other Recurrences
Great Theoretical Ideas in Computer Science
Great Theoretical Ideas In Computer Science
Induction: One Step At A Time
Induction: One Step At A Time
The Mathematical Formula of Life
Quadratic Equations.
The Mathematical Formula of Life
Induction: One Step At A Time
Presentation transcript:

Recurrences, Phi and CF Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 13 Feb 28, 2006 Carnegie Mellon University

Solve in integers x 1 +x 2 +x 3 =11 x 1 r 0; x 2 b 3; x 3 r 0 Warm-up

Solve in integers x 1 +x 2 +x 3 =11 x 1 r 0; x 2 b 3; x 3 r 0 [X 11 ] Warm-up

Find the number of ways to make change for $1 using pennies, nickels, dimes and quarters Make Change (interview question)

Find the number of ways to make change for $1 using pennies, nickels, dimes and quarters [X 100 ] Make Change

Find the number of ways to make change for $1 using pennies, nickels, dimes and quarters Make Change

Find the number of ways to partition the integer n 3 = 1+1+1=1+2 4= =1+1+2=1+3=2+2 Partitions

Find the number of ways to partition the integer n Partitions

Find the number of ways to partition the integer n Partitions

Leonardo Fibonacci In 1202, Fibonacci proposed a problem about the growth of rabbit populations.

The rabbit reproduction model A rabbit lives foreverA rabbit lives forever The population starts as a single newborn pairThe population starts as a single newborn pair Every month, each productive pair begets a new pair which will become productive after 2 months oldEvery month, each productive pair begets a new pair which will become productive after 2 months old F n = # of rabbit pairs at the beginning of the n th month month rabbit s

F n is called the n th Fibonacci number month rabbit s F 0 =0, F 1 =1, and F n =F n-1 +F n-2 for n  2 F n is defined by a recurrence relation.

What is a closed form formula for F n ? F 0 =0, F 1 =1, F n =F n-1 +F n-2 for n  2

Techniques you have seen so far F n =F n-1 +F n-2 Consider solutions of the form: F n = c n for some constant c c must satisfy: c n - c n-1 - c n-2 = 0

iff iff c n-2 (c 2 - c - 1) = 0 iff c=0 or c 2 - c - 1 = 0 Iff c = 0, c = , or c = -1/   (“phi”) is the golden ratio

c = 0, c = , or c = -(1/  ) So for all these values of c the inductive condition is satisfied: c n - c n-1 - c n-2 = 0 Do any of them happen to satisfy the base condition as well? F 0 =0, F 1 =1

 a,b a  n + b (-1/  ) n satisfies the inductive condition Adjust a and b to fit the base conditions. n=0: a+b = 0 n=1: a  1 + b (-1/  ) 1 = 1 a= 1/  5 b= -1/  5

Leonhard Euler (1765)

Fibonacci Power Series

Fibonacci Bamboozlement

Cassini’s Identity F n+1 F n-1 - F n 2 = (-1) n We dissect F n xF n square and rearrange pieces into F n+1 xF n-1 square

Golden Ratio Divine Proportion Ratio obtained when you divide a line segment into two unequal parts such that the ratio of the whole to the larger part is the same as the ratio of the larger to the smaller. ABC

Ratio of height of the person to height of a person’s navel

Aesthetics  plays a central role in renaissance art and architecture. After measuring the dimensions of pictures, cards, books, snuff boxes, writing paper, windows, and such, psychologist Gustav Fechner claimed that the preferred rectangle had sides in the golden ratio (1871).

Which is the most attractive rectangle?

Golden Rectangle 1 

Divina Proportione Luca Pacioli (1509) Pacioli devoted an entire book to the marvelous properties of . The book was illustrated by a friend of his named: Leonardo Da Vinci

Table of contents The first considerable effectThe first considerable effect The second essential effectThe second essential effect The third singular effectThe third singular effect The fourth ineffable effectThe fourth ineffable effect The fifth admirable effectThe fifth admirable effect The sixth inexpressible effectThe sixth inexpressible effect The seventh inestimable effectThe seventh inestimable effect The ninth most excellent effectThe ninth most excellent effect The twelfth incomparable effectThe twelfth incomparable effect The thirteenth most distinguished effectThe thirteenth most distinguished effect

Divina Proportione Luca Pacioli (1509) "Ninth Most Excellent Effect" two diagonals of a regular pentagon divide each other in the Divine Proportion.

Expanding Recursively

A (Simple) Continued Fraction Is Any Expression Of The Form: where a, b, c, … are whole numbers.

A Continued Fraction can have a finite or infinite number of terms. We also denote this fraction by [a,b,c,d,e,f,…]

Continued Fraction Representation = [1,1,1,1,1,0,0,0,…]

Recursively Defined Form For CF

Proposition: Any finite continued fraction evaluates to a rational. Converse: Any rational has a finite continued fraction representation.

Euclid’s GCD = Continued Fractions Euclid(A,B) = Euclid(B, A mod B) Stop when B=0

A Pattern for  Let r 1 = [1,0,0,0,…] = 1 r 2 = [1,1,0,0,0,…] = 2/1 r 2 = [1,1,0,0,0,…] = 2/1 r 3 = [1,1,1,0,0,0…] = 3/2 r 3 = [1,1,1,0,0,0…] = 3/2 r 4 = [1,1,1,1,0,0,0…] = 5/3 r 4 = [1,1,1,1,0,0,0…] = 5/3 and so on. Theorem: r n = F n+1 /F n

Divine Proportion

How to convert kilometers into miles? Heads-on

50 km = = F 9 + F 7 + F 4 F 8 + F 6 + F 3 = 31 miles Magic conversion

Quadratic Equations X 2 – 3x – 1 = 0 X 2 = 3X + 1 X = 3 + 1/X X = 3 + 1/X = 3 + 1/[3 + 1/X] = …

A Periodic CF

A period-2 CF

Proposition: Any quadratic solution has a periodic continued fraction. Converse: Any periodic continued fraction is the solution of a quadratic equation

What about those non-periodic continued fractions?

Non-periodic CFs

What is the pattern?

What a cool representation! Finite CF: Rationals Periodic CF: Quadratic roots And some numbers reveal hidden regularity.

More recurrences!! Let us embark now on the Catalan numbers

Count the number of binary trees with n nodes. Counting Binary Trees

Let T n represent the number of trees with n nodes T 1 =1, T 2 =2 Counting Binary Trees

Size n-1-kSize k Size n =

Counting Binary Trees Size n-1-kSize k Size n = T n = T 0 T n-1 + T 1 T n-2 +…+T n-1 T 0 T n = T 0 T n-1 + T 1 T n-2 +…+T n-1 T 0

Counting Binary Trees

Count the number of ways to divide a convex n-gon into triangles with noncrossing diagonals. Triangulation

Study Bee Review GCD algorithm Recurrences, Phi and CF The Catalan numbers