Recurrences and Continued Fractions Great Theoretical Ideas In Computer Science V. Adamchik D. Sleator CS 15-251 Spring 2010 Lecture 8 Feb 04, 2010 Carnegie.

Slides:



Advertisements
Similar presentations
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
Advertisements

Matrices: Inverse Matrix
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.
Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer.
The Fibonacci Numbers And An Unexpected Calculation. Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 7Feb 3, 2004Carnegie.
Great Theoretical Ideas in Computer Science.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
Great Theoretical Ideas in Computer Science.
Whiteboardmaths.com © 2004 All rights reserved
Quit Ratio Golden Ratio Fibonacci QuitRatio Ratio is a way of showing the connection between two or more numbers. A ratio can be written as a fraction,
Are We Golden? Investigating Mathematics in Nature
Properties of the Integers: Mathematical Induction
Great Theoretical Ideas in Computer Science for Some.
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.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
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.
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
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
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.
GOLDEN MEAN AUKSO PJŪVIS. Definition of the Golden Rectangle The Golden Rectangle is a rectangle that can be split into a square and a rectangle similar.
The importance of sequences and infinite series in calculus stems from Newton’s idea of representing functions as sums of infinite series.  For instance,
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Counting III: Pascal’s Triangle, Polynomials, and Vector Programs Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
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.
Layout Design With Mathamatics
COMPSCI 102 Introduction to Discrete Mathematics.
7.2 Solving Linear Recurrence Relations Some of these recurrence relations can be solved using iteration or some other ad hoc technique. However, one important.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
Advanced Engineering Mathematics, 7 th Edition Peter V. O’Neil © 2012 Cengage Learning Engineering. All Rights Reserved. CHAPTER 4 Series Solutions.
Fibonacci Sequence & Golden Ratio Monika Bała. PLAN OF THE PRESENTATION: Definition of the Fibonacci Sequence and its properties Definition of the Fibonacci.
Recurrences, Phi and CF Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 13 Feb 28, 2006 Carnegie Mellon.
The Golden Ratio What is it? Also known as Phi (rhymes with fly)
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
The Golden Ratio Volkan UYGUN.
Great Theoretical Ideas in Computer Science.
History Of Golden Section Ludovica Boncompagni – Italy Evaggelia Antonaki – Greece Team Coordinator – Enrica Maragliano - Italy.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
The Golden Mean. The Golden Mean (or Golden Section), represented by the Greek letter phi, is one of those mysterious natural numbers, like e or pi, that.
Do Now Determine which numbers in the set are natural, whole, integers, rational and irrational -9, -7/2, 5, 2/3, √2, 0, 1, -4, 2, -11 Evaluate |x + 2|,
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 Mathematical Formula of Life
A Number You Can Call Your Own
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
The Golden Ratio, Fibonacci Numbers, And Other Recurrences
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
Similar Polygons Objectives: 1) To identify similar polygons
Presentation transcript:

Recurrences and Continued Fractions Great Theoretical Ideas In Computer Science V. Adamchik D. Sleator CS Spring 2010 Lecture 8 Feb 04, 2010 Carnegie Mellon University

Solve in integers x 1 + x 2 +…+ x 5 = 40 x k r k; y k =x k – k y 1 + y 2 +…+ y 5 = 25 y k ≥ 0;

Solve in integers x + y + z = 11 x r 0; 0  y  3; z r 0 [X 11 ]

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

Plan Review: Sat, 6-8pm in 2315 DH Exam: Mon in recitations Characteristic Equations Golden Ratio Continued Fractions Applied Combinatorics, by Alan Tucker The Divine Proportion, by H. E. Huntley

Leonardo Fibonacci In 1202, Fibonacci has become interested in rabbits and what they do

The rabbit reproduction model A rabbit lives forever The population starts as a single newborn pair Every 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 rabbits

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 We won’t be using GFs!

This lecture has explicit mathematical content that can be shocking to some students. WARNING!!!!

Characteristic Equation F n = F n-1 + F n-2 Consider solutions of the form: F n = n for some (unknown) constant ≠ 0 must satisfy: n - n-1 - n-2 = 0

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

So for all these values of the inductive condition is satisfied: = 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

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

How to convert kilometers into miles? Heads-on

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

From the previous lecture

Characteristic Equation  a, b

Characteristic Equation

Theorem. Let be a root of multiplicity p of the characteristic equation. Then are all solutions.

The theorem says that x n =n is a solution. This can be easily verified: n = 2 n - n

From the previous lecture: Rogue Recurrence Characteristic equation:

General solution:

The Golden Ratio “Some other majors have their mystery numbers, like  and e. In Computer Science the mystery number is , the Golden Ratio.” – S.Rudich

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. A B C

Golden Ratio - the divine proportion  = … “Phi” is named after the Greek sculptor Phidias

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 

The Golden Ratio

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 effect The second essential effect The third singular effect The fourth ineffable effect The fifth admirable effect The sixth inexpressible effect The seventh inestimable effect The ninth most excellent effect The twelfth incomparable effect The thirteenth most distinguished effect

Table of contents “For the sake of salvation, the list must end here” – Luca Pacioli

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

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 Fraction Euclid(A,B) = Euclid(B, A mod B) Stop when B=0

Euclid’s GCD = Continued Fraction

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:  = F n /F n-1 when n -> 

Divine Proportion

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? What is the continued fraction expansion for  ?

Euclid’s GCD = Continued Fraction ??

What is the pattern?

Every irrational number greater than 1 is the limit of a unique infinite continued fraction.

Every irrational number greater than 1 is the limit of a unique infinite continued fraction. Suppose that y>1 is irrational and y = [b 0 ;b 1,b 2,...]. where y 1 > 1. Thus, Similarly, for all b k.

To calculate the continued fraction for a real number y, set y 0 =y and then

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

Let us embark now on approximations

CF for Approximations

We say that an positive irrational number y is approximable by rationals to order n if there exist a positive constant c and infinitely many rationals p/q with q > 0 such that We will see that algebraic numbers are not approximable to arbitrarily high order.

Positive rational numbers are approximable to order 1 Let y = a/b be a rational number, with gcd(a,b) = 1. By Euclid’s algorithm we can find p 0,q 0 such that p 0 b − q 0 a = 1. Then

Positive rational numbers are approximable to order 1

Similarly,

Liouville’s number Transcendental number

Liouville’s number  and e are transcendental number What about  e ?

Apery’s constant irrational number transcendental number - ??? Riemann Zeta function

Study Bee Review GCD algorithm Recurrences, Phi and CF Solving Recurrences