Math 414 Lecture 1. Reading assignment: Text: Pages 1-29 and Scilab Users Guide: Sections 1-3.

Similar documents
Solutions to Exam I MATH 304, section 6

MATH 2331 Linear Algebra. Section 2.1 Matrix Operations. Definition: A : m n, B : n p. Example: Compute AB, if possible.

Applied Matrix Algebra Lecture Notes Section 2.2. Gerald Höhn Department of Mathematics, Kansas State University

3.4 Elementary Matrices and Matrix Inverse

Math Linear Algebra Final Exam Review Sheet

Math 3C Lecture 20. John Douglas Moore

1 Last time: inverses

Math 22AL Lab #4. 1 Objectives. 2 Header. 0.1 Notes

Lecture 1 Systems of Linear Equations and Matrices

February 20 Math 3260 sec. 56 Spring 2018

Fall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop

Chapter 8: Linear Algebraic Equations

Lecture Notes in Linear Algebra

INVERSE OF A MATRIX [2.2]

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

Solving Linear Systems Using Gaussian Elimination

In this LAB you will explore the following topics using MATLAB. Investigate properties of the column space of a matrix.

The following steps will help you to record your work and save and submit it successfully.

Math 54 HW 4 solutions

Introduction to Matlab

1 Last time: linear systems and row operations

Math 344 Lecture # Linear Systems

ORIE 6300 Mathematical Programming I August 25, Recitation 1

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

1. Let m 1 and n 1 be two natural numbers such that m > n. Which of the following is/are true?

Homework Set #8 Solutions

Lecture 2 Systems of Linear Equations and Matrices, Continued

The matrix will only be consistent if the last entry of row three is 0, meaning 2b 3 + b 2 b 1 = 0.

MATH 323 Linear Algebra Lecture 12: Basis of a vector space (continued). Rank and nullity of a matrix.

1 Last time: determinants

Glossary of Linear Algebra Terms. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

18.06 Problem Set 3 - Solutions Due Wednesday, 26 September 2007 at 4 pm in

Matrix equation Ax = b

Chapter 2 Notes, Linear Algebra 5e Lay

22A-2 SUMMER 2014 LECTURE 5

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

Handout 1 EXAMPLES OF SOLVING SYSTEMS OF LINEAR EQUATIONS

Math 2174: Practice Midterm 1

Chapter 1 Linear Equations. 1.1 Systems of Linear Equations

Lecture 6 & 7. Shuanglin Shao. September 16th and 18th, 2013

1 Determinants. 1.1 Determinant

MATH 2360 REVIEW PROBLEMS

Math 314 Lecture Notes Section 006 Fall 2006

Elementary operation matrices: row addition

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

Math 54 First Midterm Exam, Prof. Srivastava September 23, 2016, 4:10pm 5:00pm, 155 Dwinelle Hall.

Matrix operations Linear Algebra with Computer Science Application

Math Final December 2006 C. Robinson

b for the linear system x 1 + x 2 + a 2 x 3 = a x 1 + x 3 = 3 x 1 + x 2 + 9x 3 = 3 ] 1 1 a 2 a

MATH 152 Exam 1-Solutions 135 pts. Write your answers on separate paper. You do not need to copy the questions. Show your work!!!

Chapter 9: Systems of Equations and Inequalities

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

Find the solution set of 2x 3y = 5. Answer: We solve for x = (5 + 3y)/2. Hence the solution space consists of all vectors of the form

Math 314H EXAM I. 1. (28 points) The row reduced echelon form of the augmented matrix for the system. is the matrix

Review Let A, B, and C be matrices of the same size, and let r and s be scalars. Then

1. What is the determinant of the following matrix? a 1 a 2 4a 3 2a 2 b 1 b 2 4b 3 2b c 1. = 4, then det

SECTION 3.3. PROBLEM 22. The null space of a matrix A is: N(A) = {X : AX = 0}. Here are the calculations of AX for X = a,b,c,d, and e. =

