You are on page 1of 16

Cramer’s Rule

VIVIANA MARCELA BAYONA CARDENAS


Coefficient Matrices
You can use determinants to solve a
system of linear equations.
You use the coefficient matrix of the
linear system.
Linear System Coeff Matrix
ax+by=e a b 
cx+dy=f c d 
 
Cramer’s Rule for 2x2
System
 Let A be the coefficient matrix
 Linear System Coeff Matrix
ax+by=e a b 
cx+dy=f c d 
 

 If detA  0, then the system has exactly one


solution:

e b a e
f d c f
x and y
det A det A
Example 1- Cramer’s Rule
2x2
Solvethe system:
8x+5y=2
2x-4y=-10

The coefficient matrix is: 8 5  8 5


 2  4
and  (32)  (10)  42
  2 4

So:
2 5 8 2
 10  4 and
2  10
x y
 42  42
2 5
 10  4  8  (50) 42
x    1
 42  42  42

8 2
2  10  80  4  84
y   2
 42  42  42

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 x4
 Cramer’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.
Cramers rule

Suppose you have the system of equations,


Ax = b.  a  a  x   b 
11 1n 1 1
   
          
a a  x   b 
 n1  nn  n   n
 a11  b1 
Define the matrix  Ai as the  result of
An      
replacing in the
a
ith column
of A with b:
 n1  bn 
Example 1.
 1 1 x1   4   4 1
      so A1   
 2 1 x2   3   3 1
Example 2.
2. Cramers rule

Suppose you have the system of


equations,Ax = b, then, if det. A≠ 0,
Ai
xi 
A

Example 2. (Recall that the solution to this


1 1
system was x = 4 1x = 5.)
-1, 1 4
det . A    1 det A1 
1  1; det A2 
2  5
2 1 3 1 2 3

So x1 = 1/-1 = -1 and x2 = -5/-1 = 5.


Cramer’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 + G
2. C = a + bY 0 < b < 1
3. I = I0
4. G = G0
Write 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 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 equations
1.Y = C + I0 + G0
2.C = a + bY.
Rewrite:  1  1 Y   I 0  G0 
1.Y - C = I0 + G0 
  b 1  C    a 
2.C – bY= a     
Step 3. Put into matrix form.
Matrix form:
Cramer’s rule in macroeconomics
Step 4. then use Cramer’s rule
 1  1 Y   I 0  G0 
     
  b 1  C   a 
So, to find C we replace the second column of the
matrix with the column vector of parameters.

1 I 0  G0
b a a  b( I 0  G0 )
C 
1 1 1 b
b 1
Quiz II. Find Y using the same procedure.
Some guidance on solving mxn equation
systems.
 The general problem involves m equations and n
unknowns.
 Many systems of equations involve fewer equations
than variables, m<n
 Some involve more equations than variables, n <
m.
 In either case you cannot use matrix inversion to
characterise the solution (if it exists).
 x1 
Example.   
0 1 1 1  x 
     2 
 1  1 0  1 x 
 3

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.
Some guidance on solving mxn equation
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. 1 1  1
A   
1 1  1
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.
Some guidance on solving mxn equation
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.

0 1 0
 
A   0  2  1
 0  1  1
 
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?
Some guidance on solving mxn equation
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
solution
ii. 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.
REFERENCE

You might also like