正在加载图片...
Chapter 1. Introduction to MATLAB prints the final fraction by formatting p and q as decimal integers and placing a'/ between them The third p is the same number as the first two p's, but is represented as a conventional decimal expansion, obtained by having the MATLAB eval function ctually do the division expressed in the second p The final quantity err is the difference between p and o. With only 6 terms, the approximation is accurate to less than 3 digits. How many terms does it take to get 10 digits of accuracy? As the number of terms n increases, the truncated continued fraction generate by goldfract(n) theoretically approaches o. But limitations on the size of the integers in the numerator and denominator, as well as roundoff error in the actual Hoating-point division, eventually intervene. Exercise 1.3 asks you to investigate the limiting accuracy of goldfract(n) 1.2 Fibonacci Numbers Leonardo Pisano Fibonacci was born around 1170 and died around 1250 in Pisa in what is now Italy. He traveled extensively in Europe and Northern Africa. He wrote several mathematical texts that, among other things, introduced Europe to the Hindu-Arabic notation for numbers. Even though his books had to be tran- scribed by hand, they were widely circulated. In his best known book, Liber abaca published in 1202, he posed the following problem: A man put a pair of rabbits in a place surrounded on all sides by a wall. How many pairs of rabbits can be produced from that pair in a year if it is supposed that every month each pair begets a new pair which from the second month on becomes productive? Today the solution to this problem is known as the Fibonacci sequence, or Fibonacci numbers. There is a small mathematical industry based on Fibonacci numbers. A search of the internet for "Fibonacci" will find dozens of web sites and hundreds of pages of material. There is even a Fibonacci Association that publishes a scholarly journal, the Fibonacci quarterly If Fibonacci had not specified a month for the newborn pair to mature would not have a sequence named after him. The number of pairs would simply double each month. After n months there would be 2" pairs of rabbits. Thats a lot of rabbits but not distinctive mathematics Let fn denote the number of pairs of rabbits after n months. The key fact is that the number of rabbits at the end of a month is the number at the beginning of the month plus the number of births produced by the mature pairs: The initial conditions are that in the first month there is one pair of rabbits and in he second there are two pairs f1=1,f2=2.8 Chapter 1. Introduction to MATLAB prints the final fraction by formatting p and q as decimal integers and placing a ‘/’ between them. The third p is the same number as the first two p’s, but is represented as a conventional decimal expansion, obtained by having the Matlab eval function actually do the division expressed in the second p. The final quantity err is the difference between p and φ. With only 6 terms, the approximation is accurate to less than 3 digits. How many terms does it take to get 10 digits of accuracy? As the number of terms n increases, the truncated continued fraction generated by goldfract(n) theoretically approaches φ. But limitations on the size of the integers in the numerator and denominator, as well as roundoff error in the actual floating-point division, eventually intervene. Exercise 1.3 asks you to investigate the limiting accuracy of goldfract(n). 1.2 Fibonacci Numbers Leonardo Pisano Fibonacci was born around 1170 and died around 1250 in Pisa in what is now Italy. He traveled extensively in Europe and Northern Africa. He wrote several mathematical texts that, among other things, introduced Europe to the Hindu-Arabic notation for numbers. Even though his books had to be tran￾scribed by hand, they were widely circulated. In his best known book, Liber Abaci, published in 1202, he posed the following problem: A man put a pair of rabbits in a place surrounded on all sides by a wall. How many pairs of rabbits can be produced from that pair in a year if it is supposed that every month each pair begets a new pair which from the second month on becomes productive? Today the solution to this problem is known as the Fibonacci sequence, or Fibonacci numbers. There is a small mathematical industry based on Fibonacci numbers. A search of the Internet for “Fibonacci” will find dozens of Web sites and hundreds of pages of material. There is even a Fibonacci Association that publishes a scholarly journal, the Fibonacci Quarterly. If Fibonacci had not specified a month for the newborn pair to mature, he would not have a sequence named after him. The number of pairs would simply double each month. After n months there would be 2n pairs of rabbits. That’s a lot of rabbits, but not distinctive mathematics. Let fn denote the number of pairs of rabbits after n months. The key fact is that the number of rabbits at the end of a month is the number at the beginning of the month plus the number of births produced by the mature pairs: fn = fn−1 + fn−2. The initial conditions are that in the first month there is one pair of rabbits and in the second there are two pairs: f1 = 1, f2 = 2
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有