Spring 2014 Math 272 Final Exam Review Sheet

Math 4A Notes. Written by Victoria Kala Last updated June 11, 2017

Math 1553 Introduction to Linear Algebra

Notes on Row Reduction

Solutions to Math 51 First Exam April 21, 2011

Section 2.2: The Inverse of a Matrix

Algorithms to Compute Bases and the Rank of a Matrix

Matrix Arithmetic. j=1

Section 3.3. Matrix Rank and the Inverse of a Full Rank Matrix

Chapter 1. Vectors, Matrices, and Linear Spaces

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Lecture Summaries for Linear Algebra M51A

EBG # 3 Using Gaussian Elimination (Echelon Form) Gaussian Elimination: 0s below the main diagonal

Chapter 1: Linear Programming

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

Announcements Wednesday, August 30

LECTURES 14/15: LINEAR INDEPENDENCE AND BASES

Second Midterm Exam April 14, 2011 Answers., and

Finite Math - J-term Section Systems of Linear Equations in Two Variables Example 1. Solve the system

Maths for Signals and Systems Linear Algebra in Engineering

Math 21b: Linear Algebra Spring 2018

Undergraduate Mathematical Economics Lecture 1

Math 3191 Applied Linear Algebra

Graduate Mathematical Economics Lecture 1

Announcements Wednesday, August 30

Miderm II Solutions To find the inverse we row-reduce the augumented matrix [I A]. In our case, we row reduce

Sections 1.5, 1.7. Ma 322 Spring Ma 322. Jan 24-28

MATH 323 Linear Algebra Lecture 6: Matrix algebra (continued). Determinants.

Linear Algebra 1 Exam 1 Solutions 6/12/3

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

MH1200 Final 2014/2015

Chapter 2: Matrix Algebra

6-2 Matrix Multiplication, Inverses and Determinants

POLI270 - Linear Algebra

INVERSE OF A MATRIX [2.2] 8-1

MATH 240 Spring, Chapter 1: Linear Equations and Matrices

MATH 2331 Linear Algebra. Section 1.1 Systems of Linear Equations. Finding the solution to a set of two equations in two variables: Example 1: Solve:

Math 33A Discussion Notes

COLUMN VECTORS a=[1;2;3] b. a(1) = first.entry of a

13. Systems of Linear Equations 1

MAT 242 CHAPTER 4: SUBSPACES OF R n

Pre-Calculus I. For example, the system. x y 2 z. may be represented by the augmented matrix

Transcription:

Math 414 Lecture 1 Homework assignments are always due at the beginning of the next lecture. Operations Research studies linear programming and associated algorithms. Businesses use it to find resource allocations and production schedules which yield maximum profit. Linear programming solves problems which can be modeled with linear equations and inequalities. Reading assignment: Text: Pages 1-29 and Scilab Users Guide: Sections 1-3. Install SciLab (or Octave ormatlab). Click SciLab on the class website www.math.hawaii.edu/414. Copy/paste the three lines of 414.txt from the webspage into a SciLab window. Select File/Change current directory. Select a directory such as My Documents. Enter: save( 414.txt ).

SCILAB NOTATION Scilab ignores capitalization: A and a are equal. For matrices A, B and real r: A+B, A-B, A/r are as expected. A*B = AB, r*a = ra. det(a) = the determinate of A. A = A T = the transpose. inv(a) = A -1 = the inverse matrix. eye(n, n) = I n = the nxn identity matrix. I 3 = [A, B] = [A B] = matrix A followed by matrix B. A(i, j) = ij th entry in A, A(i, :) = i th row, A(:, j) = j th column. [1 2 3] is the row vector 1, 2, 3 100 010 001

