Download CHUNG-ANG UNIVERSITY Solutions to Problem Set #1 Answers to

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

Generalized linear model wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Relativistic quantum mechanics wikipedia , lookup

Mathematical optimization wikipedia , lookup

Mathematical descriptions of the electromagnetic field wikipedia , lookup

Routhian mechanics wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Navier–Stokes equations wikipedia , lookup

Least squares wikipedia , lookup

Computational fluid dynamics wikipedia , lookup

Perturbation theory wikipedia , lookup

Linear algebra wikipedia , lookup

Multiple-criteria decision analysis wikipedia , lookup

Inverse problem wikipedia , lookup

Simplex algorithm wikipedia , lookup

Computational electromagnetics wikipedia , lookup

System of polynomial equations wikipedia , lookup

Transcript
CHUNG-ANG UNIVERSITY
Linear Algebra
Spring 2014
Solutions to Problem Set #1
Answers to Practice Problems
Problem 1.1
Write a system of three linear equations in three unknowns that have:
(a) A unique solution,
(b) No solution,
(c) An infinite number of solutions.
Solution
For each part of this problem there are many possible answers. Here I give you one.
(a) A system of three equations in three unknowns with no solution is
x1
+
x2
x2
x2
+
+
+
x3
x3
x3
=
=
=
1
2
0
Clearly, the reason why this linear system is inconsistent is because it is impossible to find values for
x1 and x2 that will satisfy the last two equations.
(b) A linear system of three equations in three unknowns that has a unique solution may be formed by
modifying the system in part (a) as follows
x1
+
x2
x2
+
+
Note that the augmented matrix for this system is

1 1
 0 1
0 0
x3
x3
x3
=
=
=
1
2
0
in row echelon form,

1 1
1 2 
1 0
which shows that the solution is unique.
(c) A linear system of three equations in three unknowns that has an infinite number of solutions is
x1
+
x1
+
x2
x2
2x2
+
+
+
x3
x3
2x3
=
=
=
1
2
3
In this case, note that the third equation is equal to the first equation plus the second (as we will see
later, this says that the third equation is linearly dependent on the first two equations). Therefore,
when reducing the augmented matrix to row echelon form, one of the rows will be equal to zero, which
means that there is an infinite number of solutions.
Problem 1.2
Find the augmented matrix for each of the following linear systems,
(a)
−2x1 = 6
3x1 = 8
9x1 = −3
2x2
− 3x4 + x5 = 0
(b) −3x1 − x2 + x3
= −1
6x1 + 2x2 − x3 + 2x4 − 3x5 = 6
(c)
x1
x2
− x3
+ x4
=
=
4
2
Answer


6
8 
−3

2
−1
2
−2
(a) Answer:  3
9
0
(b) Answer:  −3
6
(c) Answer:
1
0
0
1
−1
0
0
1
−1
0
1
−3
0
2
4
2
1
0
−3

0
−1 
6
Problem 1.3
A pharmacist needs eight ounces of a solution that is 50% saline. What he has is a bottle of 60%
saline solution and a bottle of 20% saline solution. How many ounces of 60% saline solution and
20% saline solution must be mixed to obtain the mixture needed?
Answer
Two ounces of the 20% saline solution and six ounces of the 60% saline solution are required.
Problem 1.4
1. (True or False): If the reduced echelon form of the augmented matrix for a linear system has
a row of zeros, then the system must have an infinite number of solutions.
2. (True or False): If a linear system has more unknowns than equations, then it must have
infinitely many solutions.
3. (True or False): A homogeneous linear system will have a unique solution.
Answer
1. True
2. False
3. False
Problem 1.5
If A is an n × n matrix, how many different forms can the reduced row echelon for of the matrix
have? Give an example of each.
Answer

Two types.
1
 0
0
0
1
0

0
0 
1

and
1
 0
0
0
1
0

0
0 
0
Solutions to Regular Problems
Problem 1.1F
For each of the following row echelon forms of an augmented matrix for a linear system, find the
solution to the linear equations.


1 −3 4 7
1 2 2 
(a)  0
0
0 1 5


1 0 8 −5 6
(b)  0 1 4 −9 3 
0 0 1
1 2


1 7 −2 0 −8 −3
 0 0
1 1
6
5 

(c) 
 0 0
0 1
3
9 
0 0
0 0
0
0


1 −3 7 1
1 4 0 
(d)  0
0
0 0 1
Solution
(a) We want to solve a linear system that has an augmented matrix given by


