60
ˇ ˇ ˇ ˇ

Linear Combination, Matrix Equations

Embed Size (px)

Citation preview

Page 1: Linear Combination, Matrix Equations

Announcements

Ï If anyone has not been able to access the class website please

email me at [email protected]

Ï No class on Monday (Martin Luther King day)

Ï Quiz 1 in class on Wednesday Jan 20 on sections 1.1, 1.2 and

1.3

Ï Please know all de�nitions clearly for the quiz. The quiz will

not be about doing lengthy and tiresome row operations but

smaller problems to see whether you know the concepts.

Page 2: Linear Combination, Matrix Equations

Sec 1.3 Contd: Vector Equations

Vectors in n-dimensions, Rn

Ï Just like we had an ordered pair for x −y (or R2) and ordered

triplet for x −y −z (or R3), we have ordered n−tuples forn-dimensions (or Rn)

Ï Obviously not possible to draw or visualize

Ï Vectors in Rn is a n×1 column matrix of the form u=

u1u2u3...

un

Page 3: Linear Combination, Matrix Equations

Basic Algebraic Properties

For all u, v and w in Rn and all scalars c and d

Ï u+v=v+u

Ï (u+v)+w=u+(v+w)

Ï u+0=0+u=u

Ï u+(-u)=-u+u=0

Ï c(u+v)=cu+cv

Ï (c +d)u=cu+du

Ï c(du)=(cd)(u)

Ï 1u=u

Page 4: Linear Combination, Matrix Equations

Linear Combinations

Let v1, v2, v3, . . ., vp be vectors in Rn and let c1, c2, c3, . . ., cp be

scalars.

We can de�ne a new vector y as follows

y = c1v1 + c2v2 + c3v3 + . . . + cpvp

This new vector y is called a LINEAR COMBINATION of v1, v2,v3, . . ., vp with WEIGHTS c1, c2, c3, . . ., cp

Page 5: Linear Combination, Matrix Equations

Linear Combinations

Let v1, v2, v3, . . ., vp be vectors in Rn and let c1, c2, c3, . . ., cp be

scalars.

We can de�ne a new vector y as follows

y = c1v1 + c2v2 + c3v3 + . . . + cpvp

This new vector y is called a LINEAR COMBINATION of v1, v2,v3, . . ., vp with WEIGHTS c1, c2, c3, . . ., cp

Page 6: Linear Combination, Matrix Equations

Linear Combinations

Let v1, v2, v3, . . ., vp be vectors in Rn and let c1, c2, c3, . . ., cp be

scalars.

We can de�ne a new vector y as follows

y = c1v1 + c2v2 + c3v3 + . . . + cpvp

This new vector y is called a LINEAR COMBINATION of v1, v2,v3, . . ., vp with WEIGHTS c1, c2, c3, . . ., cp

Page 7: Linear Combination, Matrix Equations

Simple Examples

Let v1 and v2 be vectors in R2

The following are examples of linear combinations of v1 and v2

5v1 + v2, v1 +p13v2, πv1 - 0.5v2, 3v2(=0v1 + 3v2)

Page 8: Linear Combination, Matrix Equations

Vector Equation

An equation with vectors on both sides!!

For vectors a1 and a2 and b in R2, the equation x1a1 + x2a2 = b is

a vector equation. Here x1 and x2 are weights. This extends to R3

and Rn

The solution set of a vector equation (we want to solve for the

weights) is the same as the solution of the linear system whose

augmented matrix is formed by the vectors written as columns.

Page 9: Linear Combination, Matrix Equations

Vector Equation

An equation with vectors on both sides!!

For vectors a1 and a2 and b in R2, the equation x1a1 + x2a2 = b is

a vector equation. Here x1 and x2 are weights. This extends to R3

and Rn

The solution set of a vector equation (we want to solve for the

weights) is the same as the solution of the linear system whose

augmented matrix is formed by the vectors written as columns.

Page 10: Linear Combination, Matrix Equations

Vector Equation

An equation with vectors on both sides!!

For vectors a1 and a2 and b in R2, the equation x1a1 + x2a2 = b is

a vector equation. Here x1 and x2 are weights. This extends to R3

and Rn

The solution set of a vector equation (we want to solve for the

weights) is the same as the solution of the linear system whose

augmented matrix is formed by the vectors written as columns.

