Download 1. Systems of Linear Equations [We will see examples of how linear

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Elementary algebra wikipedia , lookup

Location arithmetic wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

System of polynomial equations wikipedia , lookup

Partial differential equation wikipedia , lookup

System of linear equations wikipedia , lookup

Transcript
1. Systems of Linear Equations
[We will see examples of how linear equations arise here, and how they are
solved:]
Example 1:
In a lab experiment, a researcher wants to provide a rabbit 7 units of
vitamin A, and 10 units of vitamin C. She has two foods, Food 1 and
Food 2 to give them. Each gram of food 1 contains 3 units of vitamin
A, and 4 units of vitamin C. Each gram of food 2 contains 1 unit of
vitamin A and 2 units of vitamin C. How many grams of each food
should the rabbit be fed?
Solution:
Let
B" œ the number of grams of food 1
B# œ the number of grams of food 2
Then
total number of units of vitamin E œ $B"  "B#
total number of units of vitamin G œ %B"  #B#
Thus have:
$B"  "B# œ (
(1)
%B"  #B# œ "!
(2)
To solve for B" and B# ß follow Gaussian elimination process:
1. Get 1 in first position of first equation (multiply both sides by 1/3)
B"  "$ B# œ
(
$
%B"  #B# œ "!
(3) œ "Î$ † (1).
(2)
2. Eliminate all terms underneath the first one in the first equation
(multiply first equation by % and add to second equation)
Ð  %B"  %Î$ B# œ  #)Î$Ñ
B"  "3 B# œ
%B"  #B# œ "!
7
3
B"  3" B# œ 7#
!  #Î$ B# œ #Î$
Ê
B# œ "à
Ä
B" 
"
#
œ
&
#
(3)
(2)
(3)
(4)
B" œ #
[Thus feed 2 ounces of food 1 and 1 ounce of food 2.]
Definition 3:
An equation is linear in the variables B" ß B# ß á ß B8 if it is of the form
+" B"  +# B#  á  +8 B8 œ ,ß
where +" ß +# ß á ß +8 and , are given constants.
[as in the above example]
A collection of such equations is called a system of linear
equations.
A set of fixed numbers B" ß B#ß á ß B8 which makes all of the
equations true is called a solution of the system.
Example 2 (Input-Output Analysis in economics):
An economy is divided into three sectors: Coal, Steel, Electricity.
Each industry depends on the others for raw materials.
To make $1 of coal, takes no coal, $.10 of steel, $.10 of electricity.
To make $1 of steel, it takes $.20 of coal, $.10 of steel, and $.20 of
electricity.
To make $1 of electricity, it takes $.40 of coal; $.20 of steel, and $.10
of electricity.
If we want the economy to output $1 billion of coal, $.7 billion of steel,
and $2.9 billion of electricity, how much coal, steel, and electricity will
we need to use up?
Let
B" œ total amount of coal produced
B# œ total amount of steel produced
B$ œ total amount of electricity produced
Then: since we produce B" dollars of coal, we use:
! † ÐB" Ñ of coal
ÐÞ"!Ñ † ÐB" Ñ of steel
ÐÞ"!Ñ † ÐB" Ñ of electricity
Since we produce B# dollars of steel, we use:
Þ#! † ÐB# Ñ of coal
Þ"! † ÐB# Ñ of steel
Þ#! † ÐB# Ñ of electricity
Since we produce B3 dollars of electricity, we use:
Þ%! † ÐB$ Ñ of coal
Þ#! † ÐB$ Ñ of steel
Þ"! † ÐB$ Ñ of electricity
Thus, the amount of coal output =
(amount of coal produced) - (amount of coal used)
œ B"  ! † B"  Þ# † B#  Þ% † B$
œ B"  Þ#B$  Þ%B$
Similarly, amount of steel output =
(amount of steel produced) - (amount of steel used)
œ B#  Þ"B"  Þ"B#  Þ#B$
œ  Þ"B"  Þ*B#  Þ#B$
And amount of electric output is, similarly:
B$  Þ"B"  Þ#B#  Þ"B$
œ  Þ"B"  Þ#B#  Þ*B$
Thus we have:
B"  Þ#B#  Þ%B$ œ "
 Þ"B"  Þ*B#  Þ#B$ œ Þ(
 Þ"B"  Þ#B#  Þ*B$ œ #Þ*
To solve for B"ß B#ß B $
[generalization of above method]
Step 1:
Make sure that coefficient of B" in first row is 1
[it is]
Step 2:
Clear out B" coefficients below the first B" À
[Below we can keep tabs on the equations using an augmented matrix;
then just work with the matrix]
Multiply first row by .1 and add to second row;
ÐÞ"B"  Þ!#B#  !Þ%B$ œ Þ"Ñ
B"  Þ#B#  Þ%B$ œ "
(1)
 Þ#  Þ% l " ×
Ô "
Þ*
 Þ# l Þ(
 Þ"B"  Þ*B#  Þ#B$ œ Þ( (2) or  Þ"
Õ  Þ"  Þ#
Þ*
l #Þ* Ø
ðóóóóóóóóóóóóóóóóñóóóóóóóóóóóóóóóóò
 Þ"B"  Þ#B#  Þ*B$ œ #Þ* (3)
augmented matrix
ÐÞ"B"  Þ!#B#  !Þ%B$ œ Þ"Ñ
B"  Þ#B#  Þ%B$ œ "
(1)
!B"  Þ))B#  Þ#%B$ œ .) (4) œ (2)  Þ" † (1)
 Þ"B"  Þ#B#  Þ*B$ œ #Þ*
(3)
or
Ô "
!
Õ  Þ"
 Þ#
Þ))
 Þ#
 Þ%
 Þ#%