1 −3 4 7
 0
1 2 2 
0
0 1 5
This corresponds to the following linear system,
x1
−
3x2
x2
+
+
4x3
2x3
x3
=
=
=
7
2
5
The solution to this system can be found by back-substitution. Specifically, the third equation gives
x3 = 5
Substituting this into the second equation and solving for x2 we have
x2 = −2x3 + 2 = −8
Finally, substituting the values for x2 and x3 into the first equation and solving for x1 we have
x1 = 3x2 − 4x3 + 7 = −37
So, the solution is
x1 = −37
;
x2 = −8
;
x3 = 5
Once we are done finding the solution, it is highly recommended that you substitute your solution
into each equation to verify that you have the right answer. You may also verify your answer using
MATLAB as follows,
>> rref([1 -3 4 7 ; 0 1 2 2 ; 0 0 1 5])
ans =
1
0
0
0
1
0
0
0
1
-37
-8
5
Therefore, we see that we have found the correct answer.
(b) Next, we want to solve the linear system that has an augmented matrix given by


1 0 8 −5 6
 0 1 4 −9 3 
0 0 1
1 2
We first note that there are fewer equations than unknowns and, therefore, if the equations are consistent, then there will be an infinite number of solutions. For this system, we see that the equations
are consistent since there is no row of the form [0 0 · · · 0 b ] with b 6= 0. The set of linear equations
corresponding to this augmented matrix is
x1
x2
+
+
8x3
4x3
x3
−
−
+
5x4
9x4
x4
=
=
=
6
3
2
We begin by noting that x4 is a free variable, so let’s call it α,
x4 = α
Now, we can solve for x3 using the third equation
x3 = 2 − x4 = 2 − α
Using the second equation we can solve for x2 ,
x2 = −4x3 + 9x4 + 3 = −4(2 − α) + 9α + 3 = 13α − 5
Finally, we may use the first equation to solve for x1 ,
x1 = −8x3 + 5x4 + 6 = −8(2 − α) + 5α + 6 = 13α − 10
So, the solution is
x1 = 13α − 10
;
x2 = 13α − 5
;
x3 = 2 − α
;
If we use MATLAB to solve this linear system, here is what we would get
x4 = α
>> rref([1 0 8 -5 6 ; 0 1 4 -9 3 ; 0 0 1 1 2])
ans =
1
0
0
0
1
0
0
0
1
-13
-13
1
-10
-5
2
and we can see that this represents the same solution that we obtained above.
(c) Given the following augmented matrix

1
 0

 0
0
7
0
0
0
−2
1
0
0
−8
6
3
0
0
1
1
0

−3
5 

9 
0
we see that we have five equations in four unknowns and, as we know, since these equations are
consistent, there will an infinite number of solutions. This augmented matrix corresponds to the
following linear system (we ignore the last row since it is all zero),
x1
+
7x2
−
2x3
x3
+
x4
x4
−
+
+
8x5
6x5
3x5
=
=
=
−3
5
9
So, we see that x2 and x5 are free variables, so we set
x2 = β
;
x5 = α
Now, from the third equation we have
x4 = 9 − 3x5 = 9 − 3α
and from the second equation
x3 = 5 − x4 − 6x5 = 5 − (9 − 3α) − 6α = −4 − 3α
and finally from the first equation
x1 = −3 − 7x2 + 2x3 + 8x5 = −3 − 7β + 2(−4 − 3α) + 8α = −11 − 7β + 2α
Therefore, our solution is
x1 = −11 − 7β + 2α
x2 = β
x3 = −4 − 3α
x4 = −9 − 3α
x5 = α
(d) In this part, we are given the augmented matrix

1 −3
 0
1
0
0
7
4
0

1
0 
1
which we recognize as one that corresponds to an inconsistent linear system since the last row is
[0 0 0 1] which says that 0 = 1, which is impossible. So for this linear system there are no solutions.
Problem 1.2F
Solve the following linear system
2x + 2y + 4z
w
− y − 3z
2w + 3x + y + z
−2w + x + 3y − 2z
=
=
=
=
2
0
3
1
Solution
In this problem, the augmented matrix is

0
 1

 2
−2
Performing elementary row operations to put it
and then proceed as follows,



1 0 −1 −3 0
1
 2 3

1
1 3 

 →  0
 −2 1
 0
3 −2 1 
0 2
2
4 2
0
2
0
3
1
2
−1
1
3

1
 0

 0
0

2
0 

