Welcome to Applied Mathematics 2120
Introduction to Mathematical Programming
Fall 2005
Final Exam: Thursday, Dec. 8th,
9:00am12:00pm
at CS1019
(CS is Computing Services and not Computer
Science; it's the long bungalow beside the Science building)

Note: No crib sheets or "crib disks" will be permitted during the exam.
Special accounts will be created for the Final exam. You will
have an access neither to your regular accounts, nor to the Internet.
Term marks (pdf)
Legend: [Sup: bonus eligible Asst4A]
[+MT: midterm bonus] [Att: attendance coefficient, may have an effect in
borderline cases] [S: please contact me]
[A: special arrangements] [n/e: not eligible]
Please report any omissions and discrepances should you notice them.
(For the MT bonus I have used a fairly sophisticated
interpolation formula, which preserves order of standings, other
condition being equal, but reduces gaps.)
Instructor: 
Dr. Sergey Sadov, HH3009 
Slot: 
03 and R11: MWF 10:00 a.m., Thur. 11:00 a.m. 
Classroom: 
Monday and Wednesday: SN2036, Thursday and Friday: C2003 
Assignment box: 
43 
Office hours: 
MWF 11:0012:00, Thur 14:0515:00, or by appointment 
Day One handout
Course Outline
 Rudimentary overview of the UNIX system
 Basic concepts of programming
 Practice of programming in C
 Elements of programming style
 Computer algebra system Maple as a symbolic calculator
 A glimpse of C++ and objectoriented programming
References
 Textbook:

Gary J. Bronson, ``A First Book of ANSI C'',
3rd edition, Brooks/Cole, 2001. (ISBN 0534379648)
 Supplementary reference materials

Short Unix
tutorial (from the University of Utah)
 Programming in ANSI C, by S. Kochan. (On reserve in the
library)

C++: An Introduction to computing, by J.Adams. (On
reserve
in the library)

Brief history of C (in Phil Ottewel's C course, which, beyond
Introduction, is for programmers already experienced in other languages.)
 Getting
started with Maple (from the Indiana State)
 C/C++ firsthand classics and MapleSoft official site

B. Kernighan, D. Ritchie, ``The C Programming Language'',
2nd edition, 1988
(QA 76.73 C15 K47)
and Kernighan's old (what was C back in 1974)
C tutorial

B.Stroustrup, ``The C++ programming language'',
Special ed., 2000
(QA 76.73 C153 S79)

MapleSoft
 Math online references
 Mathworld (Online
encyclopedia
supported by Wolfram,Inc. the producer of the computer algebra
system Mathematica)

PlanetMath (A good alternative
to MathWorld: definitions, theorems,... Just type in a word to search)

Cuttheknot by Alex Bogomolny
 esp. helpful for lovers of geometry (but it has much more!). Nice
dragandwatch visualizations of many theorems

Miscellaneous
Infrastructure
HowTo Memos
Labs

Lab 1 (First C program, prints a
greeting)

Lab 2 (Elementary arithmetics)

Lab 3 (printf, double vs int, math
functions)

Lab 4 (scanf, #define, conditional
compilation)

Lab 5 (summation of a geometric progression)
Example of loop tracing

Lab 6 (Solution of general
quadratic equation. Robust program with interactive input and proper treatment
of all special cases.)
Variation with functions
(Compile: gcc lm lab6_func.c)
and
C++ish simplification
(Compile: g++ lab6_func.cxx)

Lab 7 (Sorting out the
mess)

Lab 8 (Midterm programming question)
First steps with Maple
(Friday)
More: functions, team work, and fast math

Lab 9
(Some examples with loops and functions)
[By mistake, I confused the lab number and used the prefix lab7.
It was meant to be lab9. SS]

Lab 10 (Arrays and command line arguments)
lab10a.c
(Fixed number of command line arguments)
lab10b.cc
(Variable number of CLAs, dynamically allocated array; compile with g++)

Lab 12 (Maple worksheet on procedures)

Lab 13 (Review program involving
conditional statements, loops, arrays, and userdefined functions)
Assignments and Solutions

Assignment 1
[pdf]
[ps]
Correction: in #2, line 5 should read:
w=(uv)/6;

Assignment 2
[pdf]
[ps]
Corrections to Q#2: in the hardcopies distributed Thur Sep.29,
the declaration int diff and initialization
a=_INIT_A were missed.
Instructor's solution:
Program for Q.1

Assignment 4
[pdf]
[ps]
 Corrections to Part B
:
1) in #B1, the formula for b_{n}
should be b_{n}=b_{0}q_{n1}
(The factor b_{0} was missing).

2) in #B2, in loop header please change j++ to
j (Otherwise the loop was infinite.)
Instructor's solutions:
A1
A2
B1
B2

Assignment 5
[pdf]
[ps]
Correction: In #3, the singlequotes in the RETURN
statement (fourth line) have been amended to doublequotes, reflecting
current Maple syntax
Quizzes
Midterm Test
Preparation to the Final Exam

Outline of the Exam:

[9] Multiple choice  I
Hints

[15] Multiple choice II
Hints

[30] Tracing
Comments and
Training Q

[31] Programming

 General comments
[pdf]
[ps]
(Take a look at
Sol. to Asst4, Q.B1)

 Training programming exercises
[pdf]
[ps]
Corrections to Q.1: (i) Assume a=1 in the polynomial.
(ii) Math error in formula: b'k=d+c' shoud read
b'k=c+c'.
Here is a more detailed explanation of Q.1
[pdf]
[ps]
Here is are solutions (with detailed comments) to Problem 3 and Problem 4

[15] Maple
Comments

Material to be posted:
 Covered material <> Textbook section
 Comments on the Maple question
Corrections and amendments to lectures and labs


Sept.19:
about #include statement

We actually didn't have the #include <stdio.h> statement in
our first two programs. Older C compilers didn't allow that.
For the sake of portability (a possibility to compile your programs
at other computers without change), it's safer to include this line
right above int main().

Oct.19 Handout about functions
[pdf]
[ps]
****************************************************************************************
Department of Mathematics and
Statistics