HW1
1. Taylors polynomial approximating a function is defined as follows
( )
( )
(
( )
( )(
)
)
( )
( )
)
( )
( )
( )
Use the Matlab symbolic computation functions: syms x; diff(f,x,j), to derive the
derivatives manually first and then the Taylor polynom
CS 323 Homework Solutions
Due: 02/16/2015
I. f (x) = x3 + x2 1 = 0.
(i) f (0) = 1 < 0, f (1) = +1 > 0 = sign change over [0, 1] = theres a root
x [0, 1].
Uniqueness of x: follows from fact that f (x) is an increasing functions of x (f 0 (x) =
3x2 + 2x > 0
CS 323 Computer Problem: Polynomial Least Squares Approximation  due
3/30/15
In this assignment, you are asked to write a Matlab program which fits an arbitrary set of points
(xk , yk ), k = 1, . . . , m
in the least squares sense by a polynomial of give
CS 323 Computer Problem: Polynomial Interpolation  due 4/15/15
Write a Matlab function
function fz = interp(x,f,z)
which takes vectors x, f of data points:
(x1 , f1 ), (x2 , f2 ), ., (xn+1, fn+1 ),
determines the corresponding interpolating polynomial pn
PageRank  Page, Brin (1998)
View web as directed graph G
 nodes of G represent web pages cfw_P1 , ., Pn; n 1 trillion = 1012 .
 edges of G denote links from one web page to another.
Example 1:
n = 4, edges: cfw_12, 24, 31, 32, 34, 43
Random walk experi
CS 323 Computer Problem: Solution of Nonlinear Equations
due February 25, 2015
The objective of this assignment is to write a general MATLAB program for computing real roots
of polynomials via Newtons method, and then apply it to a particular polynomial.
waht is objective of database design?
avoid redundancys and update anomolies
there are more superkeys than keys
Lamar Alexander (RTenn.): $23,426
Kelly Ayotte (RN.H.): $7,450
John Barrasso (RWyo.): $21,489
Roy Blunt (RMo.): $1,439,902
John Boozman (R
Kapil Srinivas Jayaraman kj184
Hiren Patel hkp35
Timing and Analysis
The purpose of this analysis is to witness and comprehend the performance similarities and differences
between the thread and process version of the modified RLE compression. Each sectio
README
Hiren Patel hkp35
Kapil Srinivas Jayaraman kj184
The goal of this assignment was to create a program that allows us to compare multithreading and
multiprocessing. To compare the similarities and differences we used a RLE algorithm to compress
str
Recitation 5 handout
Solving a system of linear equations
Introductory example
Manual elimination and substitution
Order of elimination vs substitution
Count of elimination
Automation structure
Matrices: mathematically
Matrices: numerically (implementatio
Readme file
Nishtha Sharma
Hiren Patel
Election Final Project 336

Our project is Senator Voting Record Database. It grabs information
a citizen may want to know about their senator and how they vote on
particular bills. It helps agregate data which wou
function root = iteration(x0,error_bd,max_iterate,index_f)
format short e
error = 1;
it_count = 0;
while abs(error) > error_bd & it_count <= max_iterate
gx = g(x0,index_f);
%
%
x1 = gx;
error = x1  x0;
Internal print of newton method. Tap the carriage
re
function root = newton(x0,error_bd,max_iterate,index_f)
%
% function newton(x0,error_bd,max_iterate,index_f)
%
% This is Newton's method for solving an equation f(x) = 0.
%
% The functions f(x) and deriv_f(x) are given below.
% The parameter error_bd is u
HW4
1. The following Program computes the L and U decomposition of a matrix i.e A=LU using a
rowwise access of the data. If we interchange the loops i with j, we get the wellknown
columnwise access LU decomposition, also known as the kji form.
i.
Writ
SOLVING LINEAR SYSTEMS
We want to solve the linear system
a1;1x1 +
an;1x1 +
+ a1;nxn = b1
.
+ an;nxn = bn
This will be done by the method used in beginning
algebra, by successively eliminating unknowns from
equations, until eventually we have only one equ
function [ result ,error] = taylor( z,a,n )
syms x real;
0=exp(x)*sin(x);
f=exp(x);
sum=subs(f,'x',a);
prod=1;
for j=1:n
prod=prod*(za)/j;
sum=sum+prod*subs(diff(f,x,j),'x',a);
end
format long
result=double(sum);
error=double(abs(resultsubs(f,'x',z);
en
Additional problems + solutions
I. In Romberg integration, we kept doubling the number of subintervals and getting new
trapezoidal rule approximations to a given integral I. Suppose instead of doubling, we
repeatedly triple the number of subintervals.
(i)
Recitation 6 Handout
LU decomposition
Given:
A: a square n x n matrix
b1, b2, ., bm: m nx1 vectors.
Required:
x1, x2, ., xm: the m unknown nx1 vectors corresponding to the given m freeterm nx1 vectors
b1, b2, ., bm.
Solution I:
1. Do forward elimination
Recitation 4
Root finding revision
Bisection method
Formula
Technique
Error
Convergence
Newton method
Formula
Technique
Error
Convergence
Secant method
Formula
Technique
Error
Convergence
Comparison
Newton error analysis
Why it is interesting
Proof
Method
Recitation 1
Wednesday Jan the 25th, CS323.
Mohamed Abdellatif
Agenda
Introduction
Approximating a function
Geometric meaning
Analytical meaning
Matlab examples
Agenda
Introduction
Approximating a function
Geometric meaning
Analytical meaning
Matlab examp
Recitation 2
Wednesday Feb the 2nd, CS323.
Mohamed Abdellatif
Agenda
Goals and skills.
Computing symbolically vs numerically.
Functions derivatives symbolically.
Functions derivatives Matlab demo.
Function evaluation.
Function evaluation symbolically.
Exa
CALCULATION OF FUNCTIONS
Using hand calculations, a hand calculator, or a computer, what are the basic operations of which we are
capable? In essence, they are addition, subtraction,
multiplication, and division (and even this will usually
require a trunc
\O‘h‘x quz. L .
QU '2‘ 1 LastNamemFirstName
1. Taylor’s polynomial approximating a function is defined as follows
_ n fUJ(a)(x 601'
Pntx) —f(a)
nx — (n+1)! f , a_x_ﬁ,an a_,u_x.
f (x) = Pan) + Rn(x)‘
i. Find the Taylor’s polynomial and error for f(x) =
——_ﬁﬂ.—_4
QU 3 Last Name  «First Name  
1. We want to solve Ax=b. Solve the system by using Gaussian elimination with pa rtiai pivoting for
3 1 0 3
14:1 3 1. ll: 0
O 1 2 —2
the following linear systems:
i. What is the one norm “All1 =
\0 ii. What is t
CS 323 Homework  due 2/4/15
I. On a machine which rounds and has floating point numbers characterized by = 10,
n = 5, m = 40, M = 40:
(i) How would the following numbers be approximated: (a) 6.0221367 1023 (Avogadros number) (b) 9.1093897 1028 (the mass
function [ xnext] = falseposition( a,b,tol)
xnext=a(ba)*f(a)/(f(b)f(a);
while abs(f(xnext)>tol
if f(xnext)*f(b)<0
a=xnext;
else
b=xnext;
end
xnext=a(ba)*f(a)/(f(b)f(a);
end
end
function val=f(x)
val=x^21;
end