Page 11: Linear Combination, Matrix Equations

Meaning...

Suppose we are given a1=

1

−23

, a2= 5

−13−3

and b=

−381

. Can we

�nd two scalars (weights) x1 and x2 such that we can write

x1a1 + x1a2 = b? What I said earlier was..

Ï To do this, you write the 3 vectors as the 3 columns of a

matrix, the last column corresponding to b being the

augmented column.

Ï Do row reductions to solve for x1 and x2.

Ï If the system is inconsistent (remember that "0=nonzero"?),

that means we cannot �nd such weights.

Ï If the system is inconsistent, b CANNOT be written as a linear

combination of a1 and a2.

Page 12: Linear Combination, Matrix Equations

Meaning...

Suppose we are given a1=

1

−23

, a2= 5

−13−3

and b=

−381

. Can we

�nd two scalars (weights) x1 and x2 such that we can write

x1a1 + x1a2 = b? What I said earlier was..

Ï To do this, you write the 3 vectors as the 3 columns of a

matrix, the last column corresponding to b being the

augmented column.

Ï Do row reductions to solve for x1 and x2.

Ï If the system is inconsistent (remember that "0=nonzero"?),

that means we cannot �nd such weights.

Ï If the system is inconsistent, b CANNOT be written as a linear

combination of a1 and a2.

Page 13: Linear Combination, Matrix Equations

Meaning...

Suppose we are given a1=

1

−23

, a2= 5

−13−3

and b=

−381

. Can we

�nd two scalars (weights) x1 and x2 such that we can write

x1a1 + x1a2 = b? What I said earlier was..

Ï To do this, you write the 3 vectors as the 3 columns of a

matrix, the last column corresponding to b being the

augmented column.

Ï Do row reductions to solve for x1 and x2.

Ï If the system is inconsistent (remember that "0=nonzero"?),

that means we cannot �nd such weights.

Ï If the system is inconsistent, b CANNOT be written as a linear

combination of a1 and a2.

Page 14: Linear Combination, Matrix Equations

Meaning...

Suppose we are given a1=

1

−23

, a2= 5

−13−3

and b=

−381

. Can we

�nd two scalars (weights) x1 and x2 such that we can write

x1a1 + x1a2 = b? What I said earlier was..

Ï To do this, you write the 3 vectors as the 3 columns of a

matrix, the last column corresponding to b being the

augmented column.

Ï Do row reductions to solve for x1 and x2.

Ï If the system is inconsistent (remember that "0=nonzero"?),

that means we cannot �nd such weights.

Ï If the system is inconsistent, b CANNOT be written as a linear

combination of a1 and a2.

Page 15: Linear Combination, Matrix Equations

So let's do this

1 5 −3

−2 −13 8

3 −3 1

R2+2R1

and 1 5 −3

−2 −13 8

3 −3 1

R3-3R1

Page 16: Linear Combination, Matrix Equations

We get

1 5 −30 −3 2

0 −18 10

and then do

1 5 −3

0 −3 2

0 −18 10

R3-6R2

Page 17: Linear Combination, Matrix Equations

Result

1 5 −30 −3 2

0 0 −2

So the last row says 0=-2. This means the system is inconsistent.

So we CANNOT write b as a linear combination of a1 and a2.

So testing whether a vector can be written as a linear combination

of 2 or more vectors involve writing the augmented matrix and

solving for the weights.

Page 18: Linear Combination, Matrix Equations

Result

1 5 −30 −3 2

0 0 −2

So the last row says 0=-2. This means the system is inconsistent.

So we CANNOT write b as a linear combination of a1 and a2.

So testing whether a vector can be written as a linear combination

of 2 or more vectors involve writing the augmented matrix and

solving for the weights.

Page 19: Linear Combination, Matrix Equations

Result

1 5 −30 −3 2

0 0 −2

So the last row says 0=-2. This means the system is inconsistent.

So we CANNOT write b as a linear combination of a1 and a2.

So testing whether a vector can be written as a linear combination

of 2 or more vectors involve writing the augmented matrix and

solving for the weights.

Page 20: Linear Combination, Matrix Equations

Problem 14, sec 1.3

Determine if b is a linear combination of the vectors formed from

the columns of the matrix A.

A=1 −2 −60 3 7

1 −2 5