Þ*
l " ×
l Þ)
l #Þ* Ø
Multiply first row by .1 and add to third row:
ÐÞ"B"  Þ!#B#  !Þ%B$ œ Þ"Ñ
Ê
B"  Þ#B#  Þ%B$ œ "
!B"  Þ))B#  #%B$ œ )
!B"  Þ##B#  Þ)'B$ œ $
(1)
(4)
(5) œ (3)  Þ" † (1)
or
Ô"
!
Õ!
 Þ#
Þ))
 Þ##
 Þ%
 Þ#%
Þ)'
Step 3:
Make sure coefficient of B# in second row is 1: multiply row 2 by
l
l
l
1
.88 :
"×
Þ)
$Ø
B"  Þ#B#  Þ%B$ œ "
(1)
"
!B"  B#  Þ#(#(B$ œ Þ*!*" (6) œ (4) † Þ))
(5)
!B"  Þ##B#  Þ)'B$ œ $
Ô "  Þ#
!
"
or
Õ !  Þ##
 Þ%
 Þ#(#(
Þ)'
l
l
l
" ×
Þ*"
$ Ø
Step 4:
Clear coefficients below x2 in second row:
Multiply second row by .22 and add to third row:
B"  Þ#B#  Þ%B$ œ "
Ð!B"  Þ##B#  Þ!'!!B$ œ Þ#!!!Ñ
!B"  B#  Þ#(#(B$ œ Þ*!*"
!B"  !B#  Þ)!!!B$ œ $Þ#!!
or
(1)
(6)
(7) = (5) + (6) † ##
Ô"
!
Õ!
 Þ#
"
!
 Þ%
 Þ#(#(
Þ)
l
l
l
Step 5:
Make sure coefficient of B$ in third row is 1:
Multiply third row by .81 :
B"  Þ#B#  Þ%B$ œ "
!B"  B#  Þ#(#(B$ œ Þ*!*"
!B"  !B#  B$ œ %
Ô"
or !
Õ!
(1)
(6)
(7) œ (5) †
 Þ#
"
!
"
Þ)!!!
 Þ%
 Þ#(#(
"
l " × "
l Þ*"
6
l % Ø 7
Thus have B$ œ %à plug into second equation to get B# œ #à
Plug into first equation to get B" œ $Þ
However, we can alternately continue:
" ×
Þ*"
$Þ#!! Ø
Ô"
!
Õ!
Þ#
"
!
Ô"
!
Õ!
0
"
!
!
!
"
#Þ' ×
"  Þ% † 7 œ 8
#
6  Þ#(#( † 7 œ 9
Ø
%
7
l
l
l
!
!
"
l
l
l
3 × 8  Þ2 † 9 œ 10
#
9
Ø
%
7
Giving same values for B3 .
Conclusion: if we want to output 1, .8 and 2.9 billion dollars worth of
coal, steel, and electricity, we have to produce 3, 2, and 4 billion
dollars of these respectively.
This is called Gaussian Elimination.
[note that larger numbers of components in economies will require
larger numbers of variables in the system]
General system of equations:
+"" B"  +"# B#  á  +"8 B8 œ ,"
+#" B"  +## B#  á  +#8 B8 œ ,#
+$" B"  +$# B#  á  +$8 B8 œ ,$
ã
+7" B"  +7# B#  á  +78 B8 œ ,7
[note the +34 are just names for constants; the theory of what can
happen to such systems of equations motivates linear algebra and lots
of mathematics.]
2. An example where the number of solutions is infinite:
B"  #B#  %B$ œ %
Ê
"
” "
#
%
%
#
l
l
%
(1)
•
 ' (2)
