Linear Algebra Class Lecture Pass-Unlocked
Linear Algebra Class Lecture Pass-Unlocked
Jaionto Karmokar
Assistant Professor
Dept. of Computer Science and Mathematics
Bangladesh Agricultural University
1
4 2
Linear Algebra
➢ Geometric Interpretation
➢ Augmented Matrices
3 3
Introduction to Systems of Equations
Linear Equations:
• Any straight line in xy-plane can be represented algebraically by an
equation of the form:
a1 x + a2 y = b
• General form: define a linear equation in the n variables x1 , x2 ,..., xn :
a1 x1 + a2 x2 + ... + an xn = b
An arbitrary system of m
linear equations in n unknowns
6 5
Geometric Interpretation. Existence and Uniqueness of Solutions
If we interpret x1, x2 as coordinates in the x1.x2 -plane, then each of the two
equations represents a straight line, and (x1, x2) is a solution if and only if the
point P with coordinates x1, x2 lies on both lines. Hence there are three
possible cases:
(a) Precisely one solution if the lines intersect
(b) Infinitely many solutions if the lines coincide
(c) No solution if the lines are parallel (x1, x2)
7 6
• Every system of linear equations has either no solutions,
exactly one solution, or infinitely many solutions.
8 7
Linear Systems in Two Unknowns
9 8
Geometric interpretation of three possible cases
10 9
Linear Systems in Three Unknowns
11 10
Augmented Matrices
◼ The location of the +’s, the x’s, and the =‘s can be abbreviated by writing
only the rectangular array of numbers.
◼ This is called the augmented matrix for the system.
◼ Note: must be written in the same order in each equation as the unknowns
and the constants must be on the right.
a11x1 + a12 x2 + ... + a1n xn = b1
a21x1 + a22 x2 + ... + a2 n xn = b2
am1 x1 + am 2 x2 + ... + amn xn = bm
1st column
12 11
Linear Algebra
➢ Types of Problems
➢ Gaussian/Gauss Elimination
➢ Echelon Forms
14 12
Types of Problems
Gauss Elimination
(Infinitely Many
Solutions)
Gauss Elimination
(no Solution)
15 13
Elementary Row Operations
• The basic method for solving a system of linear equations is to replace the
given system by a new system that has the same solution set but which is
easier to solve.
Other wise:
1. Multiply a row through by a nonzero constant.
2. Interchange two rows.
3. Add a constant times one row to another
16 14
Example: Elementary row Operations of a matrix
𝑥 + 𝑦 + 2𝑧 = 9
2𝑥 + 4𝑦 − 3𝑧 = 1
3𝑥 + 6𝑦 − 5𝑧 = 0
1 1 2 9 add −2 times
the first equation 1 1 2 9
2 4 −3 1 0 2 −7 −17
3 6 −5 0 to the second
3 6 −5 0
add −3 times
the first row 1 1 2 9
to the third 0 2 −7 −17
0 3 −11 −27
17 15
1 1 2 9
add −3 times 7 17
the second row 0 1 − −
to the third 2 2
1 3
0 0 − −
2 2
1 1 2 9
Multily the third 7 17
0 1 − −
row by −2 2 2
0 0 1 3
❖ Row-echelon form:
1 4 −3 7 1 1 0 0 1 2 6 0
0 1 6 2 , 0 1 0 , 0 0 1 −1 0
0 0 1 5 0 0 0 0 0 0 0 1
20 18
Example 2
More on Row-Echelon and Reduced Row-Echelon form
❖ All matrices of the following types are in row-echelon form (any real numbers
substituted for the *’s.) :
0 1 ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
1 ∗ ∗ ∗ 1 ∗ ∗ ∗ 1 ∗ ∗ ∗
0 0 0 1 ∗ ∗ ∗ ∗ ∗ ∗
0 1 ∗ ∗ 0 1 ∗ ∗ 0 1 ∗ ∗
, , , 0 0 0 0 1 ∗ ∗ ∗ ∗ ∗
0 0 1 ∗ 0 0 1 ∗ 0 0 0 0
0 0 0 0 0 1 ∗ ∗ ∗ ∗
0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 ∗
❖ All matrices of the following types are in reduced row-echelon form (any real
numbers substituted for the *’s.) :
0 1 ∗ 0 0 0 ∗ ∗ 0 ∗
1 0 0 0 1 0 0 ∗ 1 0 ∗ ∗
0 0 0 1 0 0 ∗ ∗ 0 ∗
0 1 0 0 0 1 0 ∗ 0 1 ∗ ∗
, , , 0 0 0 0 1 0 ∗ ∗ 0 ∗
0 0 1 0 0 0 1 ∗ 0 0 0 0
0 0 0 0 0 1 ∗ ∗ 0 ∗
0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 ∗
21 19
Solutions of Four (a, b, c, d) Linear Systems
Suppose that the augmented matrix for a system of linear equations
have been reduced by row operations to the given reduced row-
echelon form. Solve the system.
The corresponding 𝑥 = 5
1 0 0 5
system of equations is: 𝑦 = −2
(a) 0 1 0 −2 𝑧= 4
0 0 1 4
1. The corresponding
1 0 0 4 −1 system of equations is:
(b) 0 1 0 2 6
0 0 1 3 2 free variables
𝑥1 + 4𝑥4 = −1
𝑥2 + 2𝑥4 = 6
𝑥3 + 3𝑥4 = 2
leading
variables
22 20
2. We see that the free variable can be assigned an arbitrary value, say t,
which then determines values of the leading variables.
𝑥1 = −1 − 4𝑥4
𝑥2 = 6 −2𝑥4
𝑥3 = 2−3𝑥4
3. There are infinitely many solutions, and the general solution is given
by the formulas
𝑥1 = −1 − 4𝑡,
𝑥2 = 6 − 2𝑡,
𝑥3 = 2 − 3𝑡,
𝑥4 = 𝑡
23 21
1 6 0 0 4 −2
0 0 1 0 3 1
(c)
0 0 0 1 5 2
0 0 0 0 0 0
Solution (c):
1. The 4th row of zeros leads to the equation places no restrictions on
the solutions (why?). Thus, we can omit this equation.
𝑥1 + 6𝑥2 + 4𝑥5 = −2
𝑥3 + 3𝑥5 = 1
𝑥4 + 5𝑥5 = 2
24 22
3. The free variable can be assigned an arbitrary value, there are infinitely
many solutions, and the general solution is given by the formulas.
𝑥1 = −2 −6𝑠−4𝑡 ,
𝑥2 = 𝑠
𝑥3 = 1 −3𝑡
𝑥4 = 2−5𝑡,
𝑥5 = 𝑡
1 0 0 0
(d) 0 1 2 0
0 0 0 1
25 23
Linear Algebra
27
24
Elimination Methods (step-by-step)
We shall give a step-by-step elimination procedure that can be used to reduce
any matrix to reduced row-echelon form.
0 0 − 2 0 7 12
• For example: 2 4 − 10 6 12 28
2 4 − 5 6 − 5 − 1
➢ Step1. Locate the leftmost column that does not consist entirely of zeros.
0 0 − 2 0 7 12
2 4 − 10 6 12 28
2 4 − 5 6 − 5 − 1
Leftmost nonzero column
➢ Step2. Interchange the top row with another row, to bring a nonzero entry to
top of the column found in Step1.
➢ Step4. Add suitable multiples of the top row to the rows below so that all
entires below the leading 1 become zeros.
1 2 − 5 3 6 14 -2 times the 1st row of the
0 0 − 2 0 7 12
preceding matrix was added
0 0 5 0 − 17 − 29 to the 3rd row.
➢ Step5. Now cover the top row in the matrix and begin again with Step1
applied to the sub-matrix that remains. Continue in this way until the entire
matrix is in row-echelon form.
1 2 − 5 3 6 14
0 0 − 2 0 7 12
0 0 − 5 0 − 17 − 29 Leftmost nonzero column in
the sub-matrix
26
29
➢ Step5 (cont.)
1 2 − 5 3 6 14 The 1st row in the submatrix was
0 0 1 0 − 7 − 6
2 multiplied by -1/2 to introduce a
0 0 5 0 − 17 − 29 leading 1.
1 2 − 5 3 0 2
0 0 1 0 0 1 -6 times the 3rd row was
added to the 1st row.
0 0 0 0 1 2
1 2 0 3 0 7
0 0 1 0 0 1
5 times the 2nd row was
0 0 0 0 1 2 added to the 1st row.
◼ The last matrix is in reduced row-echelon form.
Step1~Step5: the above procedure produces a row-echelon form and is called
Gaussian elimination.
Step1~Step6: the above procedure produces a reduced row-echelon form and is
called Gaussian-Jordan elimination.
Every matrix has a unique reduced row-echelon form but a row-echelon form
of a given matrix is not unique. 28
31
Exercise: Gauss Elimination
3229
– Solving for the leading variables
x = 9 − y − 2 z,
y = − 172 + 72 z ,
z =3
– Substituting the bottom equation into those above
x = 3 − y,
y = 2,
z =3
– Substituting the 2nd equation into the top
x = 1, y = 2, z = 3
33
30
Linear Algebra
35
31
Type-II (A): Gauss Elimination (Unique Solution)
Solve the linear system Find unknown currents from electrical network
This is the system for the unknown currents in the electrical network (in figure). To
obtain it, we label the currents as shown, choosing directions arbitrarily; if a current
will come out negative, this will simply mean that the current flows against the
direction of our arrow. The current entering each battery will be the same as the
current leaving it. The equations for the currents result from Kirchhoff’s laws:
Kirchhoff’s Current Law (KCL): At any point of a circuit, the sum of the inflowing
currents equals the sum of the outflowing currents.
Kirchhoff’s Voltage Law (KVL): In any closed loop, the sum of all voltage drops
equals the impressed
electromotive force.
36 32
Node P gives the first equation, node Q the second, the right loop the third, and
the left loop the fourth, as indicated in the figure.
3733
38 34
39
35
Type-II (B): Gauss Elimination (Infinitely Many Solutions)
Solve the following linear system of three equations in four unknowns whose
augmented matrix is
Solution: As in the previous example, we circle pivots and box terms of equations and
corresponding entries to be eliminated. We indicate the operations in terms of equations
and operate on both equations and matrices.
40
36
Step 2. Elimination of x2 from the third equation by adding 1.1/1.1=1 times the second
equation to the third equation. This gives
41
37
Type-II (C): Gauss Elimination (no Solution)
4238
Exercise
In Problems.7–8, using Kirchhoff’s laws (see Type-I) and showing the details, find the
currents:
(7) (8)
39
43
Linear Algebra
➢ Gauss-Jordan Elimination
45
40
Type-IV: Gauss–Jordan Elimination
46
41
47
42
Exercise
48
43
Problems: Solve the system of linear equation by Gauss-Jordan Elimination
x1 + 3x2 − 2 x3 + 2x 5 = 0
2 x1 + 6 x2 − 5 x3 − 2 x4 + 4 x5 − 3x6 = −1
5 x3 + 10 x4 + 15 x6 = 5
2 x1 + 6 x2 + 8 x4 + 4 x5 − 18 x6 = 6
Solution:
The augmented matrix for the system is
Multiplying the 2nd row by -1 and then
1 3 - 2 0 2 0 0
2 6 - 5 - 2 4 - 3 - 1 adding -5 times the new 2nd row to the
3rd row and -4 times the new 2nd row
0 0 5 10 0 15 5 to the 4th row gives
2 6 0 8 4 18 6 1 3 -2 0 2 0 0
Adding (-2) times the 1st row to the 0 0 1 2 0 -3 1
2nd and 4th rows gives 0 0 0 0 0 0 0
1 3 -2 0 2 0 0 0 0 0 0 0 6 2
0 0 -1 -2 0 -3 - 1
0 0 5 10 0 15 5
0 0 4 8 0 18 6 49
44
Interchanging the 3rd and 4th rows The corresponding system of equations is
and then multiplying the 3rd row of
the resulting matrix by 1/6 gives the
x1 + 3x2 + 4 x4 + 2 x 5 =0
row-echelon form. x3 + 2 x4 =0
x6 = 13
1 3 -2 0 2 0 0
0 0 -1 -2 0 -3 - 1 The solution for the system is
0 0 0 0 0 1 1 x1 = −3 x2 − 4 x4 − 2 x 5
3
x3 = −2 x4
0 0 0 0 0 0 0
x6 = 1
3
Adding -3 times the 3rd row to the
We assign the free variables, and the
2nd row and then adding 2 times the
general solution is
2nd row of the resulting matrix to
the 1st row yields the reduced row- x1 = −3r − 4s − 2t
echelon form. x2 = r
1 3 0 4 2 0 0 x3 = −2s
0 0
0 1 2 0 0 x4 = s
0 0 0 0 0 1 1
3 x5 = t
0 0 0 0 0 0 0
x6 = 13
50
45
Homogeneous Linear Systems
2 x1 + 2 x2 − x3 + x5 = 0
− x1 − x2 + 2 x3 − 3x4 + x5 = 0
x1 + x2 − 2 x3 − x5 = 0
x3 + x4 + x5 = 0
51
46
Solution: The augmented matrix for the system is (same solve)
2 2 −1 0 1 0 1 1 0 0 1 0
− 1 −1 2 −3 1 0 0 0 1 0 1 0
1 1 −2 0 −1 0 0 0 0 1 0 0
0 0 1 1 1 0 0 0 0 0 0 0
Optimization
2
48
3 49
Mathematical Programming Problem
Linear Programming:
4
50
Before proceeding to discuss the theory of linear programming, we shall
present a few examples to illustrate the applications of linear programming.
5
51
6
52
7
53
8
54
Graphical Solution
9
55
Draw the graph
To illustrate some basic features of linear programming, let us consider some
problems involving only two variables which permit graphical solutions.
Example 1.
10
56
Example 2.
11
57
Exercise
12
58
The general linear programming problem is to find values of a set of variables
X1, X2, ... Xn which optimizes (maximizes or minimizes) a linear function
13
59
General Form
14
60
Example: Refinery input and output schematic.
15
61
Solution:
Income:
gasoline (36) (0.80 x1 + 0.44 x2) Then, the objective function is
kerosene (24) (0.05 x1 + 0.10 x2) Profit = f = 8.1 x1 + 10.8 x2
fuel oil (21) (0.10 x1 + 0.36 x2) Constraints
residual (10) (0.05 x1 + 0.10 x2) Maximum allowable production:
0.80 x1 + 0.44 x2 < 24,000 (gasoline)
So, Income = 32.6 x1 + 26.8 x2 0.05 x1 + 0.10 x2 < 2,000 (kerosene)
Raw mat’l cost = 24 x1 + 15 x2 0.10 x1 + 0.36 x2 < 6,000 (fuel oil)
Processing cost = 0.5 x1 + x2 x1 > 0, x2 > 0
16
62
17
63
18
64
19
65
Solution:
20
Same solve 66
Linear Algebra
Linear Transformations
2
67
Introduction to Linear Transformations
3
68
❖ Example 1: A function from R2 into R2 such that 𝑇: 𝑅2 → 𝑅2
𝐯 = (𝑣1 , 𝑣2 ) ∈ 𝑅2
𝑇(𝑣1 , 𝑣2 ) = (𝑣1 − 𝑣2 , 𝑣1 + 2𝑣2 )
(a) Find the image of v = (-1,2). (b) Find the preimage of w = (-1,11)
⇒ 𝑣1 − 𝑣2 = −1
𝑣1 + 2𝑣2 = 11
⇒ 𝑣1 = 3, 𝑣2 = 4
5
70
❖ Example 2: Verifying a linear transformation T from R2 into R2
𝑇(𝑣1 , 𝑣2 ) = (𝑣1 − 𝑣2 , 𝑣1 + 2𝑣2 )
Proof: Suppose
𝐮 = (𝑢1 , 𝑢2 ), 𝐯 = (𝑣1 , 𝑣2 ) : vector in 𝑅2 , 𝑐: any real number
(1)Vector addition:
𝐮 + 𝐯 = (𝑢1 , 𝑢2 ) + (𝑣1 , 𝑣2 ) = (𝑢1 + 𝑣1 , 𝑢2 + 𝑣2 )
𝑇(𝐮 + 𝐯) = 𝑇(𝑢1 + 𝑣1 , 𝑢2 + 𝑣2 )
= ((𝑢1 + 𝑣1 ) − (𝑢2 + 𝑣2 ), (𝑢1 + 𝑣1 ) + 2(𝑢2 + 𝑣2 ))
= ((𝑢1 − 𝑢2 ) + (𝑣1 − 𝑣2 ), (𝑢1 + 2𝑢2 ) + (𝑣1 + 2𝑣2 ))
= (𝑢1 − 𝑢2 , 𝑢1 + 2𝑢2 ) + (𝑣1 − 𝑣2 , 𝑣1 + 2𝑣2 )
= 𝑇(𝐮) + 𝑇(𝐯)
(𝑎)𝑓(𝑥) = sin 𝑥
sin( 𝑥1 + 𝑥2 ) ≠ sin( 𝑥1 ) + sin( 𝑥2 )
𝜋 𝜋 𝜋 𝜋
sin( + ) ≠ sin( ) + sin( ) ⇐ 𝑓(𝑥) = sin 𝑥 is not a linear transformation
2 3 2 3
(𝑏)𝑓(𝑥) = 𝑥 2
(𝑥1 + 𝑥2 )2 ≠ 𝑥12 + 𝑥22
(𝑐)𝑓(𝑥) = 𝑥 + 1
𝑓(𝑥1 + 𝑥2 ) = 𝑥1 + 𝑥2 + 1
7
72
◼ Zero transformation:
𝑇: 𝑉 → 𝑊 𝑇(𝐯) = 0, ∀𝐯 ∈ 𝑉
◼ Identity transformation:
𝑇: 𝑉 → 𝑉 𝑇(𝐯) = 𝐯, ∀𝐯 ∈ 𝑉
(1) 𝑇(𝟎) = 𝟎
(4) If 𝐯 = 𝑐1 𝑣1 + 𝑐2 𝑣2 + ⋯ + 𝑐𝑛 𝑣𝑛
Then 𝑇(𝐯) = 𝑇(𝑐1 𝑣1 + 𝑐2 𝑣2 + ⋯ + 𝑐𝑛 𝑣𝑛 )
= 𝑐1 𝑇(𝑣1 ) + 𝑐2 𝑇(𝑣2 ) + ⋯ + 𝑐𝑛 𝑇(𝑣𝑛 )
8
73
❖ Example 4: Linear transformations and bases.
= (7, 7, 0)
9
74
Matrices for Linear Transformations
10
75
◼ Standard matrix for a linear transformation
1
1
T (e1 ) = T (1, 0, 0) = (1, 2) T (e1 ) = T ( 0 ) =
2
0
0
− 2
T (e2 ) = T (0, 1, 0) = (−2, 1) T (e2 ) = T ( 1 ) =
1
0
0
0
T (e3 ) = T (0, 0, 1) = (0, 0) T (e3 ) = T ( 0 ) =
0
1
12
77
A = T (e1 ) T (e2 ) T (e3 )
1 − 2 0
=
2 1 0
◼ Check:
x x
1 − 2 0 x − 2 y
A y = y =
2 1 0 2 x + y
z z
i.e. T ( x, y, z ) = ( x − 2 y,2 x + y)
◼ Note:
1 − 2 0 1x − 2 y + 0 z
A=
2 1 0 2 x + 1y + 0 z
13
78
◼ Example 2: The standard matrix of a composition:
Let T1 and T2 be L.T. from R3 into R3 s.t.
T1 ( x, y, z ) = (2 x + y, 0, x + z ) and T2 ( x, y, z ) = ( x − y, z, y )
Find the standard matrices for the compositio ns
T = T2 T1 and T ' = T1 T2 ,
Solution: Suppose
2 1 0 1 − 1 0
A1 = 0 0 0 (standard matrix for T1 ) and A2 = 0 0 1 (standard matrix for T2 )
1 0 1 0 1 0
The standard matrix for T = T2 T1
1 − 1 0 2 1 0 2 1 0
A = A2 A1 = 0 0 1 0 0 0 = 1 0 1
0 1 0 1 0 1 0 0 0
The standard matrix for T ' = T1 T2
2 1 0 1 − 1 0 2 − 2 1
A' = A1 A2 = 0 0 0 0 0 1 = 0 0 0
14
1 0 1 0 1 0 1 0 0 79
Linear Algebra
2
80
Vector Space
(If we multiply a vector by scalar says a real number, we still get a vector)
4
81
Example 1
Solution:
Example 2
Let u = ( –1, 4, 3) and v = ( –2, –3, 1) be elements of R3.
Find u + v and 3u.
Solution: u + v = (–1, 4, 3) + (– 2, –3, 1) = (-3 ,1 ,4)
3u = 3 (–1, 4, 3) = (-3 ,12 ,9)
5
82
Example 3
6
83
7
84
Subspace
Subspace:
Let V be a vector space and U be a nonempty subset of V.
U is said to be a subspace of V if it is closed under addition and scalar multiplication.
8
85
Example 4
Let U be the subset of R3 consisting of all vectors of the form (a, 0, 0)
i.e., U = {(a, 0, 0)R3}. Show that U is a subspace of R3.
Solution:
9
86
Example 5
Let V be the set of vectors of R3 of the form (a, a2, b), namely
V ={(a, a2, b)R3 }. Show that V is not a subspace of R3.
Solution:
10
87
Linear Combinations of Vectors
Definition
Let v1, v2, …, vm be vectors in a vector space V. We say that v, a
vector of V, is a linear combinationof v1, v2, …, vm , if there exist
scalars c1, c2, …,cm such that v can be written
v = c1v1 + c2v2 + … + cmvm .
Example:
The vector (5, 4, 2) is a linear combination of the vectors (1, 2, 0), (3, 1, 4), and
(1, 0, 3), since it can be written
(5, 4, 2) = (1, 2, 0) + 2(3, 1, 4) – 2(1, 0, 3)
12
88
Example 6
Determine whether or not the vector (-1, 1, 5) is a linear combination of the
vectors (1, 2, 3), (0, 1, 4), and (2, 3, 6).
Solution
c1 + 2c3 = −1
2c1 + c2 + 3c3 = 1 c1 = 1, c2 = 2, c3 = −1
3c + 4c + 6c = 5
1 2 3
[Gauss elimination]
Thus (-1, 1, 5) is a linear combination of (1, 2, 3), (0, 1, 4), and (2, 3, 6), where
Solution
[Gauss elimination]
Thus (4, 5, 5) can be expressed in many ways as a linear combination of (1, 2, 3),
(-1, 1, 4), and (3, 3, 2):
(4, 5, 5) = (−2r + 3)(1, 2, 3) + (r − 1)(−1, 1, 4) + r (2, 3, 6) 14
90
Example 8
Show that the vector (3, -4, -6) cannot be expressed as a linear combination of the
vectors (1, 2, 3), (-1, -1, -2), and (1, 4, 5).
Solution
[Gauss elimination]
Solution c 1 0 + c 2 − 3 + c 0 1 = − 1 7
Suppose 1 2 1 2 0 2 3 2 0 8 − 1
c + 2c − 3c2 + c3 − 1 7
Then 1 2
=
2c1 + 2c3 c1 + 2c2 8 − 1
c1 + 2c2 = −1
− 3c2 + c3 =7
2c1 + 2c3 =8
c1 + 2c2 = −1
[Gauss elimination]
This system has the unique solution c1 = 3, c2 = -2, c3 = 1.
Therefore
− 1 7 = 31 0 − 22 − 3 + 0 1 16
8 − 1 2 1 0 2 2 0 92
Example 10
Determine whether the function f ( x) = x 2 + 10 x − 7 is a linear combination
of the functions g ( x) = x 2 + 3 x − 1 and h( x) = 2 x 2 − x + 4.
Solution
Suppose c1 g + c2 h = f .
Then c1 ( x 2 + 3x −1) + c2 (2x 2 − x + 4) = x 2 + 10x − 7
(c1 + 2c2 ) x 2 + (3c1 − c2 ) x − c1 + 4c2 = x 2 + 10x − 7
c1 + 2c2 = 1
3c1 − c2 = 10
− c + 4c = −7
1 2
c1 = 3, c2 = −1 f = 3g − h.
17
93
Orthogonal Vectors
Two nonzero vectors are orthogonal if the angle between them is a right angle.
Example 11
Show that the following pairs of vectors are orthogonal.
(a) (1, 0) and (0, 1).
(b) (2, –3, 1) and (1, 2, 4).
Proof
Definition
The norm (length or magnitude)
of a vector u = (u1, …, un) in Rn
is denoted ||u|| and defined by
u = (u1 ) + + (un )
2 2
Note:
The norm of a vector can also
be written in terms of the dot product
u = uu
Fig.3 Length of u
20
95
Example 12
Solution
Definition
A unit vector is a vector whose norm is 1.
If v is a nonzero vector, then the vector
is a unit vector in the direction of v.
1
u= v
v
Solution
(b) (2, −1, 3) = 22 + (−1)2 + 32 = 14. The norm of (2, –1, 3) is 14.
The normalized vector is
1
(2, − 1, 3)
14
2 , − 1 , 3 .
The vector may also be written
14 14 14
This vector is a unit vector in the direction of (2, –1, 3).
22
97
Angle between Vectors ( in R2)
← Fig.4
23
98
Angle between Vectors (in Rn)
Definition
Let u and v be two nonzero vectors in Rn.
The cosine of the angle between these vectors is
u v
cos = 0
u v
Example 14
Determine the angle between the vectors u = (1, 0, 0) and
v = (1, 0, 1) in R3.
uv 1
Thus cos = = , the angle between u and v is 45.
u v 2
24
99
Spanning Sets:
The vectors v1, v2, …, vm are said to span a vector space if every vector in the
space can be expressed as a linear combination of these vectors.
In this case {v1, v2, …, vm} is called a spanning set.
Example 15 Show that the vectors (1, 2, 0), (0, 1, -1), and (1, 1, 2) span R3.
c1 + c3 = x c1 = 3x − y − z
2c1 + c2 + c3 = y c2 = −4 x + 2 y + z
− c + 2c = z c = −2 x + y + z
2 3 3
{v1, v2, v3} linearly dependent; {v1, v2, v3} linearly independent;
vectors lie in a plane vectors do not lie in a plane
28
102
Example 16
Show that the set {(1, 2, 3), (-2, 1, 1), (8, 6, 10)} is linearly dependent in R3.
Solution
Suppose c1 (1, 2, 3) + c2 (−2, 1, 1) + c3 (8, 6, 10) = 0
c1 − 2c2 + 8c3 = 0
c1 = 4
2c1 + c2 + 6c3 = 0 c2 = -2
3c + c + 10c = 0 c3 = -1 [Gauss elimination]
1 2 3
29
103
Example 17
Show that the set {(3, -2, 2), (3, -1, 4), (1, 0, 5)} is linearly independent in R3.
Solution
Suppose c1 (3, − 2, 2) + c2 (3, − 1, 4) + c3 (1, 0, 5) = 0
3c1 + 3c2 + c3 = 0
− 2c1 − c2 = 0
2c + 4c + 5c = 0 [Gauss elimination]
1 2 3
30
104
Example 18
Consider the functions f(x) = x2 + 1, g(x) = 3x – 1, h(x) = – 4x + 1 of
the vector space P2 of polynomials of degree 2.
Show that the set of functions { f, g, h } is linearly independent.
Solution
Suppose c1f + c2g + c3h = 0
Since for any real number x, c1 ( x 2 + 1) + c2 (3x − 1) + c3 (−4 x + 1) = 0
Consider, three convenient values of x. We get
x = 0 : c1 − c2 + c3 = 0
x = 1 : 2c1 + 2c2 − 3c3 = 0
x = −1 : 2c1 − 4c2 + 5c3 = 0
It can be shown that this system of three equations has the unique
solution c1 = 0, c2 = 0, c3 = 0
Linearly independent:
The set { f, g, h } is linearly independent if c1f + c2g + c3h = 0
implies that c1 = 0, c2 = 0, c3 = 0.
Span:
32
106
Basis and Dimension
Basis:
Let V be a vector space and S={v1, …, vn} is a set of vectors in V then
i) S is a linearly independent set
ii) S spans V.
Then S is a basis of V
Dimension:
If a vector space V has a basis consisting of n vectors, then the
dimension of V is n.
It can be write as
dim(V)=dim(R3)=|S|=3. [B is a set]
Solution
Case-I: (span)
Let (x1, x2, x3) be an arbitrary element of R3.
Suppose ( x1 , x2 , x3 ) = a1 (1, 0, − 1) + a2 (1, 1, 1) + a3 (1, 2, 4)
a1 + a2 + a3 = x1 a1 + a2 + a3 = x1
a2 + 2a3 = x2 a2 + 2a3 = x2
− a1 + a2 + 4a3 = x3 a3 = ( x1 + x3 ) − 2 x2
a1 + a2 + a3 = x1 a1 = 2 x1 − 3x2 + x3
a2 + 2a3 = x2 a2 = −2 x1 + 5 x2 − 2 x3
2a2 + 5a3 = x1 + x3 a3 = x1 − 2 x2 + x3
35
Thus the set spans the space. 108
Case-II (linearly independent)
36
109
Example 20
Prove that the set B={(1, 3, -1), (2, 1, 0), (4, 2, 1)} is a basis for R3.
Solution
From the given set we see that,
dim(R3)=|B|=3.
It’s enough to show that, the set B is linearly independent or it spans R3.
Let us check for linear independence.
Suppose c1 (1, 3, − 1) + c2 (2, 1, 0) + c3 (4, 2, 1) = (0, 0, 0)
It can be expressed in the form of equations
c1 + 2c2 + 4c3 = 0
3c1 + c2 + 2c3 = 0
− c1 + c3 = 0
37
110
Solve this system of equations, we get
c1 + 2c2 + 4c3 = 0 c1 + 2c2 + 4c3 = 0
5c2 + 10c3 = 0 5c2 + 10c3 = 0
− c1 + c3 = 0 15c3 = 0
This system has the unique solution i.e. c1 = 0, c2 = 0, c3 = 0.
38
111
Application of Linear Algebra
Civil
Engineering 39
112
Application of Linear Algebra
In a population of rabbits. . .
Biology
40
113
Applications of Linear Algebra
Application 1: Constructing Curves and surfaces passing through Specified points
Application 5: Determinant
Application 6: Genetics
Application 7: Graph Theory
Application 8: Cryptography
https://www.math.ucdavis.edu/~daddel/linear_algebra_appl/Applications/appli
cations.html 41
114
Linear Algebra
(Post-Optimization)
• Sensitivity Analysis
• General stages of the solution
• Transportation Array
• Simplex method
2
115
Post-Optimization Problems: Sensitivity Analysis
Sensitivity Analysis:
116
The general stages of the solution of any mathematical-programming problem
There are five stages i.e.
117
118
Transportation Array
119
Methods
7
120
Solving Process
[Note: It is a balanced
transportation problem]
121
122
123
The role of digital computers in solving mathematical-programming problems
124
Simplex method
Problem:
Solution:
125
Solution:
126
127
128
129
130
Exercise
131
132