MA 5310, Spring 2011
Professor Craig C. Douglas
 
Tuesday - Thursday 9:35-10:50, Ross Hall 247
 
http://www.mgnet.org/~douglas/Classes/na-sc
 
Notes   Homeworks+Exams   Syllabus
 
Office hours: Tu 1:00-2:00, W 9:00-10:00, Th 3:00-4:00
Exams: about once a month. Final 5/3/2011 10:15-12:15

Homework and Exams

Homeworks Exams Due Worth
hw1   1/27/2011 400
hw2   2/15/2011 400
hw3   2/18/2011, 5:00 PM NA
hw4   2/24/2011 400
hw5   3/22/2011 400
hw6   4/19/2011 400
  exam1 2/10/2011 100
  exam2 3/3/2011 100
  exam3 4/14/2011 100

Homeworks

All homework should be emailed to me before class on the date due unless another specific time is listed. Always put MA 5310 in the Subject line of your message. I will send you a reply when I get your mail. If you do not get a reply, I did not get your email. You are responsible for having an email account that can communicate successively with me. I am flexible on which of my email accounts you use up to a degree. I will normally send you email from GMail, however.

All homework should be done individually unless explicitly stated in an individual homework assignment. It is acceptable to ask simple questions of other people, but do not collude or works together closely. All dead sources are acceptable, however.

HW1

This will combine mathematics and computation. All programming should be in C++ only.

1. Consider the following polynomial:

f(x) = x2 (104 + 104)x + 1.

(a) If we compute the roots of f(x) by the quadratic formula, x1,2 = ( b (b2 4ac)1/2 ) / 2a on a machine with 7 digit precision, what results do we obtain?
(b) What are the correct roots in infinite precision?

2. Create a problem by yourself based on the lecture on Errors and solve it.

3. Create a C++ class that can do fixed point arithmetic. Fixed point arithmetic is similar to floating point arithmetic except it is exact and there is a known number of digits to the right of the decimal point. For example, to handle many currencies, there are two digits to the right of the decimal point and possibly some maximum number of digits to the left.
(a) Create your C++ header file with data stored in it for the data to the left and right of the decimal point. Do not use floating point for the data, use some form of an integer.
(b) You need a number of member functions, including at least one constructor, a destructor, a copy, a printer, and overload some arithmetic operations (+ and - at a minimum, and * and / as optional ones). When printing, do not print blanks to the right of the decimal point, make certain there are leading 0's instead (look up how to do formatted output with the >> operator). You should be able to handle a variable number of digits to the right of the decimal point, not just 2, though you may assume some number of digits by default if none is specified.
(c) Write a main program that tests all of your class members.
There are many pitfalls that you need to think about and document how your class will react. One example is you are asked to add two of your new class together, but they have a different number of fixed point digits to the right of the decimal. There are ways of doing this gracefully, but it could also be considered an error.

HW1 Total Points 400

Problem 1 (100 points)
    -25 Each root that is wrong or missing

Problem 2 (100 points)
 
Problem 3 (200 points)
    -10 Data is public, not private
    -25 No header file
    -25 Used double or float to store value
    -25 Used a blank in your class name
    -25 More than one class defined when only one is necessary
    -25 Printing only uses a fixed number of digits to the right of the decimal
    -40 Compiles, links, but does not work correctly
    -50 Turned in a .rar file instead of .tgz or .zip
    -50 Cannot compile/link code

HW2

This will combine mathematics and computation. All programming should be in C++ only.

1. Study Chapter 9 of the textbook and create a problem that is nontrivial on direct methodsby yourself and solve it.

2. Investigate the parlib programs and complete the inner_prod++.cpp example. Then write a program called matrixvec++.cpp that does a dense matrix vector multiply in parallel. You should base your program on the C++ examples. Turn in your Makefile, inner_prod++.cpp, and matrixvec++.cpp files. Once again, use mpic++ with g++ if at all possible (since this is what I will use to test your codes).

Postscript: I am starting out with a clean copy of the parlib files, i.e., I do the following before testing each of your submissions:

rm -rf parlib
mkdir parlib
cd parlib
tar zxf ../parlib.tgz
I am copying only your Makefile, innerprod++.cpp, and matrixvec++.cpp files into the directory tree:
Makefile -> parlib
innerprod++.cpp -> parlib/ExamplesInC++
matrixvec++.cpp -> parlib/ExamplesInC++
I then change into parlib and type
make
Everything should copy into the parlib directory and make. You are not allowed to change where any file is in the default parlib directory structure. You may not write a brand new Makefile that ignores the given one in parlib (you were required to modify the existing one, not write a new one).

HW3

This is a a makeup for Exam 1. If your overall score was less than 80, then you should redo each part of each problem in which you lost points. Turn in paper or send me a PDF file. Note that the assignment is due by 5:00 PM MST on a Friday.

HW4

This is a theoretical homework (no programming necessary). You can library search all of the answers. If you do, cite the literature. There is no penalty for library searched solutions, but you will learn more by doing the problems yourself. From the conjugate gradients class notes, prove

  1. Lemma CG2
  2. Lemma CG3 (use mathematical induction)
  3. Lemma CG4
  4. Lemma CG5
  5. Theorem 3.9 (short, complete proof only)
  6. Theorem 3.10 (or an equivalent convergence theorem based on the condition number and another norm)

You may turn in handwritten solutions or typed ones. If you submit a document electronically, a pdf file is preferred. Scanning and emailing the solution is another preferred method. If you turn your solution in after class on 2/25, you must submit it electronically.

HW4 Total Points 400

General to all problems
    -10 A(inner product) makes no sense mathematically
    -25 Do not properly use inner product notation all over the solutions
 
Lemma CG2 (50)
    -10 Too many errors writing 0
    -20 Too many irrelevant statements
    -25 Misuse inner product and vector arithmetic
 
Lemma CG3 (100)
    -10 Error in simplification in one part
    -35 No induction or completely incorrect induction
    -50 Just correctly prove one of the statements and assume the rest are true
    -75 Almost completely wrong proof
 
Lemma CG4 (50)
    -50 Proved a different lemma
 
Lemma CG5 (50)
    -20 Assume two inner products are equal when they are not in general
    -40 Almost completely wrong proof
 
Theorem 3.9 (50)
    -10 Assume subspace can have dimension greater than N
    -10 Proof misses that some r_i, 0 <= i < N could be the zero vector
    -20 Excessively long correct proof
    -30 Proved each step separately and made an assumption that was unproven in the general case
    -50 Completely missed the proof from line 1 of the proof.
 
Theorem 3.10 (100)
    -75 Just a citation given, no scan or handwritten copy (fixable)

HW5

HW6

Exams

Advice:

  1. Use one side of each piece of paper only.
  2. Write your name and the problem number you are solving on each page.
  3. Start each problem on a new page.
  4. Give details so that I can give you partial credit if your solution does not merit full credit.
  5. Write clearly and large enough so I can read what you write. If I cannot read your writing, you get no points.

Exam1

The exam and how many points were taken off for what error.

Exam2

The exam and how many points were taken off for what error.

Exam3

The exam and how many points were taken off for what error.

 

Cheers,
Craig C. Douglas

Last modified: 

3:00-4:00