Difference between revisions of "Cramer's Rule"

(categories)
(Added general case and example)
Line 1: Line 1:
 
'''Cramer's Rule''' is a method of solving systems of equations using [[matrix|matrices]].
 
'''Cramer's Rule''' is a method of solving systems of equations using [[matrix|matrices]].
  
== 2 and 3 Dimensions ==
+
== General Form for n variables ==
 +
Cramer's Rule employs the [http://www.example.com link title] to solve a system of ''n'' linear equations in ''n'' variables.
 +
 
 +
We wish to solve the general linear system <math>A \mathbf{x}= \mathbf{b}</math> for the vector <math>\mathbf{x} = \left( \begin{array}{c} x_1  \\  \vdots \\ x_n \end{array} \right)</math>. Here, <math>A</math> is the coefficient matrix, <math>\mathbf{b}</math> is a column vector.
 +
 
 +
Let <math>M_j</math> be the matrix formed by replacing the jth column of <math>A</math> with <math>\mathbf{b}</math>.
 +
 
 +
Then, Cramer's Rule states that the general solution is <math>x_j = \frac{|M_j|}{A} \; \; \; \forall j \in \mathbb{N}^{\leq n}</math>
 +
 
 +
== General Solution for 2 Variables ==
 
Given a system of two equations with constants <math>x_1, x_2, y_1, y_2, a, b</math>
 
Given a system of two equations with constants <math>x_1, x_2, y_1, y_2, a, b</math>
  
Line 9: Line 18:
 
\end{eqnarray*}</cmath>
 
\end{eqnarray*}</cmath>
  
Cramer's Rule states that <math>x</math> and <math>y</math> can be found through [[determinant]]s according to the following:
+
Cramer's Rule states that <math>x</math> and <math>y</math> can be found through determinants according to the following:
  
<cmath>\begin{eqnarray*}
+
<math>x = \frac{\begin{vmatrix}  
x &=& \frac{\begin{vmatrix}  
 
 
a & y_1 \\
 
a & y_1 \\
 
b & y_2 \end{vmatrix}}
 
b & y_2 \end{vmatrix}}
 
{\begin{vmatrix}  
 
{\begin{vmatrix}  
 
x_1 & y_1 \\  
 
x_1 & y_1 \\  
x_2 & y_2 \end{vmatrix}}\\
+
x_2 & y_2 \end{vmatrix}} = \frac{ay_2 - by_1}{x_1y_2 - x_2y_1} \qquad y = \frac{\begin{vmatrix}  
y &=& \frac{\begin{vmatrix}  
 
 
x_1 & a \\
 
x_1 & a \\
 
x_2 & b \end{vmatrix}}
 
x_2 & b \end{vmatrix}}
 
{\begin{vmatrix}  
 
{\begin{vmatrix}  
 
x_1 & y_1 \\  
 
x_1 & y_1 \\  
x_2 & y_2 \end{vmatrix}}
+
x_2 & y_2 \end{vmatrix}} = \frac{bx_1 - ax_2}{x_1y_2 - y_1x_2}</math>
\end{eqnarray*}
+
 
</cmath>
+
== Example in 3 Variables ==
 +
 
 +
<cmath>\begin{eqnarray*}
 +
x_1+2x_2+3x_3&=&14\\
 +
3x_1+x_2+2x_3&=&11\\
 +
2x_1+3x_2+x_3&=&11
 +
\end{eqnarray*}</cmath>
 +
 
 +
Here, <math>A = \left( \begin{array}{ccc} 1 & 2 & 3 & 3 & 1 & 2 & 2 & 3 & 1 \end{array} \right) \qquad \mathbf{b} = \left( \begin{array}{c} 14 & 11 & 11 \end{array} \right)</math>
 +
 
 +
Thus, <cmath>M_1 = \left( \begin{array}{ccc} 14 & 2 & 3 & 11 & 1 & 2 & 11 & 3 & 1 \end{array} \right) \qquad M_2 = \left( \begin{array}{ccc} 1 & 14 & 3 & 3 & 11 & 2 & 2 & 11 & 1 \end{array} \right) \qquad M_3 = \left( \begin{array}{ccc} 1 & 2 & 14 & 3 & 1 & 11 & 2 & 3 & 11 \end{array} \right)</cmath>
  
