Tutorial: Using matrices to solve systems of equations
Adaptive game version
This tutorial: Part A: Matrix of a linear system and row operations
(This topic is also in Section 3.2 in Finite Mathematics or Section 4.2 in Finite Mathematics and Applied Calculus)
#[What is a matrix?][¿Qué es una matriz?]#
A matrix is nothing more than a rectangular array of numbers, for instance,
#[A one-row matrix][Una matriz de una fila")]#: \t
\t 1×4 %%matrix
\\ \\ #[A two-row matrix][Una matriz de dos filas]#: \t
\t 2×4 %%matrix
\\ \\ #[A three-row matrix][Una matriz de tres filas]#: \t
\t 3×4 %%matrix
To see how we have specified the sizes of the matrices above, we need to talk about rows and columns. Here are two views of the third matrix above:
|
#[Rows are horizontal.][Filas son horizontales.]#
|
|
|
|
#[Columns are vertical.][Columnos son verticales.]#
#[3 × 4 matrix
3 rows and 4 columns][Matriz 3×4
4 filas y 3 columnas]#
As shown, the rows of a matrix go across from left to right and the columns of a matrix go from top to bottom (think "Roman columns"). The very first matrix above with only one row is a $1\times 4$ %%matrix because it has one row and four columns, the next one is a $2\times 4$ %%matrix because it has two rows and four columns, and the following one, shown again with shaded rows and then with shaded columns, has three rows and four columns, and so is a $3\times 4$ matrix. (You can also think as $1\times 4$ to mean "1 down and 4 across," a $2\times 4$ matrix to mean "2 down and 4 across," and a $3\times 4$ matrix to mean "3 down and 4 across.")
3 rows and 4 columns][Matriz 3×4
4 filas y 3 columnas]#
#[Matrix of a system of linear equations][Matriz de un sistema de ecuaciones lineales]#
%%Q #[What can we use matrices for?][¿Para qué podemos utilizar las matrices?]#
%%A #[Their most important purpose here is to represent linear equations or systems of linear equations in two or more unknowns (see the %%partAprevtut to review the case of two unknowns).][Su propósito más importante aquí es representar ecuaciones lineales o sistemas de ecuaciones lineales en dos o más incógnitas (consulta el %%partAprevtut para revisar el caso de dos incógnitas).]#
#[Linear equations in n unknowns][Ecuaciones lineales en n incógnitas]#
#[A linear equation in the $n$ unknowns $x_1, x_2, ..., x_n$ has the form][Una ecuación lineal en las $n$ incógnitas $x_1, x_2, ..., x_n$ tiene la forma]#
$a_1x_1 + ... + a_nx_n = b$ \gap[15] \t $(a_1, a_2, ..., a_n$ #[constants][constantes]#)
#[The numbers $a_1, a_2, ..., a_n$ are the coefficients and $b$ is the constant term, or right-hand side.][Los números $a_1, a_2, ..., a_n$ son los coeficientes y $b$ es el término constante o lado derecho.]#
%%Note #[We often call the unknowns $x, y, z, ...$ instead of $x_1, x_2, ..., x_n$, when convenient.][A menudo llamamos a las incógnitas $x, y, z, ...$ en lugar de $x_1, x_2, ..., x_n$, cuando es conveniente.]#
%%Examples
1. #[The equation $2x-3y = 4$ is a linear equation in two unknowns.][La ecuación $2x-3y = 4$ es una ecuación lineal con dos incógnitas]# 2. #[The equation $2x-3y-z = 0$ is a linear equation in three unknowns.][La ecuación $2x-3y-z = 0$ es una ecuación lineal con tres incógnitas]# 3. #[The equation $3x_n-5x_2+6x_3=11$ is another linear equation in three unknowns.][La ecuación $3x_n-5x_2+6x_3=11$ es otra ecuación lineal con tres desconicidos]# 2. #[We can also think of the equation $2x-3y-z = 0$ as a linear equation in four unknowns $x, y, z$, and $w$ by writing it as $2x-3y-z + 0w = 0$.][También podemos pensar en la ecuación $2x-3y-z = 0$ como una ecuación lineal con cuatro incógnitas $x, y, z$ y $w$ escribiéndola como $2x-3y-z + 0w = 0$]#
1. #[The equation $2x-3y = 4$ is a linear equation in two unknowns.][La ecuación $2x-3y = 4$ es una ecuación lineal con dos incógnitas]# 2. #[The equation $2x-3y-z = 0$ is a linear equation in three unknowns.][La ecuación $2x-3y-z = 0$ es una ecuación lineal con tres incógnitas]# 3. #[The equation $3x_n-5x_2+6x_3=11$ is another linear equation in three unknowns.][La ecuación $3x_n-5x_2+6x_3=11$ es otra ecuación lineal con tres desconicidos]# 2. #[We can also think of the equation $2x-3y-z = 0$ as a linear equation in four unknowns $x, y, z$, and $w$ by writing it as $2x-3y-z + 0w = 0$.][También podemos pensar en la ecuación $2x-3y-z = 0$ como una ecuación lineal con cuatro incógnitas $x, y, z$ y $w$ escribiéndola como $2x-3y-z + 0w = 0$]#
#[Representing systems of linear equations by matrices][Representar sistemas de ecuaciones lineales por matrices]#
#[A single linear equation][Una sola ecuación lineal]#
#[We call this matrix the augmented matrix of the system because it includes the right-hand side as an $(n+1)$st element. Omitting it would give us the $1\times n$ coefficient matrix][Llamamos a esta matriz la matriz aumentada del sistema porque incluye el lado derecho como elemento $(n+1)$. Omitirla nos daría la matriz de coeficientes de $1\times n$]#
#[However, here will will focus exclusively on the augmented matrices.][Sin embargo, aquí nos centraremos exclusivamente en las matrices aumentadas.]#
#[We can represent a system of two or more linear equations by an augmented matrix with two or more rows by representing each equation in the system as a row. That is to say,][Podemos representar un sistema de dos o más ecuaciones lineales mediante una matriz aumentada con dos o más filas, presentando previamente cada ecuación del sistema como una fila. Es decir,]#:
$a_1x_1 + ... + a_nx_n = b$
#[can be represented by the $1 \times (n+1)$ matrix][se puede representar por la matriz $1 \times (n+1)$]#
$a_{11}x_1 + ... + a_{1n}x_n = b_1$
\\ $a_{21}x_1 + ... + a_{2n}x_n = b_2$
\\ $...$
\\ $a_{m1}x_1 + ... + a_{mn}x_n = b_m$
#[can be represented by the $m \times (n+1)$ augmented matrix][se puede representar por la matriz aumentada $1 \times (n+1)$]#
%%Examples
1. #[The equation][La acuación]#
1. #[The equation][La acuación]#
$2x_1-3x_2 = \dfrac{2}{3}$
#[in the unnowns $x_1, x_2$ is represented by the 1×3 matrix][en las incógnitas $x_1, x_2$ se representa mediante la matriz 1×3]#
\\
2. #[The equation][La acuación]#
$2x-3y = \dfrac{2}{3}$,
#[considered as an equation in the unknowns $x, y, z$][considerada como una ecuación en lo desconocido las incógnitas $x, y, s$]#
$2x-3y+0z = \dfrac{2}{3}$,
#[is represented by the 1×4 matrix][se representa mediante la matriz 1×4]#
\\
3.#[The system of equations][El sistema de ecuaciones]#
$3x+y-5z=0$
\\ $2x + \dfrac{y}{2} = 0$
\\ $x + \dfrac{y}{2} + \dfrac{z}{2} = 2$
#[in the three unknowns $x, y, z$ has augmented matrix][en los tres incógnitas $x, y, z$ tiene la matriz aumentada]#
%%YourTurn
Some practice: Switching between matrices and systems
Row operatrions
#[Here are three things you can do to a system of equations without effecting the solution:][Aquí están tres cosas que se puede hacer sin afectar la solución:]#
- #[Multiply both sides of any equation by a non-zero number][Multiplicar ambos lados de cualquier ecuación por un número distinto de cero]#
- #[Replace any equation by its sum with another equation. More generally, you can use the preceding operation with this one to replace an equation by, say, 4 times itself plus 5 times another equation.][Reemplazar cualquier ecuación por su suma con una otra ecuación. De manera más general, se puede utilizar la operación anterior con esta para reemplazar, por ejemplo, una ecuación por 4 veces aquella ecuación más 6 veces una otra.]#
- #[Change the order in which the equations are written][Cambiar el orden en que se escribe las ecuaciones]#
#[Elementary† row operations][Operaciones elementales† de fila]#
#[Type 1: ][Tipo 1: ]##[Replacing $R_{i}$ by $aR_{i}$ where $a \neq 0$; that is, multiplying or dividing a row by a nonzero number][Reemplazar $R_{i}$ por $aR_{i}$ donde $a \neq 0$; es decir, multiplicar una fila por un número distinto de cero.]#
#[Type 2: ][Tipo 2: ]##[Replacing $R_i$ by $aR_i \pm bR_j$ where $a \neq 0$; that is, multiplying a row by a nonzero number and adding or subtracting a multiple of another row][Reemplazar $R_i$ por $aR_i \pm bR_j$ donde $a \neq 0$; es decir, multiplicar una fila por un número distinto de cero u sumar o restar un núltiple de una otra fila]#
#[Type 3: ][Tipo 3: ]##[Changing the order of the rows][Cambiar el orden de las filas]#
#[For Types 1 and 2 we write the instruction for the row operation next to the row we wish to replace.][Par tipos 1 y 2 escribimos la instrucción para la operación de fila a lo lado de la fila que quermos reemplazar.]#
#[Examples][Ejemplos]#
#[Type 1: ][Tipo 1: ]# #[Replacing $R_{i}$ by $aR_{i}$][Reemplazar $R_{i}$ por $aR_{i}$]#
#[For instance, write the instruction $3R_2$ next to row 2 to mean "Multiply row 2 by 3."][Por ejemplo, escribe la instrucción $3R_2$ al lado de la degunda fila para significar "Multiplica fila 2 por 3."]#
#[For instance, write the instruction $3R_1-2R_3$ next to row 1 to mean "Replace row 1 by three times row 1 minus twice row 3"][Por ejemplo, escribe la instrucción $3R_1-2R_3$ al lado de la fila 1 para significar "Reemplaza fila 1 por tres veces fila 1 menos dos veces fila 3"]#
#[In words: "Three times the top minus twice the bottom"][En palabras: "Tresveces la parte superior menos dos veces la parte inferior"]#
#[For instance, write the instruction $R_2 \leftrightarrow R_3$ to mean "Swap rows 2 and 3"][Por ejemplo, escribe la instrucción $R_2 \leftrightarrow R_3$ para significar "Intercambia filas 2 y 3"]#
#[(It is a mathematical fact that any reordering of the rows can be obtained by a sequence of row swaps.)][(Es un hecho matemático que cualquier reordenamiento de las filas se puede obtener mediante una secuencia de intercambios de filas).]#
#[For instance, write the instruction $3R_2$ next to row 2 to mean "Multiply row 2 by 3."][Por ejemplo, escribe la instrucción $3R_2$ al lado de la degunda fila para significar "Multiplica fila 2 por 3."]#
#[For instance, write the instruction $3R_1-2R_3$ next to row 1 to mean "Replace row 1 by three times row 1 minus twice row 3"][Por ejemplo, escribe la instrucción $3R_1-2R_3$ al lado de la fila 1 para significar "Reemplaza fila 1 por tres veces fila 1 menos dos veces fila 3"]#
#[In words: "Three times the top minus twice the bottom"][En palabras: "Tresveces la parte superior menos dos veces la parte inferior"]#
#[For instance, write the instruction $R_2 \leftrightarrow R_3$ to mean "Swap rows 2 and 3"][Por ejemplo, escribe la instrucción $R_2 \leftrightarrow R_3$ para significar "Intercambia filas 2 y 3"]#
#[(It is a mathematical fact that any reordering of the rows can be obtained by a sequence of row swaps.)][(Es un hecho matemático que cualquier reordenamiento de las filas se puede obtener mediante una secuencia de intercambios de filas).]#
† #[We are taking the liberty of using the term "elementary" somewhat more freely than is traditional. Strictly speaking, in Type 2, we should allow only $a = 1$, and in Type 3 we should permit only the interchange of two rows. However, one can obtain the more general operations stated here by applying the stricter ones in sequence, so by relaxing the definition in this way, we will be able to reduce matrices with fewer steps, especially when dealing with matrices of integers.
In any case, even the stricter traditional notion of elementary equivalence is also redundant; one could actually scrap Type 3 altogether and restrict Type 2 to $a = b = 1$.][Nos permitimos usar el término "elemental" con mayor libertad de lo habitual. En sentido estricto, en el Tipo 2, solo deberíamos permitir $a = 1$, y en el Tipo 3, solo el intercambio de dos filas. Sin embargo, las operaciones más generales aquí descritas se pueden obtener aplicando las más estrictas secuencialmente. Por lo tanto, al flexibilizar la definición de esta manera, podremos reducir matrices con menos pasos, especialmente al trabajar con matrices de enteros
En cualquier caso, incluso la noción tradicional más estricta de equivalencia elemental es redundante; de hecho, se podría descartar por completo el Tipo 3 y restringir el Tipo 2 a $a = b = 1$.]#
#[You are now ready to go on to the %%nextTut where we will put these row operations operations to use in solving systems of linear equations.][Ahora estas listo para pasar al %%nextTut donde pondremos estas operaciones de filas para usar en la solución de sistemas de ecuaciones lineales.]#
Pivot and Gauss-Jordan tool