Homework 5 solutions

Similar documents
Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

Matrices and Determinants

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Chapter 5 Determinants

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio.

The Islamic University of Gaza Faculty of Engineering Civil Engineering Department. Numerical Analysis ECIV Chapter 11

Ecuaciones Algebraicas lineales

Operations with Matrices

Determinants Chapter 3

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Introduction to Determinants. Remarks. Remarks. The determinant applies in the case of square matrices

MATRICES AND VECTORS SPACE

The Algebra (al-jabr) of Matrices

Here we study square linear systems and properties of their coefficient matrices as they relate to the solution set of the linear system.

4.5 JACOBI ITERATION FOR FINDING EIGENVALUES OF A REAL SYMMETRIC MATRIX. be a real symmetric matrix. ; (where we choose θ π for.

Module 6: LINEAR TRANSFORMATIONS

1 Linear Least Squares

Chapter 2. Determinants

Matrix Solution to Linear Equations and Markov Chains

HW3, Math 307. CSUF. Spring 2007.

LINEAR ALGEBRA AND MATRICES. n ij. is called the main diagonal or principal diagonal of A. A column vector is a matrix that has only one column.

A - INTRODUCTION AND OVERVIEW

The Solution of Linear Systems AX = B

Matrices 13: determinant properties and rules continued

Lecture Note 9: Orthogonal Reduction

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Matrices, Moments and Quadrature, cont d

Autar Kaw Benjamin Rigsby. Transforming Numerical Methods Education for STEM Undergraduates

Things to Memorize: A Partial List. January 27, 2017

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

INTRODUCTION TO LINEAR ALGEBRA

Contents. Outline. Structured Rank Matrices Lecture 2: The theorem Proofs Examples related to structured ranks References. Structure Transport

Introduction To Matrices MCV 4UI Assignment #1

Lecture 19: Continuous Least Squares Approximation

September 13 Homework Solutions

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24

Math 211A Homework. Edward Burkard. = tan (2x + z)

Linear Algebra Introduction

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Chapter 3 MATRIX. In this chapter: 3.1 MATRIX NOTATION AND TERMINOLOGY

Lecture Solution of a System of Linear Equation

Operations with Polynomials

On the free product of ordered groups

GAUSS ELIMINATION. Consider the following system of algebraic linear equations

Identify graphs of linear inequalities on a number line.

a a a a a a a a a a a a a a a a a a a a a a a a In this section, we introduce a general formula for computing determinants.

CHAPTER 2d. MATRICES

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics

ntegration (p3) Integration by Inspection When differentiating using function of a function or the chain rule: If y = f(u), where in turn u = f(x)

Can the Phase I problem be unfeasible or unbounded? -No

Convert the NFA into DFA

First Midterm Examination

308K. 1 Section 3.2. Zelaya Eufemia. 1. Example 1: Multiplication of Matrices: X Y Z R S R S X Y Z. By associativity we have to choices:

CSE 160 Lecture 13. Numerical Linear Algebra

Math 270A: Numerical Linear Algebra

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

8 Laplace s Method and Local Limit Theorems

Lecture 14: Quadrature

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

Scientific notation is a way of expressing really big numbers or really small numbers.

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

OXFORD H i g h e r E d u c a t i o n Oxford University Press, All rights reserved.

Pre-Session Review. Part 1: Basic Algebra; Linear Functions and Graphs

DETERMINANTS. All Mathematical truths are relative and conditional. C.P. STEINMETZ

ECON 331 Lecture Notes: Ch 4 and Ch 5

Why symmetry? Symmetry is often argued from the requirement that the strain energy must be positive. (e.g. Generalized 3-D Hooke s law)

Problem Set 9. Figure 1: Diagram. This picture is a rough sketch of the 4 parabolas that give us the area that we need to find. The equations are:

N 0 completions on partial matrices

New data structures to reduce data size and search time

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

We will see what is meant by standard form very shortly

Matrix Eigenvalues and Eigenvectors September 13, 2017

ODE: Existence and Uniqueness of a Solution

SOLVING SYSTEMS OF EQUATIONS, ITERATIVE METHODS

Chapter 3 Polynomials

Multivariate problems and matrix algebra

Computing The Determinants By Reducing The Orders By Four

2.1 Gaussian Elimination

M344 - ADVANCED ENGINEERING MATHEMATICS

2.4 Linear Inequalities and Interval Notation

Monte Carlo method in solving numerical integration and differential equation

ENGI 3424 Engineering Mathematics Five Tutorial Examples of Partial Fractions

Numerical Methods for Chemical Engineers

Matching patterns of line segments by eigenvector decomposition

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

Stability of block LDL T factorization of a symmetric tridiagonal matrix

Numerical Methods (CENG 2002) CHAPTER -III LINEAR ALGEBRAIC EQUATIONS. In this chapter, we will deal with the case of determining the values of x 1

CS434a/541a: Pattern Recognition Prof. Olga Veksler. Lecture 2

Polynomial Approximations for the Natural Logarithm and Arctangent Functions. Math 230

AQA Further Pure 2. Hyperbolic Functions. Section 2: The inverse hyperbolic functions

Elements of Matrix Algebra

Minimal DFA. minimal DFA for L starting from any other

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

A-Level Mathematics Transition Task (compulsory for all maths students and all further maths student)

THE DISCRIMINANT & ITS APPLICATIONS

Interpreting Integrals and the Fundamental Theorem

Lecture 3. Limits of Functions and Continuity

Transcription:

Section.: E ; AP, Section.: E,,; AP,,, Section. Homework solutions. Consider the two upper-tringulr mtrices: b b b A, B b b. b () Show tht their product C = AB is lso upper-tringulr. The product is b b b b b b C AB b b b, b which is upper-tringulr. (b) Let A nd B be two n by n upper-tringulr mtrices. Show tht their product is lso upper tringulr. If A nd B re upper-tringulr, then ij, b ij = if i > j. The element in the ith row, jth column of the product C = AB is c ij n k ik b kj k i The ik terms in the first sum on the RHS re ll zero since i > k. If i > j, then in the second sum k i > j, so ll the b kj terms re zero. Therefore, the entire sum is zero when i > j, nd C is upper-tringulr. ik b kj ki ik b kj.

Algorithms nd Progrms. Construct forwrd substitution lgorithm to solve the liner system AX = B when A is lower-tringulr. function X=forsub(A,B) %Input - A is n n n lower-tringulr nonsingulr mtri % - B is n n mtri %Output - X is the solution to the liner system AX = B %Find the dimension of B nd initilize X n=length(b); X=zeros(n,); X()=B()/A(,); for k=:n X(k)=(B(k)-A(k,:(k-))*X(:(k-)))/A(k,k); end. Use forsub to solve the system LX = B, where i j i j l ij, nd b i = i. i j The result of forsub(l,b) is X = (.,.,.,.,.77,.78,.8,.,.7,.77,.888,.7787,.8,.,.8,.,.7,.77877,.778.8)

Section. nd : Show tht AX = B is equivlent to the upper-tringulr system UX = Y, nd find the solution.. Subtrct ½ times the st row from the second, nd ½ times the st row from the rd to get 7 Subtrct / times the nd row from the rd to get UX = Y. Solving this system by bcksubstitution yields = -, =, =... Subtrct times the first row from the nd, times the st row from the th to get Subtrct - times the nd row from the rd nd times the nd row from the th to get 7 Subtrct -7/ times the rd row from the th nd multiply the th row by to get UX = Y. Solving this system by bck-substitution yields =, =, =, = -.

. () Solve AX = B, where A is the by Hilbert mtri ij = /(i+j-) nd B = (,,, ). Gussin elimintion yields =, = -, =, = -. (b) Now solve AX = B using four digit rithmetic nd the pproimte Hilbert mtri........ A....7...7. Solving by Gussin elimintion using digit rithmetic yields = 8.7, = -., =., = -8..

Algorithms nd Progrms. Construct progrm tht will solve tridigonl system of the form d + c = b + d + c = b + d + c = b. N- N- + d N- N- + c N- N = b N- N- N- + d N N = b N Assume tht row interchnges re not needed nd tht row k cn be used to eliminte k in row k+. The tridigonl system cn be solved with the stndrd Gussin elimintion lgorithm. But, it cn be solved much more efficiently if we use the fct tht t the pth step, only one term, p+,p p needs to be eliminted. The bck-substitution lgorithm cn lso be mde more efficient if we use the fct tht fter upper-tringulriztion, only elements on the digonl nd one step bove it re non-zero. The following is n emple of code tht does Gussin elimintion on the tridigonl system. Note tht this cn be mde even more efficient if we store only the digonl nd off-digonl elements insted of the entire mtri A. function X = tridig(a,b) %Input - A is n N N tri-digonl mtri % - B is n N mtri %Output - X is n N mtri contining the solution to AX=B. %Initilize X nd the temporry storge mtri C [N N]=size(A); X=zeros(N,); C=zeros(,N+); %Form the ugmented mtri: Aug=[A B] Aug=[A B]; for p=:n- %Elimintion process for column p m=aug(p+,p)/aug(p,p); Aug(p+,p:N+)=Aug(p+,p:N+)-m*Aug(p,p:N+); end %Bck Substitution on [U Y] using Progrm. X=bcksubtridig(Aug(:N,:N),Aug(:N,N+)); function X=bcksubtridig(A,B) %Input - A is n n n nonsingulr mtri with non-zero elements % on the digonl nd the k,k+ entries % - B is n n mtri %Output - X is the solution to the liner system AX = B %Find the dimension of B nd initilize X n=length(b); X=zeros(n,); X(n)=B(n)/A(n,n); for k=n-:-: X(k)=(B(k)-A(k,k+)*X(k+))/A(k,k); end

. Use the Gussin elimintion progrm with prtil pivoting to solve the system AX = B, where ij = i j-, b =, nd b i = (i N )/(i ) for i >. The ect solution is X = (,,,,). Eplin ny devitions from the ect solution. The uptrbk progrm produces the ect solution for N= nd N=7. When N =, it produces.7.8877.7.77. X.787.8.7..87.88 which hs miml error of.7e-. The error results from roundoff when lrge numbers re dded to smll numbers. This occurs when elements below the pivot re much lrger thn the elements in the corresponding row. When N is smll, this error is smll, since the difference between row elements is not too lrge. But s N increses, this difference increses, nd prtil pivoting lone will led to errors.. Construct progrm tht chnges the pivoting strtegy in the Gussin elimintion progrm to scled prtil pivoting. In scled prtil pivoting, t step p we interchnge the pivot row with the row below it tht hs the miml rtio of kp to the lrgest element in the kth row. This cn be implemented by replcing the following lines in the uptrbk code % Prtil pivoting for column p [Y,j]=m(bs(Aug(p:N,p))); with these: % Scled prtil pivoting for column p s=zeros(n-p+,); for k=p:n s(k-p+) = min(bs(aug(k,p)./aug(k,p+:n))); end; [Y,j]=m(s); It first loops through rows p to N to find the rtios of kp to the miml element in row k, then finds the row with the miml such rtio.. Use your scled prtil pivoting progrm from Problem to solve the system given in Problem for N =. Eplin ny improvements in the solution.

The scled prtil pivoting strtegy produces the ect solution when N =. The reson the scled prtil pivoting strtegy does better is tht it voids s much s possible subtrcting smll numbers from much lrger numbers. Note tht Mtlb s built in liner solver A\B produces the solution.87.887.88.878.8878 X.87.8.788..8.7 which hs miml error of.7e-. The scled prtil pivoting scheme does better thn Mtlb s solver.