Homework 2 MA/CS 375, Spring 2000 Due March 2 This homework will count as part of your grade so you must work independently. It is permissible to discuss it with your instructor, fellow students, and friends. However, the programs/scripts and report must be done only by the student doing the project. TURN IN TESTS OF ALL FUNCTIONS YOU WRITE! ---------------------------------------------------------------------------- INSTRUCTIONS: (these apply to all homeworks/projects for this class!) For all problems, turn in: (1) script listing, as well as path to where your working script can be found for testing. You must release the script and make the path to it world-readable. It is suggested that you do the following cd ~ (you are now in your root directory) chmod 755 . (makes your home directory world readable) mkdir Ma375 (creates directory for your homeworks; skip if it exists!) chmod 755 Ma375 (makes the directory world readable) cd Ma375 (you are now in the direcory ~/Ma375) mkdir hw2 (creates directory for hw2) chmod 755 hw2 (makes hw2 world readable) cd hw2 (you are now in directory ~/375/hw2) (create all the scripts, then execute:) chmod 644 * (makes all your files world readable) (2) use "diary" (type "help diary" for instructions) to produce a record of your session while running each script. Avoid (or edit out) error messages or redundant output, turn in only relevant, to the point calculations demonstrating the function of your script (the TA will try to reproduce your output, so do not be too creative in your editing!). (3) Include a brief discussion describing the calculation and the results. It must complement, not just repeat the comments in your script. If the script was about implementing an algoithm, explain the algorithm, etc. (4) Include hard copies of all plots. ---------------------------------------------------------------------------- [i.] Write a function which computes the infinity norm condition number of an nXn matrix, using the built-in Matlab function inv. Using the Matlab function randn, generate a reasonable sample of random matrices and compute their condition numbers. Plot the mean of the condition numbers for n=10,20,40,80. How does the mean condition number scale with n? [ii.] 5.2.7 (Record the flops required as a function of n and k for the examples you choose.) [iii.] 5.2.12 (Record the flops required as a function of n for the examples you choose.) [iv.] 5.4.2 [v.] 6.1.5