Download Continued Fractions and Approximations

Document related concepts

John Wallis wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

Approximations of π wikipedia , lookup

Vincent's theorem wikipedia , lookup

Ratio wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Positional notation wikipedia , lookup

Addition wikipedia , lookup

Continued fraction wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
Continued Fractions
and Approximations
Open Day
24th March, 2010
Dr. James Montaldi
University of Manchester
Continued Fractions – p. 1
Introduction
Leap Years
Continued Fractions – p. 2
How many days in a year?
The Earth goes round the sun in 365.24219878 days.
Just less than 365 and a quarter.
Continued Fractions – p. 3
How many days in a year?
The Earth goes round the sun in 365.24219878 days.
Just less than 365 and a quarter.
So, basically we need 365 days per year,
Continued Fractions – p. 3
How many days in a year?
The Earth goes round the sun in 365.24219878 days.
Just less than 365 and a quarter.
So, basically we need 365 days per year, and then study
the fractional part 0.24219878 to see how to correct it.
Continued Fractions – p. 3
How many days in a year?
The Earth goes round the sun in 365.24219878 days.
Just less than 365 and a quarter.
So, basically we need 365 days per year, and then study
the fractional part 0.24219878 to see how to correct it.
The Julian Calendar (dating back to the Roman Empire)
adds 1 extra day every four years (leap year). This averages
out to 365.25 days per year.
Continued Fractions – p. 3
How many days in a year?
The Earth goes round the sun in 365.24219878 days.
Just less than 365 and a quarter.
So, basically we need 365 days per year, and then study
the fractional part 0.24219878 to see how to correct it.
The Julian Calendar (dating back to the Roman Empire)
adds 1 extra day every four years (leap year). This averages
out to 365.25 days per year.
But this is too long by about 1 day each century.
Continued Fractions – p. 3
Gregorian Calendar
The Gregorian Calendar (introduced in Europe in 1582, and
in England in 1752):
(=0.25)
+1 day every 4 years: 14
24
(=0.24)
-1 day every 100 years: 100
97
+1 day every 400 years: 400
(=0.2425)
( compare: 0.24219878)
Continued Fractions – p. 4
Gregorian Calendar
The Gregorian Calendar (introduced in Europe in 1582, and
in England in 1752):
(=0.25)
+1 day every 4 years: 14
24
(=0.24)
-1 day every 100 years: 100
97
+1 day every 400 years: 400
(=0.2425)
( compare: 0.24219878)
Error is now 1 day in 3300 years.
But is there a better approximation?
Continued Fractions – p. 4
“Gregorian Reformation"
In 1752,
1st January in England, was
12th January in Europe!!!
Continued Fractions – p. 5
“Gregorian Reformation"
In 1752,
1st January in England, was
12th January in Europe!!!
September
S M Tu W
1 2
17 18 19 20
24 25 26 27
Th
14
21
28
1752
F
15
22
29
S
16
23
30
Continued Fractions – p. 5
CONTENTS
Continued Fractions – p. 6
CONTENTS
I Continued fractions
Continued Fractions – p. 6
CONTENTS
I Continued fractions
II How do we work them out?
Continued Fractions – p. 6
CONTENTS
I Continued fractions
II How do we work them out?
III Approximations
Continued Fractions – p. 6
What are continued fractions?
. . . as if fractions weren’t bad enough!!
Continued Fractions – p. 7
What are continued fractions?
. . . as if fractions weren’t bad enough!!
Here’s one:
81
1
= 1 +
1
56
2 +
4+
Shorthand:
81
56
1
6
= [1, 2, 4, 6]
Continued Fractions – p. 7
What are continued fractions?
. . . as if fractions weren’t bad enough!!
And here’s another:
190
1
= 2 +
1
81
2 +
1+
Shorthand:
190
81
1
8+1
3
= [2, 2, 1, 8, 3]
Continued Fractions – p. 7
And for irrational numbers?
There are also continued fractions for irrational numbers
Continued Fractions – p. 8
And for irrational numbers?
There are also continued fractions for irrational numbers
For example
√
2 = 1 +
1
2 +
1
2+
1
1
2+
2+...
√
Shorthand: 2 = [1, 2, 2, 2, 2, . . .]
Continued Fractions – p. 8
Part II
How do we work these out?
Continued Fractions – p. 9
The calculation
Start with an example:
Let’s take x = 2 · 75 = 2 34
Continued Fractions – p. 10
The calculation
Start with an example:
Let’s take x = 2 · 75 = 2 34
Integer part of 2.75 is 2
Continued Fractions – p. 10
The calculation
Start with an example:
Let’s take x = 2 · 75 = 2 34
Integer part of 2.75 is 2
So x = 2 + 34
Continued Fractions – p. 10
The calculation
Start with an example:
Let’s take x = 2 · 75 = 2 34
Integer part of 2.75 is 2
So x = 2 + 34
x=2+
1
4/3
Continued Fractions – p. 10
The calculation
Start with an example:
Let’s take x = 2 · 75 = 2 34
Integer part of 2.75 is 2
So x = 2 + 34
x=2+
1
4/3
x=2+
1
1+ 13
Continued Fractions – p. 10
The calculation
Start with an example:
Let’s take x = 2 · 75 = 2 34
Integer part of 2.75 is 2
So x = 2 + 34
x=2+
1
4/3
x=2+
1
1+ 13
Shorthand:
11
4
= [2, 1, 3].
Continued Fractions – p. 10
Continued Fractions
Take another fraction, say 43/30
Continued Fractions – p. 11
Continued Fractions
Take another fraction, say 43/30
Now,
43
30
has an integer part and a fractional part:
43
13
=1+
30
30
Continued Fractions – p. 11
Continued Fractions
Take another fraction, say 43/30
Now,
43
30
has an integer part and a fractional part:
43
13
1
=1+
.
=1+
30
30
30/13
Continued Fractions – p. 11
Continued Fractions
Take another fraction, say 43/30
Now,
43
30
has an integer part and a fractional part:
43
13
1
=1+
.
=1+
30
30
30/13
And 30/13 = 2 + 4/13, so
Continued Fractions – p. 11
Continued Fractions
Take another fraction, say 43/30
Now,
43
30
has an integer part and a fractional part:
43
13
1
=1+
.
=1+
30
30
30/13
And 30/13 = 2 + 4/13, so
1
1
43
.
=1+
=1+
30
30/13
2 + 4/13
Continued Fractions – p. 11
Continued Fractions
. . . (from previous slide)
1
43
=1+
30
2 + 4/13
Continued Fractions – p. 12
Continued Fractions
. . . (from previous slide)
1
1
43
=1+
=1+
.
1
30
2 + 4/13
2 + 13/4
Continued Fractions – p. 12
Continued Fractions
. . . (from previous slide)
1
1
43
=1+
=1+
.
1
30
2 + 4/13
2 + 13/4
Since 13/4 = 3 + 14 we have
1
43
=1+
30
2 + 3+1 1
4
Continued Fractions – p. 12
Continued Fractions
. . . (from previous slide)
1
1
43
=1+
=1+
.
1
30
2 + 4/13
2 + 13/4
Since 13/4 = 3 + 14 we have
1
43
=1+
30
2 + 3+1 1
4
43
= [1, 2, 3, 4].
That is,
30
Continued Fractions – p. 12
CFs & Irrational Numbers
NB: one can find the continued fraction of any number, even
an irrational one.
Continued Fractions – p. 13
CFs & Irrational Numbers
NB: one can find the continued fraction of any number, even
an irrational one.
However, the important difference is that the procedure
never stops.
Continued Fractions – p. 13
CFs & Irrational Numbers
NB: one can find the continued fraction of any number, even
an irrational one.
However, the important difference is that the procedure
never stops.
For example,
√
2=1+
1
2+
1
2+
1
1
2+
2+
1
2+···
√
That is, 2 = [1, 2, 2, 2, 2, 2, . . .]
Continued Fractions – p. 13
CFs & Irrational Numbers
Calculation
√
2 = 1.414213562373095
Continued Fractions – p. 14
CFs & Irrational Numbers
Calculation
√
2 = 1.414213562373095
= 1 + 0.414213562373095
Continued Fractions – p. 14
CFs & Irrational Numbers
Calculation
√
2 = 1.414213562373095
= 1 + 0.414213562373095
1
= 1+
2.414213562373095
Continued Fractions – p. 14
CFs & Irrational Numbers
Calculation
√
2 = 1.414213562373095
= 1 + 0.414213562373095
1
= 1+
2.414213562373095
1
= 1+
2 + 0.414213562373095
Continued Fractions – p. 14
CFs & Irrational Numbers
Calculation
√
2 = 1.414213562373095
= 1 + 0.414213562373095
1
= 1+
2.414213562373095
1
= 1+
2 + 0.414213562373095
= ...
Continued Fractions – p. 14
CFs & Irrational Numbers
Calculation
√
2 = 1.414213562373095
= 1 + 0.414213562373095
1
= 1+
2.414213562373095
1
= 1+
2 + 0.414213562373095
= ...
√
Other examples are 3 = [1, 1, 2, 1, 2, 1, 2, 1, 2, . . .]. and
√
7 = [2, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, . . .].
Continued Fractions – p. 14
CF of π
Calculation
π = 3.141592654
Continued Fractions – p. 15
CF of π
Calculation
π = 3.141592654
= 3 + 0.141592654
Continued Fractions – p. 15
CF of π
Calculation
π = 3.141592654
= 3 + 0.141592654
1
= 3+
7.062513285
Continued Fractions – p. 15
CF of π
Calculation
π = 3.141592654
= 3 + 0.141592654
1
= 3+
7.062513285
1
= 3+
7 + 0.062513285
Continued Fractions – p. 15
CF of π
Calculation
π = 3.141592654
= 3 + 0.141592654
1
= 3+
7.062513285
1
= 3+
7 + 0.062513285
1
= 3+
1
7 + 15+0.99659976
Continued Fractions – p. 15
CF of π
Calculation
π = 3.141592654
= 3 + 0.141592654
1
= 3+
7.062513285
1
= 3+
7 + 0.062513285
1
= 3+
1
7 + 15+0.99659976
Continuing (after a lot of work) you get
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, . . .]
Continued Fractions – p. 15
Continued Fractions
Basic Theorem
Continued Fractions – p. 16
Continued Fractions
Basic Theorem
If x is a rational number (fraction) then its CF terminates;
Continued Fractions – p. 16
Continued Fractions
Basic Theorem
If x is a rational number (fraction) then its CF terminates;
It x is irrational then its CF is infinite.
Continued Fractions – p. 16
Continued Fractions
Basic Theorem
If x is a rational number (fraction) then its CF terminates;
It x is irrational then its CF is infinite.
If x is quadratic then the CF is repeating.
Continued Fractions – p. 16
Continued Fractions
Basic Theorem
If x is a rational number (fraction) then its CF terminates;
It x is irrational then its CF is infinite.
If x is quadratic then the CF is repeating.
There are other CFs with interesting patterns though:
e − 1 = [1, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, . . .]
Continued Fractions – p. 16
Continued Fractions
Basic Theorem
If x is a rational number (fraction) then its CF terminates;
It x is irrational then its CF is infinite.
If x is quadratic then the CF is repeating.
There are other CFs with interesting patterns though:
e − 1 = [1, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, . . .]
And some with none, like
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
Continued Fractions – p. 16
Continued Fractions
Basic Theorem
If x is a rational number (fraction) then its CF terminates;
It x is irrational then its CF is infinite.
If x is quadratic then the CF is repeating.
There are other CFs with interesting patterns though:
e − 1 = [1, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, . . .]
And some with none, like
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
(at least, no-one has found a pattern!)
Continued Fractions – p. 16
Part III
Approximations
Continued Fractions – p. 17
A use for Continued Fractions
Approximations of irrational numbers
√
Find a fraction that’s a good approximation to 2.
Continued Fractions – p. 18
A use for Continued Fractions
Approximations of irrational numbers
√
Find a fraction that’s a good approximation to 2.
√
Use the continued fraction: 2 = [1, 2, 2, 2, 2, 2, . . .]
Continued Fractions – p. 18
A use for Continued Fractions
Approximations of irrational numbers
√
Find a fraction that’s a good approximation to 2.
√
Use the continued fraction: 2 = [1, 2, 2, 2, 2, 2, . . .]
x0 = [1] = 1,
x1 = [1, 2] = 1 +
1
2
= 32 .
Continued Fractions – p. 18
A use for Continued Fractions
Approximations of irrational numbers
√
Find a fraction that’s a good approximation to 2.
√
Use the continued fraction: 2 = [1, 2, 2, 2, 2, 2, . . .]
x0 = [1] = 1,
x1 = [1, 2] = 1 + 21 = 32 .
x2 = [1, 2, 2] = 1 + 1/(2 + 21 ) =
7
5
Continued Fractions – p. 18
A use for Continued Fractions
Approximations of irrational numbers
√
Find a fraction that’s a good approximation to 2.
√
Use the continued fraction: 2 = [1, 2, 2, 2, 2, 2, . . .]
x0
x1
x2
x3
= [1] = 1,
= [1, 2] = 1 + 21 = 32 .
= [1, 2, 2] = 1 + 1/(2 + 21 ) = 75
√
17
= [1, 2, 2, 2] = 12 . . . getting closer and closer to 2.
Continued Fractions – p. 18
A use for Continued Fractions
Approximations of irrational numbers
√
Find a fraction that’s a good approximation to 2.
√
Use the continued fraction: 2 = [1, 2, 2, 2, 2, 2, . . .]
x0
x1
x2
x3
= [1] = 1,
= [1, 2] = 1 + 21 = 32 .
= [1, 2, 2] = 1 + 1/(2 + 21 ) = 75
√
17
= [1, 2, 2, 2] = 12 . . . getting closer and closer to 2.
They are called the first, second, third, . . . nth convergent,
xn = abnn .
Continued Fractions – p. 18
Accuracy: example
√
How good are the approximations to 2 ?
Continued Fractions – p. 19
Accuracy: example
√
How good are the approximations to 2 ?
Recall:
√
2 = 1.414213562 = [1, 2, 2, 2, 2, 2, 2, . . .]
Continued Fractions – p. 19
Accuracy: example
√
How good are the approximations to 2 ?
Recall:
√
2 = 1.414213562 = [1, 2, 2, 2, 2, 2, 2, . . .]
[1,2]
=
3
2
= 1.5
Continued Fractions – p. 19
Accuracy: example
√
How good are the approximations to 2 ?
Recall:
√
2 = 1.414213562 = [1, 2, 2, 2, 2, 2, 2, . . .]
[1,2]
=
3
2
= 1.5
[1,2,2]
=
7
5
= 1.4
Continued Fractions – p. 19
Accuracy: example
√
How good are the approximations to 2 ?
Recall:
√
2 = 1.414213562 = [1, 2, 2, 2, 2, 2, 2, . . .]
[1,2]
=
3
2
= 1.5
[1,2,2]
=
7
5
= 1.4
[1,2,2,2] =
17
12
= 1.416667
Continued Fractions – p. 19
Accuracy: example
√
How good are the approximations to 2 ?
Recall:
√
2 = 1.414213562 = [1, 2, 2, 2, 2, 2, 2, . . .]
[1,2]
=
3
2
= 1.5
[1,2,2]
=
7
5
= 1.4
[1,2,2,2] =
17
12
= 1.416667
[1,2,2,2,2] =
41
29
= 1.413793
Continued Fractions – p. 19
Accuracy: example
√
How good are the approximations to 2 ?
Recall:
√
2 = 1.414213562 = [1, 2, 2, 2, 2, 2, 2, . . .]
[1,2]
=
3
2
= 1.5
[1,2,2]
=
7
5
= 1.4
[1,2,2,2] =
17
12
= 1.416667
[1,2,2,2,2] =
41
29
= 1.413793
[1,2,2,2,2,2] =
99
70
= 1.414285
Continued Fractions – p. 19
Accuracy
When using approximations, it’s important to know how
accurate they are.
Continued Fractions – p. 20
Accuracy
When using approximations, it’s important to know how
accurate they are.
Theorem If
a
b
is one of the convergents for x, then
a
x
−
<
b
Continued Fractions – p. 20
Accuracy
When using approximations, it’s important to know how
accurate they are.
Theorem If
a
b
is one of the convergents for x, then
a
1
x − < 2 .
b
b
Continued Fractions – p. 20
Accuracy
When using approximations, it’s important to know how
accurate they are.
Theorem If
a
b
is one of the convergents for x, then
a
1
x − < 2 .
b
b
And you can say more: among all fractions with denominator
no bigger than b, this convergent is the most accurate.
Continued Fractions – p. 20
Accuracy: another example
How good are the approximations to π ?
Continued Fractions – p. 21
Accuracy: another example
How good are the approximations to π ?
Recall:
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
π
= 3.14159265359
Continued Fractions – p. 21
Accuracy: another example
How good are the approximations to π ?
Recall:
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
[3, 7] =
π
= 3.14159265359
22
7
= 3.14285714286
Continued Fractions – p. 21
Accuracy: another example
How good are the approximations to π ?
Recall:
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
π
= 3.14159265359
[3, 7] =
22
7
= 3.14285714286
[3, 7, 15] =
333
106
= 3.14150943396
Continued Fractions – p. 21
Accuracy: another example
How good are the approximations to π ?
Recall:
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
π
= 3.14159265359
[3, 7] =
22
7
= 3.14285714286
[3, 7, 15] =
333
106
= 3.14150943396
[3, 7, 15, 1] =
355
113
= 3.14159292035
Continued Fractions – p. 21
Accuracy: another example
How good are the approximations to π ?
Recall:
π = [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, . . .]
π
= 3.14159265359
[3, 7] =
22
7
= 3.14285714286
[3, 7, 15] =
333
106
= 3.14150943396
[3, 7, 15, 1] =
355
113
= 3.14159292035
103993
33102
= 3.14159265301
[3, 7, 15, 1, 292] =
Continued Fractions – p. 21
Back to the Calendar
The Earth goes round the sun in 365.24219878 days.
Continued Fractions – p. 22
Back to the Calendar
The Earth goes round the sun in 365.24219878 days.
The Continued Fraction of 0.24219878 is
[0, 4, 7, 1, 3, 5, 6, . . . ]
Continued Fractions – p. 22
Back to the Calendar
The Earth goes round the sun in 365.24219878 days.
The Continued Fraction of 0.24219878 is
[0, 4, 7, 1, 3, 5, 6, . . . ]
First convergent for 0.24219878 is 14 .
Continued Fractions – p. 22
Back to the Calendar
The Earth goes round the sun in 365.24219878 days.
The Continued Fraction of 0.24219878 is
[0, 4, 7, 1, 3, 5, 6, . . . ]
First convergent for 0.24219878 is 14 .
So we should add an extra 1 day every 4 years (Leap Year).
This forms the old Julian Calendar.
But,
Continued Fractions – p. 22
Back to the Calendar
The Earth goes round the sun in 365.24219878 days.
The Continued Fraction of 0.24219878 is
[0, 4, 7, 1, 3, 5, 6, . . . ]
First convergent for 0.24219878 is 14 .
So we should add an extra 1 day every 4 years (Leap Year).
This forms the old Julian Calendar.
But, it’s not accurate enough . . .
Continued Fractions – p. 22
The Calendar
The second convergent for 0.24219878 is
7
29 .
8
33 .
31
.
is 128
The third is
The fourth
Continued Fractions – p. 23
The Calendar
The second convergent for 0.24219878 is
7
29 .
8
33 .
31
.
is 128
The third is
The fourth
Gregorian calendar uses
97
400
Continued Fractions – p. 23
The Calendar
The second convergent for 0.24219878 is
7
29 .
8
33 .
31
.
is 128
The third is
The fourth
Gregorian calendar uses
97
400
Errors:
Gregorian calendar: 1 day in 3300 years
Continued Fractions – p. 23
The Calendar
The second convergent for 0.24219878 is
7
29 .
8
33 .
31
.
is 128
The third is
The fourth
Gregorian calendar uses
97
400
Errors:
Gregorian calendar: 1 day in 3300 years
2rd convergent: 1 day in 1300 years
Continued Fractions – p. 23
The Calendar
The second convergent for 0.24219878 is
7
29 .
8
33 .
31
.
is 128
The third is
The fourth
Gregorian calendar uses
97
400
Errors:
Gregorian calendar: 1 day in 3300 years
2rd convergent: 1 day in 1300 years
3rd convergent: 1 day in 4400 years
Continued Fractions – p. 23
The Calendar
The second convergent for 0.24219878 is
7
29 .
8
33 .
31
.
is 128
The third is
The fourth
Gregorian calendar uses
97
400
Errors:
Gregorian calendar: 1 day in 3300 years
2rd convergent: 1 day in 1300 years
3rd convergent: 1 day in 4400 years
4th convergent: 1 day in 88000 years
Continued Fractions – p. 23
A New Calendar?
Add one day every fourth year, as usual,
Continued Fractions – p. 24
A New Calendar?
Add one day every fourth year, as usual,
and then every 128th year, don’t have the extra day.
Continued Fractions – p. 24
A New Calendar?
Add one day every fourth year, as usual,
and then every 128th year, don’t have the extra day.
This gives
31
128
(the 4th convergent).
Continued Fractions – p. 24
A New Calendar?
Add one day every fourth year, as usual,
and then every 128th year, don’t have the extra day.
This gives
31
128
(the 4th convergent).
It’s more accurate than the Gregorian calendar, and simpler.
Continued Fractions – p. 24
A New Calendar?
Add one day every fourth year, as usual,
and then every 128th year, don’t have the extra day.
This gives
31
128
(the 4th convergent).
It’s more accurate than the Gregorian calendar, and simpler.
(but they won’t do it!)
Continued Fractions – p. 24
History: a coincidence
The Gregorian calendar was introduced by Pope Gregory in
1582 in Catholic countries, and followed later in 1752 in
England, Ireland, (most of) US.
Continued Fractions – p. 25
History: a coincidence
The Gregorian calendar was introduced by Pope Gregory in
1582 in Catholic countries, and followed later in 1752 in
England, Ireland, (most of) US.
Continued Fractions
were first used by Bombelli to find an
√
approximation to 13, also in the 16th century, although
systematic understanding had to wait until Leonhard Euler in
the 18th century.
Continued Fractions – p. 25
History: a coincidence
The Gregorian calendar was introduced by Pope Gregory in
1582 in Catholic countries, and followed later in 1752 in
England, Ireland, (most of) US.
Continued Fractions
were first used by Bombelli to find an
√
approximation to 13, also in the 16th century, although
systematic understanding had to wait until Leonhard Euler in
the 18th century.
The End
Continued Fractions – p. 25
Further information
Much more information on this beautiful subject can be
found by searching the internet. Eg,
www.cut-the-knot.org
A copy of this talk can is available online at
www.maths.manchester.ac.uk/jm/CF.pdf
Continued Fractions – p. 26