, b=11−59

Before we start, this problem is same as

Determine if b is a linear combination of a1, a2 and a3 where

a1 =

101

, a2=−23−2

, a3=−675

, b=11−59

Page 21: Linear Combination, Matrix Equations

Problem 14, sec 1.3

Determine if b is a linear combination of the vectors formed from

the columns of the matrix A.

A=1 −2 −60 3 7

1 −2 5

, b=11−59

Before we start, this problem is same as

Determine if b is a linear combination of a1, a2 and a3 where

a1 =

101

, a2=−23−2

, a3=−675

, b=11−59

Page 22: Linear Combination, Matrix Equations

Augmented matrix and row operations1 −2 −6 11

0 3 7 −5

1 −2 5 9

R3-R1

=⇒ 1 −2 −6 11

0 3 7 −50 0 11 −2

Divide R2 by 3 and R3 by 11 1 −2 −6 11

0 1 7

3−5

3

0 0 1 − 2

11

This matrix tells you that the system is consistent. That is all what

you want to know to decide whether the linear combination is

possible. Finding the complete solution here is not necessary.

Page 23: Linear Combination, Matrix Equations

Augmented matrix and row operations1 −2 −6 11

0 3 7 −5

1 −2 5 9

R3-R1

=⇒ 1 −2 −6 11

0 3 7 −50 0 11 −2

Divide R2 by 3 and R3 by 11 1 −2 −6 11

0 1 7

3−5

3

0 0 1 − 2

11

This matrix tells you that the system is consistent. That is all what

you want to know to decide whether the linear combination is

possible. Finding the complete solution here is not necessary.

Page 24: Linear Combination, Matrix Equations

Augmented matrix and row operations1 −2 −6 11

0 3 7 −5

1 −2 5 9

R3-R1

=⇒ 1 −2 −6 11

0 3 7 −50 0 11 −2

Divide R2 by 3 and R3 by 11 1 −2 −6 11

0 1 7

3−5

3

0 0 1 − 2

11

This matrix tells you that the system is consistent. That is all what

you want to know to decide whether the linear combination is

possible. Finding the complete solution here is not necessary.

Page 25: Linear Combination, Matrix Equations

Span

Span is a fancy term for a collection of linear combinations of

vectors. Here is the formal de�nition

Let v1, v2, v3, . . ., vp be vectors in Rn.

The set of all linear combinations of v1, v2, v3, . . ., vp is denoted

by Span{v1,v2, . . .vp

}

This is called the subset of Rn spanned (or generated) by v1, v2,v3, . . ., vp.

Page 26: Linear Combination, Matrix Equations

Span

Span is a fancy term for a collection of linear combinations of

vectors. Here is the formal de�nition

Let v1, v2, v3, . . ., vp be vectors in Rn.

The set of all linear combinations of v1, v2, v3, . . ., vp is denoted

by Span{v1,v2, . . .vp

}

This is called the subset of Rn spanned (or generated) by v1, v2,v3, . . ., vp.

Page 27: Linear Combination, Matrix Equations

Span

Span is a fancy term for a collection of linear combinations of

vectors. Here is the formal de�nition

Let v1, v2, v3, . . ., vp be vectors in Rn.

The set of all linear combinations of v1, v2, v3, . . ., vp is denoted

by Span{v1,v2, . . .vp

}

This is called the subset of Rn spanned (or generated) by v1, v2,v3, . . ., vp.

Page 28: Linear Combination, Matrix Equations

Span

Span{v1,v2, . . .vp

}is a collection of all vectors that can be written

as c1v1 + c2v2 + c3v3 + . . . + cpvp

If someone asks you whether a vector b is in Span {v1,v2,v3} whatshould you do?

Just do the same thing you do to check whether b is a linear

combination of v1,v2, and v3.

Or whether the linear system with augmented matrix formed by

v1,v2, v3 and b has a solution (consistent)

Page 29: Linear Combination, Matrix Equations

Span

Span{v1,v2, . . .vp

}is a collection of all vectors that can be written

as c1v1 + c2v2 + c3v3 + . . . + cpvp

If someone asks you whether a vector b is in Span {v1,v2,v3} whatshould you do?

Just do the same thing you do to check whether b is a linear

combination of v1,v2, and v3.

Or whether the linear system with augmented matrix formed by

