Cramer’s Rule
Transcript of Cramer’s Rule
Cramer’s RuleCramer’s RuleVIVIANA MARCELA BAYONA CARDENAS
Coefficient MatricesCoefficient Matrices
You can use determinants to solve a system of linear equations.
You use the coefficient matrix of the linear system.
Linear System Coeff Matrixax+by=e
cx+dy=f
dc
ba
Cramer’s Rule for 2x2 Cramer’s Rule for 2x2 SystemSystem
Let A be the coefficient matrix Linear System Coeff Matrix
ax+by=ecx+dy=f
If detA 0, then the system has exactly one solution:
A
df
be
xdet
and
A
fc
ea
ydet
dc
ba
Example 1- Cramer’s Rule Example 1- Cramer’s Rule 2x22x2
Solve the system:8x+5y=22x-4y=-10
42
5842)10()32(
42
58
The coefficient matrix is:and
So:
42
410
52
xand
42
102
28
y
142
42
42
)50(8
42
410
52
x
242
84
42
480
42
102
28
y
Solution: (-1,2)
Learning objectives. By the end of this lecture you should:
◦ Know Cramer’s rule◦ Know more about how to solve linear equations
using matrices.
1. Introduction: Cramer’s rule. Often when faced with Ax=b we are not
interested in a complete solution for x.We may only wish to find x1 or x4Cramer’s rule is a short cut for finding a
particular xi. It’s particularly useful when A is 3x3 or bigger.
It is not sensible to use it if you need to find several xis – finding A-1 is then generally quicker.
Suppose you have the system of equations,Ax = b.
Define the matrix Ai as the result of replacing in the ith column of A with b:
Example 1.
Example 2.
Cramers ruleCramers rule
nnnnn
n
b
b
x
x
aa
aa
11
1
111
nn
n
ba
ba
A
1
111
13
14
3
4
12
111
2
1 Asox
x
Suppose you have the system of equations,Ax = b, then, if det. A≠ 0,
Example 2. (Recall that the solution to this system was x1 = -1, x2 = 5.)
So x1 = 1/-1 = -1 and x2 = -5/-1 = 5.
2. Cramers rule2. Cramers rule
A
Ax ii
532
41det;1
13
14det1
12
11.det 21 AAA
Cramer’s rule in macroeconomicsCramer’s rule in macroeconomics
Many macro models involve a system of linear equations.
Cramer’s rule can be used to solve for one particular variable.
Example. Suppose 1. Y = C + I + G2. C = a + bY 0 < b < 13. I = I04. G = G0Write this system in matrix form then use Cramer’s rule to
find consumption, C.
Step 1: identify the endogenous variables and the exogenous variables. The endogenous variables correspond to the x vectors in the previous example. The exogenous variables (the parameters of the system) correspond to the b vector.
Example: here C and Y are endogenous. I0 and G0 are the exogenous variables.
Cramer’s rule in macroeconomicsCramer’s rule in macroeconomics
Step 2: Simplify the system of equations if possible then write down the system in such a way that all the endogenous variables are on one side of the equation and all the exogenous variables are on the other side.
Example: simplify the equations1.Y = C + I0 + G02.C = a + bY.Rewrite:1.Y - C = I0 + G02.C – bY= a
Step 3. Put into matrix form.Matrix form:
a
GI
C
Y
b00
1
11
Cramer’s rule in macroeconomicsCramer’s rule in macroeconomics
Step 4. then use Cramer’s rule
So, to find C we replace the second column of the matrix with the column vector of parameters.
Quiz II. Find Y using the same procedure.
a
GI
C
Y
b00
1
11
b
GIba
b
ab
GI
C
1
)(
1
11
1
00
00
Some guidance on solving mxn equation Some guidance on solving mxn equation systems.systems.The general problem involves m equations and n
unknowns.Many systems of equations involve fewer
equations than variables, m<nSome involve more equations than variables, n <
m. In either case you cannot use matrix inversion to
characterise the solution (if it exists).
Example.
When m ≠ n we seek to do two things:1. Find out if any solution exists.2. If at least one solution exists, identify its features.
3
2
1
101
111
1
0
x
xx
Some guidance on solving mxn equation Some guidance on solving mxn equation systems.systems.Definition: The rank of a matrix is the largest
number of linearly independent rows or columns.
Note that the column rank and the row rank will be the same.
Note that the rank cannot be larger than the smaller of m and n. i.e. if A is an mxn matrix rank(A) ≤ min(m,n)
Example.
The rank of this matrix is at most 2, but in fact rank(A) = 1.
The rank of a matrix provides a guide to number of solutions.
111
111A
Some guidance on solving mxn equation Some guidance on solving mxn equation systems.systems.Note that for an nxn matrix (det A = 0) ↔ rank(A) < n.
We can see ← from the properties of determinants. If rank(A) < n we can add and subtract rows to create a row of zeros. The determinant of this new matrix is therefore 0, but by property 5 adding and subtracting rows does not change the determinant. So det(A) = 0.
Example. A obviously has rank of less than 3 because the third row equals the sum of the two other rows. What is its determinant?
110
120
010
A
Some guidance on solving mxn equation Some guidance on solving mxn equation systems.systems.
1. Find the rank of the system. Note that the maximum possible rank is n.i. If rank(A) = n, then there may be a unique
solutionii. If rank(A) < n then there cannot be a
unique solution.
2. Check consistency (i.e. the absence of contradictions)i. If the system is consistent and rank(A) = n
then there is exactly one solution. ii. If the system is consistent and rank(A) < n
then there are multiple solutions.
REFERENCEREFERENCE