Homeworks will be submitted and graded via Gradescope. No late homework is accepted without prior approval from the instructor, except for unforseen medical reasons with documentation.
Collaboration policy
NYU academic integrity policies will be strictly enforced for homework assignments.
- It is OK to discuss with other students the mathematical aspects, algorithmic strategy, code design, techniques for debugging, and compare results. You must however explicitly acknowledge any help that you receive from any source.
- Each student must write the solutions independently. Copying of any portion of someone else’s solution or allowing others to copy your solution is considered cheating.
- Code sharing is not allowed. You must type (or create from things you’ve typed using an editor, script, etc.) every character of code you use. There is no substitute for debugging your own code; looking at or copying someone else’s code is not the same.
Instructions
Sometimes you will be required to submit code files but you are always encouraged do that if you used code to compute your answers. There will be a separate zero-point assignment on Gradescope for submitting codes; codes must be submitted to get points. Always submit plain text files (extension .m for Matlab, or .py for python), and do not submit things like Matlab worksheets that cannot be opened in a simple text editor. Each problem should be a separate code, and please name your files reasonably so the grader can find the codes as needed.
Just code/numbes is not enough to get full points on a homework, in particular, the grader cannot possibly look at and debug all of your codes. The grader should be able to grade without looking at your code. If you only submit a final answer, and it is wrong, you leave no other option but to get zero points. So always explain what you did with equations in the answer, and then give the answers your code gave. For example, if a question asks you to give the numbers for a certain iteration, write down that iteration with a mathematical formula in the answer instead of just giving numbers. You are practicing here an important skill of reporting mathematical information to others, not just giving answers for a grade; communicating mathematics is an important part of your STEM education. You are also convincing us you know which formula from class is the right one to use.
Do not use sym in Matlab, i.e., do not use symbolic algebra in this class. This class is about computing with floating-point numbers, not symbolic computing, which is an important but distinct tool. If you want to use symbolic algebra, I strongly suggest using Mathematica (e.g. via Wolfram alpha) or Maple (the symbolic algebra in Matlab is just an interface to Maple’s core) or Sage.
How to present your information effectively:
- Plot figures with thought and care! For example, errors should be plotted on a logarithmic scale, not linear, so you can see it going down instead of flat lines. The plots should have axes labels, tick marks, and legends, and be easy to understand at a glance.
- Export figures from Matlab or other plotting software to a scalable graphics format (.eps, best is to use .pdf, .dxf) rather than raster graphics or bitmaps (.jpg, .png, .gif, .tif) instead of raster graphics formats in order to improve the quality and readability of the figures in the PDF (vector graphics-based plots avoid pixelation). If you use LaTex use PDF format with pdflatex.
- A picture is worth a thousand words! Instead of large tables, or printouts of Matlab matrices, make a plot. Do not submit pages of numbers unless there is a really good reason – it is not an effective way to present the information.
- However, a picture by itself is not enough! You must write an explanation to go with the figure, especially what you learn from the figure (think of figure captions in scientific papers).
- If you do print things, use fprintf to format the output nicely instead of printing large matrices. Also use format compact and other format commands to control how MATLAB prints things.
Homework assignments
1. (posted Feb 9, due Feb 24 at 2pm EST) Solving nonlinear equations in one dimension
Submit the solution on Gradescope.
2. (posted Feb 23, due March 8th at 2pm EST) Roundoff error and systems of linear equations
Submit the solution on Gradescope.
3. (posted March 5th, due March 17th at 2pm EST) Overdetermined linear systems
Submit the solution on Gradescope.
4. (posted March 24th, due April 7th at 2pm EST) Eigenvalues and Eigenvectors
Submit the solution on Gradescope.
5. (posted April 7th, due April 26th at 2pm EST) Polynomial interpolation/approximation
Submit the solution on Gradescope.
6. (posted April 21st, due May 10th at 2pm EST) Polynomial interpolation/approximation
Submit the solution on Gradescope.