HW-3
1. Use the Matlab program in sakai that implements the fixed point iteration method x(k+1)=g(xk)
k=1,2, with a stopping criterion, the |xk-x(k-1)|<tol, and a max number of iterations
kmax. Then solve the equation f(x)=x2-3x+2 by using the following i
HW-3
1. Use the Matlab program in sakai that implements the fixed point iteration method x(k+1)=g(xk)
k=1,2, with a stopping criterion, the |xk-x(k-1)|<tol, and a max number of iterations
kmax. Then solve the equation f(x)=x2-3x+2 by using the following i
Problem 1
diff = divdif([-2, -1, 0, 1, 2, 3], [-5, 1, 1, 1, 7, 25])
diff =
-5
6
-3
1
0
0
P3(x)= -5 + 6*(x+2) 3*(x+2)(x+1) + (x+2)(x+1)x
Problem 2
In all the plots, the f(x) is plot as blue solid line; the interpolation (n points) are denoted as blue *; th
HW-6
1. The following Program computes the L and U decomposition of a matrix i.e A=LU using a
row-wise access of the data. If we interchange the loops i with j, we get the well-known
column-wise access LU decomposition, also known as the kji form.
i.
Writ
CS510
Test 1
March 29, 1990
Instructions: Do all your work in the blue examination booklets. Answer questions IN
SEQUENCE. You may refer to books and notes - otherwise all work is your own. It is
important to show ALL your work. You will get little or no
CS 510
Homework 4
Dec 6, 2012
These are PRACTICE PROBLEMS for your own benet. However if you solve any (*) questions and
hand in solutions by class on Tuesday, Dec. 11, 2012, you may get a little extra HW credit.
1. (*) You are given points (1, 1), (1/2,
HW-2
1. Taylors polynomial approximating a function is defined as follows
() = () +
=1
() =
() ()( )
!
+1
( )
() (),
, .
( + 1)!
() = () + ().
The tangent line at the point 0 is the first degree Taylors polynomial 1 () = (0 ) +
(0 )( 0 ) that has a
Problem3
3. MATLAB program:
function [interval,result,error] = trapezoidal(a,b,n0,index)
format long e
result = zeros(8,1);
error = zeros(8,1);
interval = zeros(8,1);
sum =0;
border = (f(a,index)+f(b,index)/2;
h=(b-a)/n0;
for k=2:2:n0-2;
sum = sum + f(a+k
Problem 1
1.
function [ result ,error] = fun( z,a,n )
declares a function named fun that accepts inputs z,a,n, and returns outputs result and error.
syms x real
creates a symbolic variable x that belongs to the set of real number.
f=sin(x)
defines the for
Problem 1
2. a.
for j=-2:0.25:2.25
index=int32(4*(j+2)+1);
[root, error, it_count] = newton(j, 1.0E-12,20,1);
result(index)=root;
err(index)=error;
itera(index)=it_count;
end
initial=-2:0.25:2.25;
fid=fopen('HW_1_1.txt','w');
fprintf(fid, '\n', 'x0
root
e
CS 323: Homework Solutions 1
Due on 2/11/2014
Apostolos Gerasoulis
Vilelmini Kalampratsidou
Contents
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
1
1
1
1
1
2
3
4
5
(Question
(Question
(Question
(Question
(Question
. . . . . .
.
CS 510: Homework 8
Due on December, 8, 2013
A. Gerasoulis 3:00 pm
Chetan Tonde
Contents
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
1 . . .
2 (a) .
2 (b) .
2 (c) .
2 (d) .
HW-2 with solutions
1. Taylors polynomial approximating a function is defined as follows
( )
( )
(
( )
i.
ii.
( )
)
(
( )
)
( )
( )(
)
( )
( )
( )
( )
The tangent line at the point
is the first degree Taylors polynomial ( )
( )
( )(
) that has as a root t
HW-7
1. For a symmetric matrix A, is it always the case that |A|1= |A| ? Prove it or disprove it.
2. True or False with a Proof: If A is any n x n matrix and P is any permutation matrix of the same
size then (a) PA=AP (b) PA=APT
(c) PPT = P (d) PTP=I
3. (
HW-1
1. Taylors polynomial approximating a function is defined as follows
() = () +
=1
() =
() ()( )
!
+1
( )
() (),
, .
( + 1)!
() = () + ().
Matlab can implement the above approximation using a combination of symbolic computation
and classical pr
HW-5
1.
Another form of the error for Trapezoidal rule can be given by The General Euler
McLaurin formula is defined by ,
() = ( ) + 1 () + ()
=0
=1
2 2 (21)
() (21) () +
(
(2)!
Where the Bernoulli numbers are given by
1
1
1
1
1
1 = 2 , 2 = 6 , 3 = 0,
HW-4
1. The following data are taken from a polynomial () of degree 5. What is the polynomial and what
is its degree.[Use Newtons method]
x
-2
-1
0
1
2
3
p(x)
1
1
7
25
-5
1
2. Matlab has built in functions for computing and evaluating interpolation C=poly
CH
CS 510 Homework 3 Dec. 2, 2016
(*) questions due by Thursday, Dec. 15, 2016.
(+) questions are optional, no deduction if omitted, small potential extra credit if answered.
Unmarked questions [no *, no +] are just for practice.
(*) Let f denote a differ
C8323 Review Sheet 4 May 3, 2004
(Modied for CS510) Nov. 28, 2016
Numerical Differentiation and Integration
We are given a function f. The rst problem is to nd f (:5), the derivative of f at a given point,
x. The second is to nd INT E f: f (x)dx, the inte
C
S
5
1
0
T
e
s
t
1
October 30, 1990
Instructions: Do all your work in the blue examination booklets. Answer questions IN
SEQUENCE. You may refer to books and notes - otherwise all work is your own. It is
important to show ALL your work. You will get litt
C
S
5
1
0
T
e
s
t
2
May 11, 1990
Instructions: Do all your work in the blue examination booklets. Answer the questions IN
ORDER. You may refer to books and notes - otherwise all work is your own. It is important to
show ALL your work. You will get little
Chapter 2
Sources of Error
3
4
CHAPTER 2. SOURCES OF ERROR
In scientific computing, we never expect to get the exact answer. Inexactness
is practically the definition of scientific computing. Getting the exact answer,
generally with integers or rational n
CSC165H, Mathematical expression and reasoning
for computer science
week 12
22nd December 2005
Gary Baumgartner and Danny Heap
heap@cs.toronto.edu
SF4306A
416-978-5899
http:/www.cs.toronto.edu/~heap/165/S2005/index.shtml
Rounding
Most numbers are not exac
CS 510 Homework 1 Sept 29, 2016
Due Oct. 11. 2016
Write up clear answers to the following. Explain your reasoning. Many of these questions are completely
routine, but some are more substantial. (*) is an optional7 possibly harder question. You may discuss
198:510 Numerical Analysis, FALL 2016
Instructor: W. Steiger Hill 417 4457293 steigerrrutgers.edu
TA: Abdul Basit Hill 414 abasit@cs.rutgers.edu
o Oice Hours: Tuesday and Thursday, after class
a Course Homepage: http:/www.cs.rutgers.edu/~steiger/cs510.htm