[3; 6; 7] is the column vector [1 2 3; 4 5 6] is the 2x3 matrix 3 6 7 123 456 How many row does [1 2 3; 4 5 6; 7 8 9] have? How many columns 123 If A = 456 789 A(2,3) =? A(2, :) =? A([2,1], :) =? In SciLab x = y doesn t mean equality, it means set x equal to y What happens to A when you enter the lines below? A(1,:)=2*A(1,:)? A(1, :)=A(1,:)-2*A(2, :)? A([1,2], :)=A([2,1], :)?

To pivot on the row 2, column 3 entry of matrix A, First load the pivot program p, by entering: load('414') Then enter: r = 2; c = 3; execstr(p) (eval(p) in Octave) `For the system of equations, The coefficient matrix =? The matrix equation =? The augmented matrix =? x column =? y column =? constant column =? r: ax + by = c s: dx + ey = f In an identity column, one entry is 1, the rest are 0. 0 1 0

DEFINITION. The tableau row operations are: v Multiply a row by a nonzero constant, v Add a multiple of one row to another row. The elementary row operations consist of the above plus v Interchange two rows. THEOREM. Applying these three row operations to the augmented matrix for a system of equations does not change the set of solutions for the system. A matrix is in tableau form if the number of independent identity columns equals the number of nonzero rows. The basic variables are those associated with the independent columns. The nonbasic variables are parameters. A subset of the variables can be made basic if its set of columns is independent. x y z x y z 014 2 000 0 103 8 tableau rref 103 8 014 2 000 0

A tableau matrix is in reduced row echelon form (rref ) if : v The 1 s of the basic variables form a decreasing line of leading nonzero entries and v Any all zero rows are at the bottom. Associated with every tableau is v A basic solution in which the parameters are zero. v A general solution writes the basic variables in terms of the parameters which are left unassigned, i.e., the parameters are arbitrary. `Suppose the variables are x, y, and z. Then the following augmented matrix is in tableau form. Rearranging the rows gives the rref form on the right. x, y the basic variables and z is nonbasic. x y z x y z 014 2 103 8 000 0 tableau rref 014 2 103 8 000 0 rref system of equations: x + 3z = 8, y + 4z = -2, 0 = 0. Basic solution: General solution: z = 0, x = 8, y = -2, z is the parameter. x = 8-3z, y = -2-4z, z is arbitrary.

To pivot on a nonzero entry in row r, column c of a matrix: Divide row r to set the entry to 1. Add/subtract multiples of row r to set the other column entries to 0. In the matrix below pivot on the r = 2; c = 1 entry. 1 3 0 (2) 4 1 2 0 1... 0 1.5 1 2.5 0 4 2 To do this in Scilab on matrix A, enter: r = 2; c = 1; execstr(p) The pivot operation produces an identity column.. TABLEAU NORMAL FORM ALGORITHM. To reduce a matrix to tableau form: Pivot on the 1 st nonzero entry in the first nonzero row. Pivot on the 1 st nonzero entry in the next nonzero row.... `Convert to tableau form. 0 1 23 0 2 4 6 8 8 8 8... 0 1 2 3 0 0 0 0 1 0 1 2

How would you do these pivots in Scilab (assuming 'P' has been loaded)? Moving the bottom row to the top and the middle row to the bottom gives the reduced row echelon form. To immediately get the rref of a matrix a, enter: rref(a) `Find the basic and general solution to 2z = -4 x + 3y + 2z = 1 x + 3y + 3z = -1 Start with the augmented matrix. Reduce it to tableau or rref form. The basic variables are those with pivot points in their columns. Write them in terms of the parameters (nonbasics). x y z x y z 0 0 2 4 1 3 2 1 1 3 3 1 augmented matrix tableau 0 0 1 2 1 3 0 5 0 0 0 0

Tableau system of equations: z = -2, x+3y = 5, 0 = 0 Basic variables: x, z. Parameter: y. Basic solution: x = 5, z = -2, y = 0. General solution: x = 5-3y, z = -2, y arb.