B" + %B#  #B$ = '
"
Ê ”
!
#
#
%
#
l
l
%
 #•
"
”!
#
"
%
"
l
l
%
 "•
Ê
[write out again:]
(1)
(3) œ (2)  (1)
(1)
"Î# † (3) œ (4)
B"  #B#  %B$ œ %
!B"  B#  B$ œ  "
Equivalently:
B" œ %  #B#  %B$
B# œ  "  B$
Equivalently [note all steps are reversible]:
B" œ %  #Ð  "  B$ Ñ  %B$
B# œ  "  B$
Equivalently:
B" œ #  'B$
B# œ  "  B$
Notice that here B$ can be any number, and then B" and B# are
determined in terms of it. Solution:
B" œ #  'B$
B# œ  "  B$
B$ œ any number
[for example B$ œ "ß B# œ #ß B" œ % will work]
Definition 4: A variable like B$ in terms of which other variables are
defined is known as a free variable.
Example with no solutions:
B"  #B# œ %
"
” 2
Ê
#
%
l
l
%
(1)
•
'
(2)
2B"  %B# = '
"
Ê ”
!
#
!
[write out again:]
l
l
%
#•
(1)
(2)  2 † (1) œ (3)
B"  #B# œ %
!B"  !B# œ #
system is inconsistent, i.e., it has no solutions.
Note: last row has the form:
c!
!
!
l
#d
[can see this by looking at graphs of the two original equations: The
lines B"  #B# œ % and 2B"  %B# = ' are parallel and have no
intersection; hence no common solution of the equations:]
Theorem 2: A system of linear equations is consistent (i.e., it has a solution) if
and only if no row of the reduced matrix has the form
c!
!
á
!
l
,d
where , is a non-zero number. If the system is consistent it has either a unique
solution if there are no free variables, or an infinite number of solutions if there
is at least one free variable.
Sketch of Proof: in book
3. Terminology:
Def 5: A system of equations is consistent if it has some solution; it is
inconsistent if there is no solution.
A linear system in which the right hand sides are all zero is a
homogeneous system.
[Ex: B"  $B# œ !;
 B"  $B# œ !]
Two systems are equivalent if they have exactly the same sets of
solutions B" ß á ß B8 , i.e. if every set of B" ß á ß B8 which solves the
first system also solves the second.
4. Matrices:
[Have seen example above.]
Definition 6: A matrix is a rectangular array of numbers.
Ô
$
%
Õ  ""
Example 3:
"Î#
(
"#
$Î#
)
&
 &×
*
$ Ø
[Have seen these things; all will be done by example:]
Addition:
"
”%
"
 $Î#
$
"
”
•
#
#
"
&
#
!
œ”
•
%
#
!
 "$Î#
&
'•
[i.e., add corresponding entries]
Scalar multiplication (multiplication by a constant):
$†”
#
$
"
%
&
'
œ ”
•
 "Î#
*
$
 "#
"&
$Î# •
Multiplication: [note that the number of columns in first matrix must be
number of rows in second]
#
” "
#
"
Ô #
"
#
‚
$•
Õ "
"Î# ×
*
"
œ ”
"
% Ø
1. Review of solving systems by elimination:
Example 1:
#B  $C  %D œ )
B  #C  D œ !
$B  C  #D œ ""
$
Þ
#&Î# •
Recall: standard procedure is Gaussian elimination:
Ô#
"
Õ$
$
#
"
Ô"
"
Õ$
 $Î#
#
"
%
"
#
l
l
l
#
"
#
) ×
!
"" Ø
% ×
!
"" Ø
l
l
l
Ô"
Ä !
Õ!
 $Î#
 "Î#
""Î#
#
"
%
l
l
l
% ×
%
"Ø
Ô"
Ä !
Õ!
 $Î#
"
""Î#
#
#
%
l
l
l
% ×
)
"Ø
Ô"
Ä !
Õ!
 $Î#
"
"
#
#
 )Î""
Ô"
!
Ä
Õ!
 $Î#
"
!
#
#
 $!Î""
Ô"
!
Ä
Õ!
 $Î#
"
!
#
#
"
l
l
l
%
×
)
 #Î"" Ø
l
l
l
l
l
l
%
×
)
 *!Î"" Ø
