CSC 349 Assignment 1
Brandt Melville V00816266
1. A)
function Euler(m,c,g,t0,v0,tn,n)
% print headings and initial conditions
0printf('values of t approximations v(t)\n')
0printf('%8.3f',t0),fprintf('
Assignment 4 V00816266 Brandt Melville
March 6, 2017
7:33 PM
function p = PolyEval( n, a, y, x )
b(n+1) = a(n+1);
for i = n:-1:1
b(i) = a(i) + b(i+1)*(x+y(i);
end
p = b(1);
end
> a = [ -1, 0, 2.33, -1
CSC 349A PRACTICE MIDTERM EXAM
There are 5 questions of equal value. Time allowed 75 minutes. Question 1. (a) (12 marks) Compute the Taylor polynomial of degree 3 for the function f(x) = (1 + x)3/2 ex
COMPUTER SCIENCE 349A
SAMPLE EXAM QUESTIONS WITH SOLUTIONS
PARTS 3, 5, 6 , 7
PART 3.
3.1
Suppose that a computer program, using the Gaussian elimination algorithm, is to
be written to accurately solve
Taylor's Theorem:
f x f
n
f x0
f x0 x x0
n
'
f ' x0 x x0 2! x n x x0 1 !
2
.
Solution: f(x) = [x - (x-1)] x (x + (x-1) / (x - (x-1)= 1 / (x + (x-1) Let f(x) = [(sin(x) - ex) + 1] / x2, x 0, x in radia
("1
Question 1. /! VOL ( / 9 9 6
(a) (12 marks) .
Derive the: Taylor poiynemiai of degree 3 for the functionx) = (14-30 mam about x0 x: 0.
I 3 a
We. ()4) 17:. £033 + x-$(a)+,§¥i(a}+ i$"(e)
3.
£00 3 C
%
$
"
8 d
#
e
$
"
Y
%
$ d
) 1
S q
S
S
S ' e
e q 1
S ' 1 q
S 1 ' q 1
S q q q 1
0
1 q
S q
S q 0
1 q
S
S q
e
S
S q '
S
T ) & # w P A 4 ( V 4 ( 4
S ) 4 h f V f V h x 4 y 2 6
d 2
U 5 6 4
COMPUTER SCIENCE 349A
SAMPLE EXAM QUESTIONS WITH SOLUTIONS
PARTS 1, 2
PART 1.
1.1
(a) Define the term ill-conditioned problem.
(b) Give an example of a polynomial that has ill-conditioned zeros.
1.2
C
Name: _ Please Print Instructor: Dr. F. Roberts
Perm. Reg. No. _
UNIVERSITY OF VICTORIA PRACTICE FINAL EXAMINATION COMPUTER SCIENCE 349A
Question 1 2 3 4 5 6 7 8 9 10 Total Instructions : This is a 3
COMPUTER SCIENCE 349A SAMPLE EXAM QUESTIONS WITH SOLUTIONS CHAPTER 1.
1.1 (a) Define the term "ill-conditioned problem". (b) Give an example of a polynomial that has ill-conditioned zeros. 1.2 Conside
However, if evaluated in floating-point arithmetic, these expressions may give very
different results due to subtractive cancellation.
In thefollowing, no justification for your answers is required. J
COMPUTER SCIENCE 349A
SAMPLE FINAL EXAM QUESTIONS WITH SOLUTIONS
1.
(a) For what values of the real variable x , where x > 1 , is the following
expression subject to subtractive cancellation that will