CS137 HW#4 Suggested Solutions
Due: 07/27/2004
#1. E5.1, p248
(a) f'(x) = 2x. With x0 = 1, the value of x1 using Newton's method is
x1 = x0 f(x0) / f'(x0) = 1 + 1/2 = 3/2.
(b) The value of x2 using the secant method is
x2 = x1 f(x1)( x1 x0) / ( f(x1) - f(
CS137 HW#3 Suggested Solutions
Due July 15, 2004
#1. E3.8.
Let x be any nonzero vector. Then xTATAx = (Ax)T(Ax) > 0 unless Ax = 0. But the
latter case would be contradictory to the assumption of rank(A) = n. Hence, ATA must be positive
definite.
HT = IT 2
CS137 HW#2 Solution
Due: 07/08/2004
10 points for each problem
1. Exercise 2.13, p.97
First solve the upper triangular system L1 x = b for x by forward-substitution,
then solve the lower triangular system L2 y = c - Bx for y by forward-substitution.
2. Ex
CS137 HW#1 Solution
Due: 07/01/2004
1. Exercise 1.6, p.42
(a) For x = 0.1, forward error = 1.6658 x 10^(-4), backward error = 1.6742 x 10^(-4)
For x = 0.5,
2.0574 x 10^(-2),
2.3599 x 10^(-2)
For x = 1.0,
1.5853 x 10^(-1),
5.7080 x 10^(-1)
(b) For x = 0.1,
CS137: Introduction to Scientic Computing
Take-Home Final
Summer 2003/04
Due: 5pm, Friday, August 13, 2004
Important note: No collaboration is allowed for the take-home nal exam. You may not consult anyone
else other than the instructors of this course. S
htree.py
Below is the syntax highlighted version of htree.py from 2.3 Recursion.
#-# htree.py
#-import stddraw
import sys
#-# Draw to standard draw a level n H-tree centered at (x. y) with lines
# of length lineLength.
def draw(n, lineLength, x, y):
if n