An elementary row operation on a matrix is any of the
following:
i) Multiply one row by a nonzero number.
ii) Add a multiple of one row to another row.
iii) Interchange two rows.
Two matrices are said to be row-equivalent if one can be obtained from the other by a series of elementary row operations.
A matrix is in row echelon form if
i) All rows consisting of all zeros appear at the bottom of the matrix.
ii) The first nonzero element of each row is 1 (called a leading 1).
iii) In successive nonzero rows, the leading 1 in the lower row appears
to the right of the leading 1 in the higher row.
The matrix is said to be in reduced row echelon form if,
in addition to the three properties above, we have
iv) In any column containing a leading 1, all other elements are zero.
The matrix form for a system of linear equations Ax = b
can be represented by the augmented matrix
( in MATLAB, [A b] ). To solve a system of
equations in matrix form, either of two methods may be used:
A MATLAB session is given below for a sample augmented matrix:
» A=[1 2 8; 2 4 16; 0 1 3]; B = [7;14;4];Enter augmented matrix form for system.
» AUG = [A B]
AUG =
1 2 8 7
2 4 16 14
0 1 3 4
» rref(AUG)
Compute the row reduced echelon form.
ans =
Consistent -- two nonzero rows so rank = 2
1 0 2 -1 for both A and AUG.
0 1 3 4
0 0 0 0
» rank(A)
Just confirming ranks are equal to 2.
ans =
Since rank 2 < number of unknowns 3,
2
there are many solutions. Since 3-2 =1,
we have a 1-parameter family of solutions.
» rank(AUG)
ans = 2
The above row-reduced echelon form for the augmented matrix represents the following system of three equations in three unknowns:

We let x3 = r and use back substitution
to get the general solution
x1 = -1-2r; x2
= 4-3r, x3 = r
1. Practicing elementary row operations
To refer to the ith row of a matrix A in MATLAB,
use A(i,:). For example, A(3,:) is the third row of
A. Perform elementary row operations on A as follows:
i) To multiply one row by a nonzero scalar c, use
>> A(i,:) = c*A(i,:)
Example: To add 2 times row 1 to row 2 of A use
iii) To interchange the ith and jth row use
>> format rat
Enter the matrix A below. Original matrix:
A =
You can see a "movie" of row-reduction on a matrix by using MATLAB's
rrefmovie
function .
Enter the command rrefmovie(A)
Interpret each of the matrices below as an augmented matrix AUG = [A b] representing a linear system of equations. Using the MATLAB function rref(AUG), compute the row-reduced echelon matrix form for the augmented matrix. For each system, specify whether it is consistent or inconsistent. If consistent, specify whether the system has a unique solution or many solutions (using rank and the rules on rank given in the Background Section). Then give the solution, assuming unknowns x1, ..., xn, where n is the number of columns of A. If there are many solutions, give the solution as the variables corresponding to columns with leading 1's (the dependent variables) in terms of the variables corresponding to columns without leading ones (the free variables).
a) AUG =
rref(AUG)
=
Rank _______ Number of unknowns ______ Consistent or inconsistent? (Circle)
General solution: __________________________________________________
b) AUG =
rref(AUG)
=
Rank _______ Number of unknowns ______ Consistent or inconsistent? (Circle)
General solution: __________________________________________________
c) AUG =
rref(AUG)
=
Rank _______ Number of unknowns ______ Consistent or inconsistent? (Circle)
General Solution: __________________________________________________
d) AUG =
rref(AUG)
=
Rank _______ Number of unknowns ______ Consistent or inconsistent? (Circle)
General solution: __________________________________________________
e) AUG =
rref(AUG) =
Rank _______ Number of unknowns ______ Consistent or inconsistent? (Circle)
General solution: __________________________________________________
|
|
|
|
(g) |
(g) |
(g) |
| Fruit Salad |
|
|
|
|
|
| Pasta Primavera |
|
|
|
|
|
| French Bread |
|
|
|
|
|
| Glazed Carrots |
|
|
|
|
|
| Salmon |
|
|
|
|
|
a) Letting f, p, b, c and s represent the portions of servings of fruit salad, pasta, bread, carrots, and salmon that will comprise the athlete's dinner, set up the system of equations that would have to be solved to reach the goal of a total of 1150 calories, 75 g of protein, 133 g of carbohydrates, and 25 g of fat.
b) Set up in MATLAB the augmented matrix form of this system and bring it into row-reduced echelon form.
What is the rank of this matrix?_______ How many unknowns are there?_______ Since this indicates a one-parameter family of solutions, we are free to let one of the items be any portion size (with the restriction that each portion be ³ 0 ). Write down the general solution for each menu item in terms of the portion of salmon, s.
f = ___________ p = ___________ b = ___________ c = _____________
Given that the athlete wants two serving portions of salmon (s = 2), what are the portions (and number of ounces) that should be served for the other menu items?
Fruit Salad _________________ Pasta Primavera ____________________
French Bread ________________ Glazed Carrots _____________________