[SOLVED] MTH373-573 Homework 1

35.00 $

Category: Tags: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon HW-1-vs35bj.zip (247.4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
๐Ÿ”’ Securely Powered by:
Secure Checkout
Rate this product

Problem1: ConditionNumber 5+5=10points 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 30points Show that any vector norm is Lipschitz continuous, that is, it satisfies the inequality:

|โ€–๐‘ฅโ€–โˆ’โ€–๐‘ฆโ€–|โ‰คโ€–๐‘ฅโˆ’๐‘ฆโ€–, forall๐‘ฅ,๐‘ฆ โˆˆR๐‘›.

Problem3: ๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘๐‘-normsandTensorProduct 15+5=20points (a) Let ๐‘ฅ โˆˆ R๐‘› and ๐‘ฆ โˆˆ R๐‘š. Define the tensor product of ๐‘ฅ and ๐‘ฆ to be the following R๐‘š๐‘›

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 R๐‘šร—๐‘› matrix and ๐ต is a R๐‘˜ร—l matrix, their tensor product is the following R๐‘š๐‘˜ร—๐‘›l matrix:

โŽก๐ด๐ต11 … ๐ด๐ต1lโŽค ๐ดโŠ—๐ตโ‰”โŽขโ‹ฎ โ‹ฑ โ‹ฎโŽฅ.

โŽฃ๐ด๐ต๐‘˜1 … ๐ด๐ต๐‘˜lโŽฆ

Problem4: NilpotentMatrixisSingular 10 points

Let๐ด โˆˆ R๐‘›ร—๐‘› beanilpotentmatrixwithindex2,thatis๐ด2 = ๐•†where๐•† โˆˆ R๐‘›ร—๐‘› isthe zero matrix. Using the definition of singularity in terms of linear independence of columns (rows) of a matrix, show that ๐ด is singular.

3/6

Problem5: ConditionNumberofMatrices 5 points Show that for any nonsingular matrices ๐ด, ๐ต โˆˆ R๐‘›ร—๐‘›, their condition number (in any subor-

dinate matrix norm) satisfies: ๐œ…(๐ด๐ต) โ‰ค ๐œ…(๐ด) ๐œ…(๐ต).
Problem6: ExploringIEEEDoublePrecisionusingPython 15

points

  1. (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)

  2. (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)

  3. (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)

    W arning: 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 20 + 15 = 35 points (a) Recall that the number ๐‘’ is defined by lim (1 + 1)๐‘›. Estimate the value of ๐‘’ by writing

๐‘›โ†’โˆž ๐‘›๐‘›
a Python code to compute the expression (1 + ๐‘›1) for ๐‘› = 10๐‘˜, ๐‘˜ = 1,2,…,15. Using

plt.plot from matplotlib (see Python tip in Guidelines on first page), plot the rel- ative 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

4/6

the mathematical expectation that this formula should become increasingly more ac- curate 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+1+1+โ‹ฏ.

1! 2! 3!

First, using your understanding of ๐œ€๐‘€ , what stopping criterion should be used for de- termining where to truncate this Taylor series? Once you have determined this, im- plement this using an appropriate looping construct in Python. What is the relative error in the computation of ๐‘’ in this case?

Please read Submission Notes (on last page) for some additional information.

5/6

Submission Notes

  1. The answer to all theoretical problems, output of Python code for computational problems including figures, tables and accompanying analyses should be provided in a single PDF file along with all your code files.
  2. Youcantypeset(pleaseconsiderusingLATEXifyouchoosetodoso),orwritebyhand and scan/take photographs of solutions for theoretical questions. For scanning or photography, please put in the extra effort and provide a single PDF file of your sub- mission.
  3. For Problem 6, in your PDF submission of solutions, please provide the output from the code snippet (run via Terminal or Notebook) for each of the three parts (a)โ€“(c). For each part, you will also explain what you observe and why. To make life easier (for you, for TAs!), here is an example of how to report what you observe.

    a = 1.
    while a <= 100:

    a = 2**a print(a)

    Solution: The output I obtained by running the code snippet is below:

    2
    4
    16 65536

    The observed output is obtained because the code computes and prints the first few terms of the recurrence relation: ๐‘Ž(๐‘› + 1) = 2๐‘Ž(๐‘›) with ๐‘Ž(1) = 1.

  4. ForProblem7,pleasesubmityourcodeintwofiles:problem_7a.pyandproblem_7b.py. You can use the two Python files and the code within them as boilerplate. Please do read the comments within each of these files. The remarks are meant to clarifying or helpful but they may even contain some hints!

6/6

  • HW-1-vs35bj.zip