Starting from:

$30

MTH 373/573 Homework 1 solved


Problem1: ConditionNumber                                               
Recast the following problems as evaluation problems 𝑦 = 𝑓 (𝑥) for the input 𝑥, a fixed parameter 𝑎 and output 𝑦, and compute their condition numbers 𝜅(𝑥):

    (a) 𝑦 − 𝑎𝑥 = 0,    𝑎 > 0,                                      (b) 𝑥 − 𝑦 + 1 = 0.

Problem2: VectorNormsareLipschitzContinuous                      
Show that any vector norm is Lipschitz continuous, that is, it satisfies the inequality:

                                                         |‖𝑥‖ − ‖𝑦‖| ≤ ‖𝑥 − 𝑦‖,  for all 𝑥, 𝑦 ∈ ℝ𝑛.

Problem3: 𝑝-normsandTensorProduct                              
(a)    Let 𝑥 ∈ ℝ𝑛 and 𝑦 ∈ ℝ𝑚. Define the tensor product of 𝑥 and 𝑦 to be the following ℝ𝑚𝑛 vector:

⎡𝑥𝑦1⎤

                                                                                     𝑥 ⊗ 𝑦 ≔ ⎢ ⋮ ⎥    .

                                                                                                          ⎢      ⎥

⎣𝑥𝑦𝑚⎦𝑚𝑛

What is ‖𝑥⊗𝑦‖𝑝 in terms of ‖𝑥‖𝑝 and ‖𝑦‖𝑝 for each of the cases 𝑝 = 1, 2, ∞? Demonstrate for each case via step-by-step calculations.

(b)    Based on your solution, conjecture for the generalization to tensor product of two matrices: if 𝐴 is a ℝ𝑚×𝑛 matrix and 𝐵 is a ℝ𝑘×ℓ matrix, their tensor product is the

following ℝ𝑚𝑘×𝑛ℓ matrix:
 
 
⎡𝐴𝐵11

                                                              𝐴 ⊗ 𝐵 ≔ ⎢  ⋮



⎣𝐴𝐵𝑘1





𝐴𝐵1ℓ⎤

⋮    ⎥ .



𝐴𝐵𝑘ℓ⎦
Problem4: NilpotentMatrixisSingular                                           
Let 𝐴 ∈ ℝ𝑛×𝑛 be a nilpotent matrix with index 2, that is 𝐴2 = 𝕆 where 𝕆 ∈ ℝ𝑛×𝑛 is the zero matrix. Using the definition of singularity in terms of linear independence of columns (rows) of a matrix, show that 𝐴 is singular.

Problem5: ConditionNumberofMatrices                                        
Show that for any nonsingular matrices 𝐴, 𝐵 ∈ ℝ𝑛×𝑛, their condition number (in any subordinate matrix norm) satisfies: 𝜅(𝐴𝐵) ≤ 𝜅(𝐴) 𝜅(𝐵).

Problem6: ExploringIEEEDoublePrecisionusingPython
(a)    What does this code snippet do? Type it in an IPython terminal or Jupyter Notebook. Explain what you observe when you run it and why in no more than 2-3 sentences.

a = 1.

while a != 0: a /= 2

print(a)
(b)    What does this code snippet do? Type it in an IPython terminal or Jupyter Notebook.

Explain what you observe when you run it and why in no more than 2-3 sentences.

a = 1.; eps = 1.; b = a + eps while a != b: eps /= 2 b = a + eps

print(eps)
(c)    What does this code snippet do? Type it in an IPython terminal or Jupyter Notebook. Explain what you observe when you run it and why in no more than 2-3 sentences.

a = 1.

while a != inf: a *= 2

print(a)
Warning: The decimal point “.” after the 1 in the variable a is extremely important. Please read Submission Notes (on last page) for some additional information.

Problem7: UnderstandingRoundoffError                      
1 𝑛

(a)    Recall that the number 𝑒 is defined by lim (1 +            ) . Estimate the value of 𝑒 by writing

                                                                                                𝑛→∞           𝑛
 𝑛
a Python code to compute the expressionfor 𝑛 = 10𝑘, 𝑘 = 1, 2, … , 15. Using plt.plot from matplotlib (see Python tip in Guidelines on first page), plot the relative error in this computation for each value of 𝑘. For what value of 𝑘 do you get the most accurate estimate for 𝑒 using this limit formula? Why does this not match with the mathematical expectation that this formula should become increasingly more accurate as 𝑛 increases? Reason in terms of floating point arithmetic and its relation

with machine epsilon 𝜀𝑀.

(b)    Now implement the Taylor series computation for 𝑒:

𝑒 = 1 +

 1!

First, using your understanding of 𝜀𝑀, what stopping criterion should be used for determining where to truncate this Taylor series? Once you have determined this, implement this using an appropriate looping construct in Python. What is the relative error in the computation of 𝑒 in this case?

More products