%×
)
$Ø
[called row echelon form; can now solve for B3 ]
[can go further: reduced row echelon form]:
Ô"
!
Ä
Õ!
Ô"
!
Ä
Õ!
 $Î#
"
!
!
"
!
!
!
"
l
l
l
!
!
"
l
l
l
#×
#
$ Ø
"×
#
$Ø
[note difference between echelon and reduced echelon forms]
Definition 1: The process of reducing a matrix to echelon form is
Gaussian elimination; the process of reducing it to reduced echelon
form is Gauss-Jordan elimination.
[then can read off B3 more easily]
Elementary Row Operations:
1. Interchange rows: Type I
2. Multiply a row by non-zero constant: Type II
3. Add - times row 3 to row 4: Type III
Definition 2: A matrix is in row echelon form if:
(1) All rows of 0s are at the bottom
(2) The first nonzero entry in the first row is a 1
(3) For two successive rows the first entry on the second row is to the
right of the first entry on the first row.
A matrix is in addition in reduced row echelon form if also:
(4) For any column which contains the leading entry of some row, all
of the other entries in that column are 0.
Definition 3: A matrix is row equivalent to F if it can be obtained
from F through a series of ERO's.
FOR NOW: Proof of the following theorem is deferred till later.
Theorem 3: Every matrix is row equivalent to one and only one
matrix in reduced echelon form.
Proof: This proof is given in Appendix A; it will follow after we
have covered the theory of Chapter 4.
Theorem 4: If two systems have row equivalent augmented matrices,
they are equivalent.
Proof: Since we can get from one system to the second by ERO,
every solution of the first system must solve the second. Since we can
reverse the ERO to get from the second to the first, it follows that every
solution of the second must solve the first. Thus the systems are
equivalent. …
Definition 4: Row reduction is the process of applying elementary
row operations to obtain the row echelon or reduced row echelon form
of a matrix.
Typical form of augmented matrix after row reduction:
Ô"
Ö!
Ö
!
Õ!
#
!
!
!
$
"
!
!
"
$
"
!
"
#
&
!
"
"
%
!
$
#
$
"
"
"
#
#
l $×
l "Ù
Ù
l "
l #Ø
General form of corresponding system:
B"
 #B#
 $B$
B$
 B%
 $B%
B%
 B&
 #B&
 &B&
 B'
 B'
 %B'
 $B(
 #B(
 $B(
B(
 B)
 B)
+#B)
 #B)
œ
œ
œ
œ
$
"
"
#
Definition 5: The leading entry in each row is called a pivot entry. The columns
containing pivot entries are called pivot columns.
Exercise: Now solve for the pivot variables in terms of the non-pivot variables;
note this can be done easily at this point
[nevertheless - note this can be hard for large systems]
[So: get into reduced row echelon form]
Ô"
Ö!
Ö
Ö!
Ö
!
Õ
#
!
!
!
$
"
!
!
"
$
"
!
"
#
&
!
"
"
%
!
!
!
!
"
(
$
)
#
$×
$Ù
Ù
&Ù
Ù
#
Ø
l
l
l
l
Ä
Ô"
Ö!
Ö
!
Õ!
#
!
!
!
$
"
!
!
!
!
"
!
%
"$
&
!
$
 ""
%
!
!
!
!
"
"
 #"
)
#
l
l
l
l
Ä
Ô"
Ö!
Ö
!
Õ!
#
!
!
!
!
"
!
!
!
!
"
!
$&
"$
&
!
$!
 ""
%
!
!
!
!
"
'#
 #"
)
#
l $%
l "#
l &
l
#
Pivot entries in 1st, 3d, 4th, 7th columns Ê
Ê remaining (free) variables B# ß B& ß B' ß B) Þ
Now system is:
#
"#
&
#
×
Ù
Ù
Ø
×
Ù
Ù
Ø
pivot variables: B" ß B$ ß B% ß B(
B"
 #B#
 0B $
B$
 0B%
 !B%
B%
 35B&
 "$B&
 &B&
 30B'
 ""B'
 %B'
 0B(
 !B(
 !B(
B(
 '#B)
 #"B)
 )B)
 #B)
Express pivot variables in terms of free ones:
B"
B$
B%
B(
œ
œ
œ
œ
#B#
 35B&
"$B&
&B&
 30B'
 ""B'
 %B'
 '#B)
 #"B)
 )B)
#B)
 $%
 "#
&
#
[General solution: pick any values for free variables; pivot (non-free)
values are determined]
œ
œ
œ
œ
$%
"#
&
#