3 
1
into row echelon form, we move the first row to the bottom,
0
3
1
2
−1
3
1
2
So, the row echelon form of the augmented matrix is

1 0 −1
 0 1
1

 0 0
0
0 0
0
and the reduced row echelon form is
4
−3
1
−2
0
1
0
0
−1
1
0
0
−3
7
−8
4
−3
7/3
1
0
0
0
1
0

0
3 

1 
2

→
1
 0

 0
0
0
3
0
0
−1
3
0
0
−3
7
−31
−20

0
3 

0 
0

0
1 

0 
0

0
1 

0 
0
Since y is a free variable, we set y = α, where α can be any real number. Using the reduced row echelon
form of the equations, we see from the third equation that z = 0, and from the second equation that
x+y =1
so x = 1 − α. Finally, from the first equation we have
w−y =0
or w = α. So, we have an infinite number of solutions, and the solution consists of all points that lie along
a line that is defined by the equations
w=α
x=1−α
y=α
z=0
Problem 1.3F
Solve the following linear system
x1 − x2 + 7x3 + x4 = 0
x1 + 2x2 − 6x3 − x4 = 0
Solution
To solve this linear system, we form the augmented matrix
x1
x1
−
+
x2
2x2
+
−
7x3
6x3
+
−
x4
x4
=
=
0
0
−→
1
1
−1
2
7
−6
1
−1
0
0
and find its row echelon form, which is
1
0
−1
3
7
−13
1
−2
0
0
Since x3 and x4 are free variables, let
x3 = α
x4 = β
The second equation may then be used to solve for x2 ,
3x2 = 13x3 + 2x4 = 13α + 2β
or
x2 =
13
α
3
+ 23 β
The first equation may then be used to solve for x1 ,
x1 = x2 − 7x3 − x4 = ( 13
α + 23 β) − 7α − β = − 83 α − 13 β
3
Problem 1.4F
Find the coefficients a, b, c, and d of a cubic equation
y = ax3 + bx2 + cx + d
that passes through the following four points, (x, y):
(0, 10),
(3, −10),
(1, 8),
(4, −14)
This is an example of the problem of fitting a polynomial to some data (set of points). Later, we
will be looking at the more interesting problem of finding the polynomial that forms the best fit to a
set of data points where the number of data points is much larger than the order of the polynomial.
This is an important problem in function approximation and in signal or data modeling applications.
Solution
We want to find values for a, b, c, and d such that the polynomial
y = ax3 + bx2 + cx + d
passes through four the points:
(0, 10),
(1, 8]),
(3, −10),
(4, −14)
From these four constraints we can write down four equations in the four unknowns, a, b, c, d, and then solve
for these unknowns. More specifically, since we want the polynomial to pass through the point (0, 10), then
setting x = 0 and y = 10 in the polynomial we have
10 = d
Similarly, since we want the polynomial to pass through the point (1, 8), then setting x = 1 and y = 8 in
the polynomial we have
8=a+b+c+d
Doing the same for the last two points, we have two more equations,
−10 = 27a + 9b + 3c + d
−14 = 64a + 16b + 4c + d
These four equations may be represented by the augmented matrix


1
1 1 1
8
 27 9 3 1 −10 


 64 16 4 1 −14 
0
0 0 1
10
Using MATLAB to find the reduced row echelon form, we have
>> rref([1 1 1 1 8; 27 9 3 1 -10; 64 16 4 1 -14 ; 0 0 0 1 10])
ans =
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
1.0000
-6.3333
3.3333
10.0000
Therefore, the solution for a, b, c, and d, is
a = 1.0000
b = −6.3333
c = 3.3333
d = 10.0000
and our polynomial equation is
y = x3 − 6.3333x2 + 3.3333x + 10
We may use MATLAB to plot this function, which is shown in the figure below for values of x over the
interval [0, 4]. The four points that the polynomial is forced to pass through are shown by the circles on the
plot.
15
10
5
0
−5
−10
−15
0
0.5
1
1.5
2
2.5
3
3.5
4
If we are interested in seeing what this function might look like for values of x outside the interval [0, 4],
as we might wish to do for problems such as data extrapolation, shown in the figure below is the polynomial
over the interval [−5, 15]. As we see, for values of x outside the interval [0, 4], the function grows rapidly in
magnitude. This is a feature of polynomials, and is one that needs to be understood and considered when
using polynomials to fit data.
500
400
300
200
100
0
−100
−200
−300
−5
0
5
10