MATH 211 Assignment 1
MATH 211 Assignment 1
1
4. [20 marks] The golden ratio (ϕ) has intrigued many people (not just mathematicians!)
for over two millennia. The ratio is purported to occur naturally in many places,
e.g., proportions within animal and human bodies, plants, and shells. The earliest
deliberate use of the golden ratio by humans is considered to be made by Phidias
(490–430 BC) in his construction of the Parthenon statues.
Give an illustration of the golden ratio in terms of line segments.
The golden ratio can be expressed as an infinite continued fraction:
1
ϕ=1+ .
1
1+
1
1+
1
1+
1 + ···
We notice that the (overall) denominator of this expression is in fact ϕ; hence we can
write
1
ϕ=1+ .
ϕ
Solve this equation to derive an analytical formula for ϕ.
Starting from an initial iterate of x = 1, write a Matlab script that implements a
while loop to compute ϕ to within a tolerance tol by the iteration x = 1 + 1/x.
How many iterations does your loop take to converge to within 10eps of ϕ?
5. [10 marks] Using the numbers
and 8-digit arithmetic, show that floating-point addition (⊕) is not associative, i.e.,
a ⊕ (b ⊕ c) 6= (a ⊕ b) ⊕ c.
You may assume that “8-digit arithmetic” means the answer is rounded off to 8 digits
after each operation. For example, 1.2345678 + 0.12345678 = 1.3580246.
6. [10 marks] On a certain computer, the distance between 7 and the next larger
floating-point number is 2−12 . What is machine epsilon on that computer? What
is the distance between 70 and the next larger floating-point number on that com-
puter? Assume of course that the computer represents numbers in base 2.
7. [10 marks] Literally evaluate the polynomial
at x = 4.71 using 3-digit arithmetic. What is the relative error in your answer? Now
evaluate p(x) using Horner’s algorithm and 3-digit arithmetic. What is the relative
error now? Is the more efficient calculation more accurate as well?