v1,v2, v3 and b has a solution (consistent)

Page 30: Linear Combination, Matrix Equations

Span

Span{v1,v2, . . .vp

}is a collection of all vectors that can be written

as c1v1 + c2v2 + c3v3 + . . . + cpvp

If someone asks you whether a vector b is in Span {v1,v2,v3} whatshould you do?

Just do the same thing you do to check whether b is a linear

combination of v1,v2, and v3.

Or whether the linear system with augmented matrix formed by

v1,v2, v3 and b has a solution (consistent)

Page 31: Linear Combination, Matrix Equations

Problem 12 section 1.3 (Re-worded)Determine if b is in Span {a1,a2,a3} where

a1 =

1

−22

, a2=055

, a3=208

, b=−511−7

1 0 2 −5

−2 5 0 11

2 5 8 −7

R3+R2

1 0 2 −5

−2 5 0 11

0 5 4 2

R2+2R1

Page 32: Linear Combination, Matrix Equations

Result 1 0 2 −5

0 5 4 1

0 5 4 2

R3-R2

1 0 2 −5

0 5 4 1

0 0 0 1

There we have it again, 0=1!!! The system is inconsistent, no solution

which means no linear combination of b possible in terms of the 3

given vectors or b IS NOT in Span {v1,v2,v3}

Page 33: Linear Combination, Matrix Equations

Result 1 0 2 −5

0 5 4 1

0 5 4 2

R3-R2

1 0 2 −5

0 5 4 1

0 0 0 1

There we have it again, 0=1!!! The system is inconsistent, no solution

which means no linear combination of b possible in terms of the 3

given vectors or b IS NOT in Span {v1,v2,v3}

Page 34: Linear Combination, Matrix Equations

Problem 18, section 1.3

Let v1 =

1

0

−2

, v2=−318

, y= h

−5−3

. For what value(s) of h is y in

the plane generated by v1 and v2?1 −3 h

0 1 −5

−2 8 −3

R3+2R1

1 −3 h

0 1 −5

0 2 −3+2h

R3-2R2

Page 35: Linear Combination, Matrix Equations

Problem 18, section 1.3

Remember, the problem is just asking you the value(s) of h that

will make the linear system represented by this augmented matrix

consistent. 1 −3 h

0 1 −5

0 0 7+2h

To have a consistent system, just make sure that 7+2h= 0 or

h=−7

2.

Page 36: Linear Combination, Matrix Equations

Section 1.4 The Matrix Equation Ax=b

A linear combination of vectors is the product of a matrix and a

vector.

De�nitionIf A is an m×n matrix with columns formed by the vectors

a1,a2, . . .an and if x is in Rn, then the product of A and x denoted

by Ax is the linear combination of the columns of A using the

corresponding entries in x as weights.

Ax= [a1 a2 . . . an

]x1x2...

xn

= x1a1+x2a2+ . . .+xnan

Page 37: Linear Combination, Matrix Equations

Section 1.4 The Matrix Equation Ax=b

A linear combination of vectors is the product of a matrix and a

vector.

De�nitionIf A is an m×n matrix with columns formed by the vectors

a1,a2, . . .an and if x is in Rn, then the product of A and x denoted

by Ax is the linear combination of the columns of A using the

corresponding entries in x as weights.

Ax= [a1 a2 . . . an

]x1x2...

xn

= x1a1+x2a2+ . . .+xnan

Page 38: Linear Combination, Matrix Equations

Section 1.4 The Matrix Equation Ax=b

For this product to be possible, the number of columns in A mustbe same as the number of entries in x

Example

1 −3 7 1

2 1 −5 2

5 2 −3 3

1

2

3

4

= 1

125

+2

−312

+3

7

−5−3

+4

123

=125

+−624

+ 21

−15−9

+ 4

8

12

=20−312

Page 39: Linear Combination, Matrix Equations

Section 1.4 The Matrix Equation Ax=b

For this product to be possible, the number of columns in A mustbe same as the number of entries in x

Example

1 −3 7 1

2 1 −5 2

5 2 −3 3

1

2

3

4

= 1

125

+2

−312

+3

7

−5−3

+4

123

=125

+−624

+ 21

−15−9

+ 4

8

12

=20−312

Page 40: Linear Combination, Matrix Equations

Section 1.4 The Matrix Equation Ax=b