If the rref of an augmented matrix of a linear system were x y z The reduced 130 5 system x 3y 5 001 2 would be z 2 000 1 0 1 The last equation is impossible, thus the answer is no solutions. A is nonsingular iff det(a) = 0 iff A has an inverse. A is singular otherwise. Know the following definitions from the text or Math 311. Let v 1,..., v k be k vectors in an n-dimensional space. A linear combination of the v 1,..., v k is.... v 1,..., v k is a basis iff.... The dimension of a subspace is.... In the row-column order of a matrix, the first row s entries come first, then the second row s entries, then the third row s entries.... This is also SciLab s order.

ENTERING DATA IN SCILAB Enter: a=[1 2 3] a=[1; 2; 3] a=[0 1 2; 3 4 5; 6 7 8] a(2,2) a(2,:) a(:,2) a If you put two or more commands on the same line, separate them with ;. E.g., a(2,3)=5; a(3,2)=-1/3; r=2 To recover from errors, save a to a backup matrix z: z=a To recover a after it has been lost enter: a=z

PIVOTING First pivot on the first column using row operations. Then pivot on the second column pivot by loading and using the p program. (It has to be loaded since it is a program I wrote and is not part of Scilab.) Enter: Enter: load('414') Do this just once per session. r=2; c=2; execstr(p) a=z rref(a) a [a,eye(3,3)] rref([a,eye(3,3)]) a=[1 2 3; 3 2 1; 1 1 1] rref([a,eye(3,3)]) GETTING RATIONAL ANSWERS i.e., ½ instead of.5 Enter: a = [2.5; 6 1/3] [n,d] = rat(a) b

inv(a) is the inverse of A. The most efficient way to find inv(a) by hand involves pivoting on the augmented matrix [A I ] = [ A, eye(n, n)] to get a matrix rref([ A, eye(n, n)]) = [ I B]. If there is an all 0 row, A is singular and has no inverse. Otherwise, inv(a) = B. 1 2 3 4 `Find the inverse of a = by pivoting. [ a, eye(2)] After 1st pivot After 2nd pivot 1 2 1 0 3 4 0 1 1 2 1 0 0 2 3 1 1 0 2 1 0 1 1.5.5 The last is in rref. Thus the inverse of a is 2 1 3/2 1/2

SAVING DATA To guard against losing your work in event of a crash, periodically save your work to your disk. While in Scilab, to save your work to a file hw3, enter: save('hw3') To retrieve your work, start Scilab and enter: load('hw3') To load/save to a directory named c:\scilab enter: save('c:\scilab\hw3') load('c:\scilab\hw3') EXTRA CREDIT The first one to find an error in the lecture notes or homework gets an extra credit point. ½ point for misspellings. Note execstr(p) always works on whatever is named a. b = [1, 1; 2, 3]; r = 1; c = 1; execstr(p) won t do the desired pivot on b. If you want to do the pivot on b, copy b to a, pivot on a then copy b, a=b; r=1; c=1; execstr(p); b=a; c = a. In Octave, use eval(p) instead of execstr(p).

Let v 1,...,v k be row vectors. Let A = [v 1 ; v k ;...; v k ] be the matrix with rows v 1,...,v k. DEFINITION. rank(a) = the dimension of the subspace spanned by its rows. LEMMA. Elementary row operations on a matrix change the rows but do not change the subspace spanned by the rows. The column rank of a matrix = its row rank. COROLLARY. A and rref(a) have the same rank. COROLLARY. rank(a) = the number of nonzero rows of rref(a). THEOREM. Suppose v 1,...,v k are k vectors in an n-dimensional space and A = [v 1 ;...; v k ]. Then v 1,..., v k independent ˆ k <n v 1,..., v k span the space v 1,..., v k a basis v 1,..., v k independent v 1,..., v k span the space v 1,..., v k is a basis ˆ k> n ˆ k=n rank(a) = k rank(a) = n k = rank(a) = n