Starting from:
$35

$29

Homework 2 Solution


    1. For each of the ve important series mentioned in the slides of section 1.2, write down the detailed derivation of its formula and the interval of convergence.

    2. Compute by hand

        (a) T5(x) for f(x) = 3 tan x, at point c =  =4.

        (b) T2(x) for f(x) = ecos x, at point c = 0.

    3. For f(x) = ex cos x at c = 0

        (a) Find T2(x) by hand.

(b) Use Taylor’s theorem to give an estimate of error jf(0:5)    T2(0:5)j. Compare it with the true
error jf(0:5)
T2
(0:5)j


(c) Approximate
Z0
1
f(x) dx by Z0
1
T2(x) dx. Find the true error.
(d) Find the Taylor series for f(x) = x2 1 at c = 1 and c = 2. Compare your result with the original function. Can you conclude what will the Taylor series of a general polynomial look like?
p

    4. Find the Taylor series of x at c = 1. Determine the interval of convergence (be careful with the ending points.).
p

5. Use the result you    nd in question 2 to evaluate    2. Round your answer to 4 decimals.

    6. Convert (100010010111011)2, (10:11)2 to decimal (base 10).

    7. Convert 37, 0:43, 10:11 to binary representation.

    8. Convert (1234)5 to decimal, then base 8 representation.

    9. Write down the IEEE format of the following numbers

        (a) 16.75

        (b) 1.5, using rounding up, rounding down and rounding to the nearest

        (c) 5.1, using rounding up, rounding down and rounding to the nearest

    10. What is the gap between 2 and the next larger Single-precision number?

    11. What is the gap between 201 and the next larger double-precision number?

    12. How many di erent normalized double-precision numbers are there?

    13. Consider a very limited system in which numbers are only of the form  1:b1b2b3    2E and the only
exponents are E =    1; 0; 1.

    (a) What is the machine precision " for this system?

    (b) What are the smallest and largest representable positive number in this system?

    (c) Consider the sequence mentioned in the last page of slides 2.1, starting with 1=3.

        i. Explain why the computed value eventually become 1.


1

        ii. Determine (by hand computing) how many iterations is needed for the sequence to reach 1 for the rst time.

    14. In the 7th season episode Treehouse of Horrors VI of The Simpsons, Homer has a nightmare in which the following equation ies past him:

178212 + 184112 = 192212

If this equation were true, this would contradict Fermat’s last theorem which states for n 3, there do not exist any natural numbers x; y and z such that xn + yn = zn. Did Homer dream up a
counterexample to Fermat’s last theorem?
p

    (a) Compute 12 178212 + 184112 in Matlab. What does Matlab report?

    (b) Try again by typing ’format long’ before your code in (1). What does Matlab report?

    (c) Prove that the equation cannot hold. Such an example is called a Fermat near miss. (Hint: think about even and odd number on both sides.)

    (d) In a later episode The Wizard of Evergreen Terrace, Homer writes the equation

398712 + 436512 = 447212:

Can you debunk this equation?

15. (Challenge) Consider the following polynomial

p(x) = (x    1)7

(a) In Matlab, do the following and attach your graph.

x = 0.988:0.0001:1;

y = (x-1).^7;

plot(x,y);

This will plot the graph of p(x) on the interval [0:988; 1] using points with 0.0001 between each. (b) Notice
(x 1)7 = x7 7x6 + 21x5 35x4 + 35x3 21x2 + 7x 1 This time do the following and attach your graph.

x = 0.988:0.0001:1;

y = x.^7-7*x.^6+21*x.^5-35*x.^4+35*x.^3-21*x.^2+7*x-1; plot(x,y);

Mathematically this should produce the same result as in (1).

(c) Explain why Matlab has no issue with (1) but large error is seen in (2).



















2

More products