Computer Programing and Typesetting
Computer Programming
Numerical mathematics courses, such as Numerical Analysis and Optimization, require computer programming in homework assignments and projects. MATLAB and Python are two most popular choices of programming languages.
Sample computer program
You may expect to write programs like the Newton method for your homework assignments and projects. An example implementation can be found written in MATLAB and Python.
Self-assessment problems
It is important that you have working knowledge with at least one of these two languages before the semester begins. To check your readiness, try to implement the following two problems. If you can complete them and obtain correct results without difficulty, you should be good to go.
Finding the real roots of quadratic equations: write a program that finds the real roots of any given quadratic equation \(ax^2+bx+c=0\). The program should take \((a,b,c)\) as input and return the real roots \(x = (-b \pm \sqrt{b^2 - 4ac})\,/\,(2a)\) if \(b^2 \ge 4ac\) or the message “No real root for this equation” otherwise.
Generating Fibonacci sequence: let \(x_0=0\), \(x_1=1\), and \(x_{n}=x_{n-1}+x_{n-2}\) for \(n \ge 2\). Write a program to generate \(x_0,x_1,\dots,x_{10}\).
Frequently asked questions
Q: Will the instructor teach how to write computer program during the class? Will the instructor answer questions related to programming in homework?
A: The instructor will not teach computer programming. Programming in MATLAB or Python is a prerequisite. If you have no background in computer programming but have to take this course, please study the tutorials above, and make sure you can work out the two self assessment problems above before the semester begins. The instructor will not answer questions related to computer programming or debugging in homework.
Resources for LaTeX Typesetting
You are encouraged to submit homework typed in LaTeX. LaTeX is a simple typesetting software to generate math-rich documents.
|