COMP 350 Solutions for Assignment 4
1. (a) We work with the iteration formula:
xn+1 = xn f (xn )/g(xn ).
(1)
r xn+1 = (r xn ) + f (xn )/g(xn )
(2)
From this we have
In order to prove quadratic converg
COMP 350 Solutions to Assignment 1
1. (a) exponent bias = 231 1 = 3
(b) The smallest nonnegative normalized oating point in this system
(1.000000)2 22
The largest nonnegative normalized oating point i
COMP 350 Numerical Computing
Assignment #1: Floating Point Computing
Date Given: Wednesday, September 9. Date Due: 5pm, Wednesday, September 23, 2015
You can submit either an electronic copy (in PDF f
COMP 350 Numerical Computing
Assignment #1: Computer Numbers and Arithmetic
Date Given: Monday, September 8. Date Due: Monday, September 22, 2014
You can submit either an electronic copy (in PDF forma
COMP 350 Numerical Computing
Assignment #2: Overow and underow, and cancellation.
Date Given: Monday, September 20. Date Due: 5PM, Wednesday, Sept 29, 2010
This is a computer assignment. You can use a
COMP 350 Numerical Computing
Assignment #1: Floating point in C, overow and underow, numerical cancellation
Date Given: Monday, September 21. Date Due: 5pm, Wednesday, September 30, 2015
Submit your a
2015105
12:31
Review of lectures 2-9
1.
a.
b.
c.
IEEE floating point arithmetic
Binary & decimal representations
2's complement representation of integers
IEEE floating point representation
Single for
COMP 350 Numerical Computing
Assignment #1: Floating Point Computing Due: 5pm, Tuesday, Sep. 16, 2008
Place your clearly written or printed answers, rmly bound or stapled together, with your Name
and
COMP 350 Numerical Computing
Assignment #4. Solving a nonlinear equation.
Date given: Monday, Oct 20. Date due: 5pm, Wednesday, Oct 29, 2014.
1. (a) (8 points) The Steensen method for solving the equa
COMP 350 Numerical Computing
Assignment #3: MATLAB, solving linear systems. Due: 5PM, Tuesday, Oct 13, 2008.
1. (3 marks) Count the number of ops involved in the following MATLAB code:
for k = 1:n-1
i
COMP 350 Numerical Computing
Assignment #2: Overow, underow, numerical cancellation
Date Given: Wednesday, September 17. Date Due: Wednesday, October 1, 2014
This is a computer assignment. You can use
Classes of Real Numbers
All real numbers can be represented by a line:
1/2
1
0
1
2
3
4
The Real Line
real numbers
rational numbers
integers
non-integral fractions
irrational numbers
Rational numbers
A
COMP 350 Numerical Computing
Assignment #3: Solving linear systems.
Date given: Wednesday, September 30. Date due: 5pm, Wednesday, October 14, 2015
1. (2 points) Solve the following system using GEPP
COMP 350 Solution of Assignment #6, Fall 2014:
1. (14 points)
(a) (4 points)
For the composite trapezoid rule, the error formula is
Thus in this case, the absolute error is
Note that
b a 2
h f (z).
1
COMP 350 Numerical Computing
Assignment #3: Solving linear systems.
Date given: Wednesday, September 30. Date due: 5pm, Wednesday, October 14, 2015
1. (2 points) Solve the following system using GEPP
COMP 350 Numerical Computing
Assignment #1: Floating Point Computing
Date Given: Wednesday, September 9. Date Due: 5pm, Wednesday, September 23, 2015
You can submit either an electronic copy (in PDF f
COMP 350 Numerical Computing
Assignment #3: Solving linear systems of equations.
Date given: Wednesday, October 1. Date due: 5pm, Wednesday, October 15, 2014
1. (3 points) Solve the following system u
COMP 350 Numerical Computing
Assignment #5: Polynomial Interpolation, Spline Interpolation,
and Least Squares Approximation
Date given: Monday, Nov 3. Date due: 5:00pm, Monday, Nov 17, 2014.
1. (6 poi
Numerical Methods for Ordinary Differential Equations (ODE)
Introduction
In this course, we focus on the following general initial-value problem
ODE:
I
I
at - f
(t,r)
orcfw_
*@)-ns
(
dr(t) _
d
:
L r(a
COMP 350 Numerical Computing
Assignment #6, Numerical Integration
Date given: Monday, Nov 17. Due: 5:00pm, Monday, Dec 1, 2014.
1. (14 points) Let I =
2
x
0 (cos(2x)/e )dx.
(a) (5 points) If we use th
COMP 350 Numerical Computing
Assignment #2. Due: 5PM, Tuesday, Sept 30, 2008
This is a computer assignment. You can use any high-level programming language, but not a software
package such as MATLAB e
Solving a Nonlinear Equation
Problem: Given
/(r),
find a root (solution) of
/(r) :6.
r If /
o If /
is a polynomial with degree 4 or less, formulas for roots exist.
o If
is.a general nonlinear function
COMP 350 Solutions to Assignment 2
1. (10 points)
Here is the code for reference. Remember, dont do unnecessary computation!
#include "stdio.h"
#include "math.h"
#include "float.h"
float prod;
void pr
COMP 350 Solutions to Assignment 1 Fall 2017
1. (2 points)
The first bit is 1, so the number is negative. Denote it by x. Then the 2s complement representation of x is
0000000000000000000000001010110
COMP 350 Solutions to Assignment 5, 2017
1. x = [1 2 3 4] , y = [2 0 10 34]
Vandermonde Form
Let p(x) = c0 + c1 x + c2 x2 + c3 x3 , then we can plug in the data and write the equations in
the form of
Polynomial Interpolation (PI)
Reading: Cheney and Kincaid, Section 4.1
Problem
Given n + 1 points (x0 , y0 ), (x1 , y1 ),. . . ,(xn , yn ), where xi are distinct, seek a polynomial p(x)
with least deg
Numerical Integration
(Reading: Cheney and Kincaid, Chapter 5)
Introduction: There are two types of integrals: indefinite integral and definite integral. If we
can find an anti-derivative F (x) of a f