By the rules of determinants, this means that <math>x = \frac{ay_2 - by_1}{x_1y_2 - x_2y_1}</math> and <math>y = \frac{bx_1 - ax_2}{x_1y_2 - y_1x_2}</math>.
+
We calculate the determinants:
 +
<cmath>|A| = 18 \qquad |M_1| = 18 \qquad |M_2| = 36 \qquad |M_3| = 54</cmath>
  
A similar rule is true for 3 by 3 matrices:
+
Finally, we solve the system:
 +
<cmath>x_1 = \frac{|M_1|}{|A|} = \frac{18}{18}=1 \qquad x_2 = \frac{|M_2|}{|A|} = \frac{36}{18} = 2 \qquad x_3 = \frac{|M_3|}{|A|} = \frac{54}{18} = 3</cmath>
  
 
{{incomplete|article}}
 
{{incomplete|article}}

Revision as of 21:03, 19 May 2008

Cramer's Rule is a method of solving systems of equations using matrices.

General Form for n variables

Cramer's Rule employs the link title to solve a system of n linear equations in n variables.

We wish to solve the general linear system $A \mathbf{x}= \mathbf{b}$ for the vector $\mathbf{x} = \left( \begin{array}{c} x_1  \\  \vdots \\ x_n \end{array} \right)$. Here, $A$ is the coefficient matrix, $\mathbf{b}$ is a column vector.

Let $M_j$ be the matrix formed by replacing the jth column of $A$ with $\mathbf{b}$.

Then, Cramer's Rule states that the general solution is $x_j = \frac{|M_j|}{A} \; \; \; \forall j \in \mathbb{N}^{\leq n}$

General Solution for 2 Variables

Given a system of two equations with constants $x_1, x_2, y_1, y_2, a, b$

\begin{eqnarray*} x_1x + y_1y &=& a\\ x_2x + y_2y &=& b \end{eqnarray*}

Cramer's Rule states that $x$ and $y$ can be found through determinants according to the following:

$x = \frac{\begin{vmatrix}  a & y_1 \\ b & y_2 \end{vmatrix}} {\begin{vmatrix}  x_1 & y_1 \\  x_2 & y_2 \end{vmatrix}} = \frac{ay_2 - by_1}{x_1y_2 - x_2y_1} \qquad y = \frac{\begin{vmatrix}  x_1 & a \\ x_2 & b \end{vmatrix}} {\begin{vmatrix}  x_1 & y_1 \\  x_2 & y_2 \end{vmatrix}} = \frac{bx_1 - ax_2}{x_1y_2 - y_1x_2}$

Example in 3 Variables

\begin{eqnarray*} x_1+2x_2+3x_3&=&14\\ 3x_1+x_2+2x_3&=&11\\ 2x_1+3x_2+x_3&=&11 \end{eqnarray*}

Here, $A = \left( \begin{array}{ccc} 1 & 2 & 3 & 3 & 1 & 2 & 2 & 3 & 1 \end{array} \right) \qquad \mathbf{b} = \left( \begin{array}{c} 14 & 11 & 11 \end{array} \right)$ (Error compiling LaTeX. Unknown error_msg)

Thus,

\[M_1 = \left( \begin{array}{ccc} 14 & 2 & 3 & 11 & 1 & 2 & 11 & 3 & 1 \end{array} \right) \qquad M_2 = \left( \begin{array}{ccc} 1 & 14 & 3 & 3 & 11 & 2 & 2 & 11 & 1 \end{array} \right) \qquad M_3 = \left( \begin{array}{ccc} 1 & 2 & 14 & 3 & 1 & 11 & 2 & 3 & 11 \end{array} \right)\] (Error compiling LaTeX. Unknown error_msg)

We calculate the determinants: \[|A| = 18 \qquad |M_1| = 18 \qquad |M_2| = 36 \qquad |M_3| = 54\]

Finally, we solve the system: \[x_1 = \frac{|M_1|}{|A|} = \frac{18}{18}=1 \qquad x_2 = \frac{|M_2|}{|A|} = \frac{36}{18} = 2 \qquad x_3 = \frac{|M_3|}{|A|} = \frac{54}{18} = 3\]

Template:Incomplete