For this product to be possible, the number of columns in A mustbe same as the number of entries in x

Example

1 −3 7 1

2 1 −5 2

5 2 −3 3

1

2

3

4

= 1

125

+2

−312

+3

7

−5−3

+4

123

=125

+−624

+ 21

−15−9

+ 4

8

12

=20−312

Page 41: Linear Combination, Matrix Equations

Matrix Equation and Vector Equation

Consider the following systemx1 − 6x2 + 7x3 = 5

x2 + 2x3 = −3

This is the same as

x1

[1

0

]+x2

[−61

]+x3

[7

2

]=

[5

−3]

This is the Vector Equation.

Page 42: Linear Combination, Matrix Equations

Matrix Equation and Vector Equation

Consider the following systemx1 − 6x2 + 7x3 = 5

x2 + 2x3 = −3

This is the same as

x1

[1

0

]+x2

[−61

]+x3

[7

2

]=

[5

−3]

This is the Vector Equation.

Page 43: Linear Combination, Matrix Equations

Matrix Equation and Vector Equation

Consider the following systemx1 − 6x2 + 7x3 = 5

x2 + 2x3 = −3

This is the same as

x1

[1

0

]+x2

[−61

]+x3

[7

2

]=

[5

−3]

This is the Vector Equation.

Page 44: Linear Combination, Matrix Equations

Matrix Equation and Vector Equation

Consider the following systemx1 − 6x2 + 7x3 = 5

x2 + 2x3 = −3

This is the same as

[1 −6 7

0 1 2

]x1x2x3

=[5

−3]

This is the Matrix Equation.

Page 45: Linear Combination, Matrix Equations

Matrix Equation and Vector Equation

Consider the following systemx1 − 6x2 + 7x3 = 5

x2 + 2x3 = −3

This is the same as

[1 −6 7

0 1 2

]x1x2x3

=[5

−3]

This is the Matrix Equation.

Page 46: Linear Combination, Matrix Equations

Matrix Equation and Vector Equation

Consider the following systemx1 − 6x2 + 7x3 = 5

x2 + 2x3 = −3

This is the same as

[1 −6 7

0 1 2

]x1x2x3

=[5

−3]

This is the Matrix Equation.

Page 47: Linear Combination, Matrix Equations

Everything is the same

TheoremIf A is an m×n matrix with columns formed by the vectors

a1,a2, . . .an and if b is in Rm, then the matrix equation Ax= b has

the same solution as the following:

Ï The vector equation x1a1+x2a2+ . . .+xnan = b

Ï The system of linear equations whose augmented matrix is[a1 a2 . . . an

](which you have been all these days)

That is, solving a matrix equation is the same as solving the

corresponding vector equation which is the same as solving the

corresponding system of linear equations by row-reducing the

augmented matrix.

Page 48: Linear Combination, Matrix Equations

Everything is the same

TheoremIf A is an m×n matrix with columns formed by the vectors

a1,a2, . . .an and if b is in Rm, then the matrix equation Ax= b has

the same solution as the following:

Ï The vector equation x1a1+x2a2+ . . .+xnan = b

Ï The system of linear equations whose augmented matrix is[a1 a2 . . . an

](which you have been all these days)

That is, solving a matrix equation is the same as solving the

corresponding vector equation which is the same as solving the

corresponding system of linear equations by row-reducing the

augmented matrix.

Page 49: Linear Combination, Matrix Equations

Everything is the same

TheoremIf A is an m×n matrix with columns formed by the vectors

a1,a2, . . .an and if b is in Rm, then the matrix equation Ax= b has

the same solution as the following:

Ï The vector equation x1a1+x2a2+ . . .+xnan = b

Ï The system of linear equations whose augmented matrix is[a1 a2 . . . an

](which you have been all these days)

That is, solving a matrix equation is the same as solving the

corresponding vector equation which is the same as solving the

corresponding system of linear equations by row-reducing the

augmented matrix.

Page 50: Linear Combination, Matrix Equations

Everything is the same

TheoremIf A is an m×n matrix with columns formed by the vectors

a1,a2, . . .an and if b is in Rm, then the matrix equation Ax= b has

the same solution as the following:

Ï The vector equation x1a1+x2a2+ . . .+xnan = b

