MATH-GA.2043 or CSCI-GA.2112

Scientific Computing

Warren Weaver Hall, room 1302, Thursdays, 5:10 - 7 pm
Courant Institute of Mathematical Sciences
New York University
  Fall Semester, 2019

Notes about Homework Submissions

There will be regular (approximately bi-weekly) assignments that will be posted on this webpage and announced via email or in class. NYU Classes will only be used for collecting files from students and grading. Assignments may be posted before we have covered all the material, allowing you to start working on some of the problems early.

Here is an example ideal (you will not be held up to this standard) solution of a variant of a problem from the first homework on computing the first derivative numerically.

Logistics

Please read and follow these rules carefully as we use automated scripts to process the large number of files. Submissions that do not conform (e.g., submitting PDF files directly instead of a zip archive) will be rejected by the graders.
  1. Submit a PDF of your writeup and all of the source codes. Put all files in a zip archive.
  2. Submit only the archive file as a solution via NYU Classes. Make sure to complete the submission as otherwise we cannot access the file.
  3. Homeworks must be submitted by 8am on the morning after the listed due date. Late submissions will only be accepted if you send a justification to the instructor at least two days before the due date.
  4. If you use any external source, even Wikipedia, make sure you acknowledge it by referencing all help. Group work is discouraged: you may discuss the problems with your colleagues but each student must do the actual programming and writeup independently.

Organize your files

  1. Name files sensibly (e.g., not "A.m" or "script.m" but also not "Solution of Problem 1 by Me.m"). Include your name in the filename and in the text of the PDF writeup.
  2. In general, one should be able to grade without looking at all the codes. The reports should be mostly self-contained, e.g., the figures should be included in the writeup along with legends, explanations, calculations, etc. Do not include MATLAB codes in the writeup, only the results.
  3. Package the files so that the MATLAB codes can be run by us -- do not put all the sources in one long text file, for example. Also, we do not need your tex, lyx, Word, svn files etc., only a PDF of the final product. Please make it easy for us to find and examine the files quickly.
  4. If you are using Octave, do not use double quotes for strings, use single quotes instead for compatibility with MATLAB.
  5. For pen-and-pencil problems you can submit hand-written solutions if you prefer.

Present your information effectively

  1. 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 and be easy to understand at a glance.
  2. 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.
  3. However, a picture by itself is not enough! You must write a concise explanation of the figure, especially what you learn from the figure (think of figure captions in scientific papers).
  4. 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.

Quality over Quantity

  1. You need to demonstrate, in addition to a code and plot, that you understand what the numerical problem is. For example, just reporting "error is smallest for h=\dots" without an explanation will not get full points. I do not expect theorems, but some understanding is crucial.
  2. Do not substitute true understanding/exploration with trivial work: Solve a few problems well instead of handing in quarter solutions to all the problems. Demonstrate that you are intellectually-curious about the material.

Academic Integrity and Honesty

NYU academic integrity policies will be strictly enforced for homework assignments.
  1. It is encouraged to discuss with other students the mathematical aspects, algorithmic strategy, code design, techniques for debugging, and compare results.
  2. 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.
  3. 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.
  4. The assignments are meant to challenge you: It is not expected that you will get all of the points. If you spend more than 10-12 hours on an assignment consider talking to the instructor.
These rules not only ensure fairness but will also help you get the most out of this course. Learning how to apply the methods we discuss in class in practice is a critical part of this course and the main component of your grade. Scientific programming can only be learned by doing it. What programmers call "debugging" is an integral part of programming. You type something, and you think the code does something, but then you run and it does not run or produces numbers that do not look right. You learn by fixing it. It is a process that cannot be replaced by examining someone else's code.

Assignments

0. (Due ASAP) Questionnaire

Please submit the following information to donev@cims.nyu.edu:
  1. Name, degree you are working on now, and any prior degree(s) or professional experience you deem relevant to this course.
  2. Tell me the highest-level course you have taken in the following three areas and at what level (undergrad or grad): Calculus (e.g., Calc 3, Multivariable Calc, Vector Calc, etc.), Linear Algebra, Differential Equations.
  3. List all programming languages/environments that you have used, and your level of experience (just starting, beginner, intermediate, advanced, wizzard).
  4. Why did you choose this course (e.g., program requirement, your advisor suggested it)? Have you taken or plan to take any other course in applied mathematics or computing (e.g., Numerical Methods)?
  5. Is there a specific area or application you are interested in (e.g., theoretical numerical analysis, finance, computational genomics)?

1. (Extended to Thur Sept 26th 5pm) Numerical Computing

Based on lecture notes for first two lectures.

2. (Due by Sunday Oct 13th) Linear Systems

Based on lecture notes for third and fourth lectures.

3. (Due by 5pm Thursday Oct 24th) SVD

Based on lecture notes for eigenvalues.

4. (Extended to 5pm Thur Nov 7th) Nonlinear Systems and Optimization

Based on lecture notes for nonlinear equations and optimization.

5. (Due by 5pm Thur Nov 21st) Function Approximation

Based on lecture notes on interpolation and Fourier transforms, but also relates to previous homeworks on fitting.

6. (Due by 5pm Thur Dec 5th) Monte Carlo Methods