Watch the video on Spirals, Fibonacci, and Being a Plant.
Is Ms. Vihart doing Mathematics?
What is the 100th Fibonacci number . . . the 1,000th . . . the 1,000,000 . . . the $10^{100}$?
Can we use the computer to calculate these numbers?
Can a computer count to $10^{100}$?
Are Ms. Vihart's rectangles related to the Golden Rectangle that was so prized by the ancient Greek architects?
If so, how?
What about drawing those spirals, can we get the computer to draw them?
Understanding how to effectively use a computer as a tool in doing mathematics is the subject of Computational Mathematics.
The first step is to learn how to program, and for this class we will use today's most powerful "platform" for programming in mathematics.
|
Sage is a platform that brings together many powerful open source software packages for doing computational mathematics, and we talk to these packages using the Python programming language.
Python is a high-level scripting language that is particularly well suited for supporting the exploratory nature of Computational Mathematics.
|
|
75 75 |
|
Note the slightly different spelling here: explore why it is spelled that way.
100000000000000000000000000000000000000000000000000000000000000000000000\ 00000000000000000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
933262154439441526816992388562667004907159682643816214685929638952175999\ 932299156089414639761565182862536979208272237582511852109168640000000000\ 00000000000000 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 |
2 * 3 * 7 * 19 2 * 3 * 7 * 19 |
(x - 1)*(x^4 + x^3 + x^2 + x + 1) (x - 1)*(x^4 + x^3 + x^2 + x + 1) |
x^5 - 1 x^5 - 1 |
(x^5 - 1)^3 (x^5 - 1)^3 |
|
(x - 1)^3*(x^4 + x^3 + x^2 + x + 1)^3 (x - 1)^3*(x^4 + x^3 + x^2 + x + 1)^3 |
x/(x^2 - 1) x/(x^2 - 1) |
|
<type 'sage.symbolic.expression.Expression'> <type 'sage.symbolic.expression.Expression'> |
1/2/(x - 1) + 1/2/(x + 1) 1/2/(x - 1) + 1/2/(x + 1) |
|
|
|
|
|
|
|
|
|
1 + 1 = 2
1 + 2 = 3
2 + 3 = 5
3 + 5 = 8
5 + 8 = 13
and so on . . .
|
|
|
For more information on almost any sequence of integers, check the
|
|
|
|
|
Print the 1,000th Fibonacci number, but not all the others.
|
How long do you think it would take to compute the 1,000,000th Fibonacci number?
Give it a shot!
How long do you think it would take to compute the $10^{100}$th Fibonacci number?
|
An array is an ordered homogeneous collection. A list is an ordered inhomogeneous collection. In low level languages like C when an array is set up it has a fixed size. In higher level languages like Matlab, arrays are dynamic. That is, they can grow as needed. In Python lists are both inhomogeneous and dynamic. They generalize dynamic arrays.
We will start by considering some array operations that are common in most languages, and then explore the additional features provided in Python.
|
|
|
|
|
|
|
|
|
|