Final Exam, Math 151A/2, Winter 2001, UCLA, 03/21/2001, 8am-11am I. (a) Let x0 , x1 , ., xn be n + 1 distinct points in [a, b], with x0 = a and xn = b, and f C n+1 [a, b]. Let P (x) = P0,1,.,n(x) be the Lagrange polynomial interpolating the points x0 , x1
r n l n i r n VU n V#i l rm mdj~ ~j r n l n i n m n ~ n U#i r d md n jml n l n i j n V V n x Fv us ~l lm mmmr ~d~ t r q jd l jld dlj n j ~ ~ n i kUV #kUl n # n i #x e u v y v SVv Uv Ug v v u t x t t u v t t u u v x v tVk y wv t 3 y Y y f f n p f p l y p n
Lecture 6: Fixed-point Iteration and Newtons Method
1
Fixed-point iteration
Find fixed point of g(x), i.e., g(p) = p.
(1) Choose an initial guess p0 .
(2) Generate cfw_pn = g(pn1 )
n=1 . If pn p as n and g(x) is continuous, then
p = lim pn = lim g(pn1 ) =
Math 151A: Homework 6
Fall 2015
Due: Dec 2, 1pm
All your answers should be submitted in class before class begins (please show your work).
Please make sure to see both sides of this sheet.
R1
1. [30 points] Compute the approximate value of the integral 0
Math 151A: Homework 3
Fall 2015
Due: Oct 28, 1pm
All your answers should be submitted in class before class begins (please show your work).
p
1. [15 points] Show that kxk2 kxk1 nkxk2 for any vector x 2 Rn .
2. A floating point system F includes many integ
Fall 2015
Due: Oct 7, 1pm
All your answers except computer programs should be submitted in class before class begins
(please show your work). Computer programs as well as numerical results or plots generated by
your programs should be submitted to the CCL
Math 151A: Homework 4
Fall 2015
Due: Nov 4, 1pm
All your answers should be submitted in class before class begins (please show your work).
Please make sure to see both sides of this sheet.
1. (a) [15 points] Give the lower-triangular and upper-triangular
Math 151A: Homework 5
Fall 2015
Due: Nov 23, 1pm
All your answers except computer programs should be submitted in class before class begins
(please show your work). Computer programs as well as numerical results or plots generated by
your programs should
PROBLEM SET #1
MICHELLE FENG
Problem 1.
(a) Recall that the error for the bisection method can be bounded by
|pn p|
ba
2n
So if we want to get an absolute error of less than 105 , we need
ba
105 2n 105 n 14
2n
Then the minimum number of iterations requi
function x = gauss(A,b)% This function performs the Gauss elimination without
pivoting% % x = GAUSS(A, b)[n,n] = size(A); % Check for zero diagonal elementsif
any(diag(A)=0)
error('Division by zero will occur; pivoting not supported')
end% Forward elimina
/
/
/
/
/
/
/
main.cpp
lmain
Created by Danny R Silva on 11/1/16.
Copyright 2016 Danny R Silva. All rights reserved.
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
/ First Lagrange interpolation learned
double lagrange (int nu
MT414: Numerical Analysis
Homework 2
Answers
1. Let a = 0.96 and b = 0.99.
a+b
.
2
ba
(b) Using two-digit rounding arithmetic, compute a +
.
2
(a) Using two-digit rounding arithmetic, compute
a+b
?
2
Answer: (a) We compute that a + b rounds to 2.0 using t
Math 151A: Homework 2
Fall 2015
Due: Oct 14, 1pm
All your answers except computer programs should be submitted in class before class begins
(please show your work). Computer programs as well as numerical results or plots generated by
your programs should
M151A - Applied Numerical Analysis
SPRING 2015
MATH 151A - Exercise 1
This homework is due Tuesday, April 7.
Exercise 1 Reading: Section 1.2, and Matlab tutorial (www.math.ucla.edu/anderson/MDocs/index.html).
Exercise 2 A machine number with k digits of p
Lecture 2: Machine Numbers and Errors
1
Binary Machine Numbers
The standard IEEE 754-2008 defines the set of all machine numbers commonly used by computers,
F (2, 53, 1022, 1024). It uses 64-bit (binary digit) representation (also called double precision)
Lecture 3: Algorithms and Convergence
1
Ways to Reduce Roundoff Errors
I. Avoid subtraction of 2 nearly equal numbers. Reason: it causes cancelation of significant
digits. Given 2 nearly equal numbers x > y of k-digit representation:
f l(x) = 0.d1 d2 . .
Math 151A
Winter 2016
Homework 3
Due: Friday, Jan 22, 2016.
Reading: Sections 2.2, 2.3.
1. Use Fixed-point Theorem to show that if A > 0, then the sequence defined by
xn =
converges to
A whenever x0 >
1
2A
xn1 +
,
3
3xn1
for n 1,
2A.
2. Let g(x) = + 0.5 s
Lecture 4: Bisection Method
1
Convergence Rate (cont.)
Definition 1. Let lim F (h) = L, lim G(h) = 0. If there exists K > 0 such that
h0
h0
|F (h) L| K|G(h)|
for sufficiently small h, then we write F (h) = L + O(G(h).
Remark: G(h) is usually chosen as hp
Lecture 5: Fixed-point Iteration
1
Bisection Method (cont.)
Theorem 1. Suppose that f C[a, b] and f (a)f (b) < 0. Then the sequence cfw_pn
n=1 generated by
the Bisection method approximates a zero p of f (x) with
|pn p|
ba
,
2n
n 1.
Moreover, pn = p + O
Math 151A
Winter 2016
Homework 4
Due: Friday, Jan 29, 2016.
Reading: Sections 2.4 & 2.5.
Theoretical problems
1. Let f C 2 [a, b]. If p (a, b) such that f (p) = 0 and f 0 (p) 6= 0. Show that Newtons method satisfies
|p pn+1 |
n
M
|p pn |2 ,
2|f 0 (pn )|
Lecture 1: Course Overview and Machine Numbers
1
Introduction
In this course, we will learn
1. How to represent numbers and do arithmetic on a computer? Concepts of error, and how to
track and control it? (Chap 1)
2. Algorithms to solve one-dimensional no
Lecture 8: Convergence Order and Multiple Roots
1
Convergence Order (Cond.)
Theorem 1. Let g(x) C[a, b] such that g(x) [a, b] for any x [a, b]. Suppose that g C 1 (a, b)
and 0 < k < 1 exists with |g 0 (x)| k for any x (a, b). If g 0 (p) 6= 0, then for any
Math 151A
Winter 2016
Homework 2
Due: Friday, Jan 15, 2016.
Reading: Sections 1.3, 2.1.
Theoretical problems:
1. Suppose that 0 < q < p and that n = + O(np ). Show that n = + O(nq ).
2. Let f (x) = (x 1)10 , p = 1 and pn = 1 + 1/n. Show that |f (pn )| <
Lecture 7: Convergence Order
Example 1. Let f (x) = x2 3. Use Newtons Method to find a root of f within accuracy 108 .
Solution. By Newtons method, we generate a sequence defined by
pn = pn1
p2n1 3
.
2pn1
Let p0 = 1.5. By direct computation, we get p3 =
Math 128A Spring 2002
Sergey Fomel
Handout # 13
February 26, 2002
Answers to Homework 4: Interpolation: Polynomial Interpolation
1. Prove that the sum of the Lagrange interpolating polynomials
Y x xi
L k (x) =
xk xi
(1)
i6=k
is one:
n
X
L k (x) = 1
(2)
k=
2.1 The Bisection Method
1
Basic Idea
Suppose function () is continuous on [, ],
and (), () have opposite signs.
By the Intermediate Value Theorem (IVT),
there must exist an in (, ) with = 0.
Bisect (sub)intervals and apply IVT repeatedly.
2
The seque
% Assignment 2 #6
% Solution by Denali Molitor
% Consider the function f(x)=|x| on [-1,1].
clear all
close all
% (a) Plot the graph of f
x = linspace(-1,1,101);
figure(1)
plot(x,abs(x)
title('Graph of f(x) = |x|')
% (b)
figure(2)
plot(x,abs(x),'k') % plot
UCLA MATH 151A, WINTER 2000, MIDTERM, FRIDAY, FEBRUARY 9
NAME STUDENT ID # This is a closed-book and closed-note examination. No calculators are allowed. Please show all your work. Partial credit will be given to partial answers. There are 2 problems of t
UCLA MATH 151A/2, WINTER 2007, MIDTERM EXAM
NAME STUDENT ID # This is a closed-book and closed-note examination. No calculators are allowed. Please show all your work. Partial credit will be given to partial answers. There are 5 problems of total 100 poin
UCLA MATH 151A/3, Monday October 29, 2001 MIDTERM EXAM
NAME STUDENT ID # This is a closed-book and closed-note examination. Please show all your work. Partial credit will be given to partial answers. There are 4 problems of total 100 points. PROBLEM SCORE
Applied Numerical Methods
(MATH 151A-Lecture 4, Fall 2016)
Assignment 3
Note:
Due day: 2:50 p.m., 7th November (Monday). Assignments handed after the due date
will not be counted. Please finish all the questions.
1. (a) Let f (x) = 1/x, xi = i + 1, 0 i 2
Applied Numerical Methods
(MATH 151A, Fall 2016)
Assignment 4
Note:
Due day: Discussion section, 27th October (Thursday). Assignments handed after the
due date will not be counted.
1. (a) Use the Lagrange interpolation method to find a polynomial f such
Applied Numerical Methods
(MATH 151A, Fall 2016)
Assignment 2
Note:
Due day: Discussion section, 13th October (Thursday). Assignments handed after the
due date will not be counted.
1. Given the following sequence cfw_pn
n=0 :
(
pn+1 =
p2n +1
2pn +1
p0 i
Applied Numerical Methods
(MATH 151A, Fall 2016)
Assignment 3
Note:
Due day: Discussion section, 20th October (Thursday). Assignments handed after the
due date will not be counted.
1. Given that each of the following sequences cfw_pn
n=0 converges to p
Applied Numerical Methods
(Math 151A Lecture 4 - Fall 2016) Homework 1 Solutions
Bisection Method
Answer to 1:
(a)For n 1,
1
pn = (an + bn ).
2
Then
ba
1
|pn p| (bn an ) = n .
2
2
So the method converges with rate of convergence O
1
2n
.
(b) We want
1
2n+