Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Cramer’s Rule

Cramer‟s rule is a method of solving a system of linear equations through the use of
determinants.

Matrices and Determinants

To use Cramer‟s Rule, some elementary knowledge of matrix algebra is required. An


array of numbers, such as

6 5 a11 a12
A= 
3 4 a21 a22

is called a matrix. This is a “2 by 2” matrix. However, a matrix can be of any size, defined by
m rows and n columns (thus an “m by n” matrix). A “square matrix,” has the same number of
rows as columns. To use Cramer‟s rule, the matrix must be square.

A determinant is number, calculated in the following way for a “2 by 2” matrix:

a11 a12
A = = a11 a22 - a21 a12
a21 a22

For example, letting a11 = 6, a12 = 5, a21 = 3, a22 = 4:

6 5
A= = 6 (4) - 3 (5) = 9
3 4

For “m by n” matrices of orders larger than 2 by 2, there is a general procedure that can be
used to find the determinant. This procedure is best explained as an example. Consider the
determinant for a 3 by 3 matrix

a11 a12 a13


A = a21 a22 a23
a31 a32 a33
The determinant A is calculated as follows:

a22 a23 a31 a23 a21 a22


A = a11 - a12 + a13
a32 a33 a31 a33 a31 a32

note the sign change

A = a11 (a22 a33 - a23 a32) - a12 (a21 a33 - a23 a31) + a13 (a21 a32 - a22 a31)

Sign change (like a “2 by 2” matrix)

Note: Sign changes alternate, following the order: positive, negative, positive, negative, etc.

The determinant of the 3 by 3 matrix is the sum of three products. The first step is to
understand the placement of the elements from the matrix into the determinant equation. This
is done by:

1. The three products to be summed correspond to the three elements along the top
row of the matrix (this would be a11, a12, a13).

2. Now, imagine a line that goes though the top row of elements (see the model
below).

3. Beginning at a11, imagine, too, a line through the first column (Figure 1).

4. The 4 remaining elements are used to construct a new “2 by 2” matrix, and the
element a11 is used to form the first of the three parts of the calculation:
a22 a23
a11
a32 a33

5. The same process (follow steps 1-4 above) is then repeated for a12 and a13 as seen
in figures 2 and 3 respectively, i.e., the top row contains the element used to
multiply the new “2 by 2” matrix, and the column which contains the element
from the top row is omitted.

a11 a12 a13 a11 a12 a13 a11 a21 a31


a21 a22 a23 a21 a22 a23 a21 a22 a23
a31 a32 a33 a31 a32 a33 a31 a32 a33

Figure 1 Figure 2 Figure 3

2
For an example, consider:

5 6 7
A= 2 1 4
9 6 3

Find the determinant A.

Determinant A is calculated as follows:

1 4 2 4 2 1
A = 5 - 6 + 7
6 3 9 3 9 6

 A = 5 [1 (3) - 6 (4)] - 6 [2 (3) - 9 (4) ] + 7 [2 (6) - 9 (1)]

A = 96

A Description of Cramer’s Rule

Cramer‟s rule is a method of solving a system of linear equations through the use of
determinants. Cramer‟s rule is given by the equation

xi = Ai
A

where xi is the i th endogenous variable in a system of equations, A is the determinant of the
original A matrix as discussed in the previous section, and Ai is the determinant a special
matrix formed as part of Cramer‟s rule.

To use Cramer‟s rule, two (or more) linear equations are arranged in the matrix form
A x = d. For a two equation model:

A x = d
a11 a12 x1 d1
a21 a22 x2 = d2

A is the matrix corresponding to the number of equations in a system (here, two equations),
and the number of endogenous variables in the system (here 2 variables). Remember that the
matrix must be square, so the number of equations must equal the same number of endogenous

3
variables. Position x has one column and corresponds to the number of endogenous variables
in the system. Finally, position d contains the exogenous terms of each linear equation.

Note: The determinant for a matrix must not equal 0 (A  0). If A = 0 then there is no
solution, or there are infinite solutions (from dividing by zero). Therefore, A  0. When A
 0, then a unique solution exists.

Applying Cramer’s Rule in a 2x2 example

Using Cramer‟s rule to solve for the unknowns in the following linear equations:

2x1 + 6x2 = 22

-x1 + 5x2 = 53

Then,
A x = d

2 6 x1 22
=
-1 5 x2 53

2 6
The primary determinant A = = 2 (5) - (-1) 6 = 16
-1 5

We need to construct xi = Ai, for i=1 and for i=2.


A

The first special determinant A1 is found by replacing the first column of the primary
matrix with the constant „d‟ column. The new special matrix A1 now appears as:

22 6
A1 =
53 5

and solved as a regular matrix determinant,

A1 = 22 (5) - 53 (6) = -208

Likewise, the same procedure is done to find the second special determinant A2,

4
2 22
A2 =
-1 53

A2 = 2 (53) - (-1) (22) = 128

We have now determined:

A = 16
A1 = -208
A2 = 128

Using:

xi = Ai
A

we get,
A1 -208
x1 =  A = 16 = -13 (Solution)

A2 128
x2 = A = 16 = 8 (Solution)

Applying Cramer’s Rule in a 3x3 example

Using Cramer‟s Rule to solve for the unknowns in three linear equations:

5x1 - 2x2 + 3x3 = 16


2x1 + 3x2 - 5x3 = 2
4x1 - 5x2 + 6x3 = 7
Then,

5 -2 3 x1 16
2 3 -5 x2 = 2
4 -5 6 x3 7

5
5 -2 3
The primary determinant A= 2 3 -5 = 5(18 - 25) + 2(12 + 20) + 3(-10 - 12) = - 37
4 -5 6

The three special determinants are:

16 -2 3
A1= 2 3 -5 = 16(18 - 25) + 2(12 + 35) + 3(-10 - 21) = -111
7 -5 6

5 16 3
A2= 2 2 -5 = 5(12 + 35) - 16(12 + 20) + 3(14 - 8) = -259
4 7 6

5 -2 16
A3= 2 3 2 = 5(21 + 10) + 2(14 - 8) + 16(-10 - 12) = -185
4 -5 7

Applying Cramer‟s Rule:

 A1 -111
x1 = A = -37 = 3

A2 -259
x2 = A = -37 = 7

A3 -185
x3 = A = -37 = 5

You might also like