Ï The system of linear equations whose augmented matrix is[a1 a2 . . . an

](which you have been all these days)

That is, solving a matrix equation is the same as solving the

corresponding vector equation which is the same as solving the

corresponding system of linear equations by row-reducing the

augmented matrix.

Page 51: Linear Combination, Matrix Equations

Existence of Solutions

The matrix equation Ax= b has a solution if and only if b is a

linear combination of the columns of A.

So Ax= b should be consistent for all possible b for solution to exist.

TheoremIf A is an m×n matrix and if the matrix equation Ax= b has a

solution then

Ï Each b is a linear combination of the columns of A

Ï The columns of A span Rm (very important)

Ï A has pivot position in every row (not necessarily every

column). Please note that A is the coe�cient matrix (and not

the augmented matrix)

Page 52: Linear Combination, Matrix Equations

Existence of Solutions

The matrix equation Ax= b has a solution if and only if b is a

linear combination of the columns of A.

So Ax= b should be consistent for all possible b for solution to exist.

TheoremIf A is an m×n matrix and if the matrix equation Ax= b has a

solution then

Ï Each b is a linear combination of the columns of A

Ï The columns of A span Rm (very important)

Ï A has pivot position in every row (not necessarily every

column). Please note that A is the coe�cient matrix (and not

the augmented matrix)

Page 53: Linear Combination, Matrix Equations

Problem 12, section 1.4

Write the augmented matrix for the linear system corresponding to

the matrix equation Ax= b, solve the system and write the answer

as a vector.

A= 1 2 1

−3 −1 2

0 5 3

, b= 0

1

−1

The augmented matrix is

1 2 1 0

−3 −1 2 1

0 5 3 −1

R2+3R1

Page 54: Linear Combination, Matrix Equations

Problem 12, section 1.41 2 1 0

0 5 5 1

0 5 3 −1

R3-R2

1 2 1 0

0 5 5 1

0 0 −2 −2

Divide R3 by -2 1 2 1 0

0 5 5 1

0 0 1 1

Page 55: Linear Combination, Matrix Equations

Problem 12, section 1.41 2 1 0

0 5 5 1

0 0 1 1

R2-5R3

1 2 1 0

0 5 0 −40 0 1 1

Divide R2 by 5 1 2 1 0

0 1 0 −4

5

0 0 1 1

Page 56: Linear Combination, Matrix Equations

Problem 12, section 1.4

1 2 1 0

0 1 0 −4

5

0 0 1 1

R1-R3

1 2 0 −1

0 1 0 −4

5

0 0 1 1

R1-2R2

Page 57: Linear Combination, Matrix Equations

1 0 0 3

5

0 1 0 −4

5

0 0 1 1

The augmented column in the above matrix is the solution vector

x=x1x2x3

= 3

5

−4

5

1

Problem 22, section 1.4

Let v1 =

0

0

−2

, v2= 0

−38

, v3= 4

−1−5

. Does {a1,a2,a3} span R3 ?

Why or why not?

Page 58: Linear Combination, Matrix Equations

Problem 22, section 1.4

OutlineThis problem is a direct application of the theorem we saw

just now. We need to see the connection between pivots, existence

of solution and span. If we show that this matrix has pivot

in each row, we have a solution and that means these vectors span R30 0 4

0 −3 −1

−2 8 5

Swap

−2 8 5

0 −3 −1

0 0 4

Page 59: Linear Combination, Matrix Equations

Problem 22, section 1.4

Divide �rst row by -2, second row by -3 and third row by 4 1 −4 5

2

0 1 1

3

0 0 1

We have pivot position in each row which means that by our

theorem, {a1,a2,a3} span R3.

Page 60: Linear Combination, Matrix Equations

Row-Vector Rule for Computing Ax=b

If the product Ax= b is de�ned, the entry in the ith position of Axis the sum of the products of the entries from row i of A and from

the vector x (very important for matrix multiplication in chapter 2)

Example

1.

1 −3 7 1

2 1 −5 2

5 2 −3 3

1

2

3

4

= 1.1+ (−3).2+7.3+1.4

2.1+1.2+ (−5).3+2.45.1+2.2+ (−3).3+3.4

=20−312

2. 1 0 0

0 1 0

0 0 1

567

= 1.5+0.6+0.7

0.5+1.6+0.70.5+0.2+1.7

=567