Resolución de sistemas de ecuaciones lineales

1. Introducción:

Un sistema de $n$ ecuaciones lineales con $n$ incógnitas puede escribirse:

$ \left. \begin{array}{l} a_{11} x_1 + a_{12} x_2 + \dotsb + a_{1n} x_n = b_1 \\[1ex] a_{21} x_1 + a_{22} x_2 + \dotsb + a_{2n} x_n = b_2 \\ \hphantom{a_{11} x_1 + a_{12} x_2 + \dotsb + a_{1n} x_n} \mspace{2mu} \mathrel{\vdots} \\ a_{n1} x_1 + a_{n2} x_2 + \dotsb + a_{nn} x_n = b_n \end{array} \, \right\} $

Se supone que las ecuaciones son linealmente independientes.

Dos formas de resolver:

2. Método de Gauss:

Por ejemplo:

$ \begin{array}{l} \left. \begin{alignedat}{3} 2x &+{} &4y &+{} &z &= 1 \\[1ex] 8x &-{} &y &+{} &3z &= 0 \\[1ex] 2x &+{} &5y & &&= 0 \end{alignedat} \right\} \underset{F_1 \cdot (-3) + F_2}{\implies} \left. \begin{alignedat}{4} 2x &+{} &4y &+{} &z &={} &1& \\[1ex] 2x &-{} &13y & &&={} &-3& \\[1ex] 2x &+{} &5y & &&={} &0& \end{alignedat} \right\} \underset{F_2 \cdot \left(\frac{5}{13}\right)+F_3}{\implies} \\[1em] \left. \begin{alignedat}{4} 2x &+{} &4y &+{} &z &={} &1& \\[1ex] 2x &-{} &13y & &&={} &-3& \\[1ex] \frac{36}{13}x & && &&={} &-\frac{15}{13}& \end{alignedat} \right\} \Rightarrow \begin{array}{l} x = -\frac{5}{12} \\[1ex] y = \frac{1}{6} \\[1ex] z = \frac{7}{6} \end{array} \end{array} $

De cara a formalizar el método, lo más idóneo es escribir el sistema de manera matricial:

$Ax = b$

Donde:

$ A = \begin{pmatrix} a_{11} &\dots & a_{1n} \\ \vdots & &\vdots \\ a_{n1} &\dots &a_{nn} \end{pmatrix} $   Matriz de coeficientes. $ x = \begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix} $   Vector de incógnitas. $ b = \begin{pmatrix} b_1 \\ \vdots \\ b_n \end{pmatrix} $   Vector término independiente.

Si se juntan $A$ y $b$ se tiene la matriz ampliada, que ya no es cuadrada:

$ \underbrace{ ( \begin{array}[t]{cc} \mspace{-5mu} \underbrace{A}_{n \times n} \mspace{-5mu} & \mspace{-5mu} \underbrace{b}_{n \times 1} \mspace{-5mu} \end{array} ) }_{n \times (n+1)} $

El método de Gauss consiste en encontrar en $A$ un triángulo de ceros por encima o debajo de una diagonal que pase por el centro de la matriz. Se usará el triángulo por debajo de la diagonal principal, la formada por los $a_{ii}$, i.e. de la esquina superior izquierda a la esquina inferior derecha. Esto es, en el ejemplo planteado, sobre la matriz ampliada:

$ \begin{array}{r} \begin{pmatrix} 2 & 4 & 1 & 1 \\ 8 & -1 & 3 & 0 \\ 2 & 5 & 0 & 0 \end{pmatrix} \xrightarrow[ \begin{array}{c} {\rm F}_1 \cdot (-4) + {\rm F}_2 \\ -{\rm F}_1 + {\rm F}_3 \end{array} ]{} \begin{pmatrix} 2 & 4 & 1 & 1 \\ 0 & -17 & -1 & -4 \\ 0 & 1 & -1 & -1 \end{pmatrix} \rlap{\rightarrow{}} \\[1em] \xrightarrow[ {\rm F}_2 \left( \frac{1}{17} \right) + {\rm F}_3 ]{} \begin{pmatrix} 2 & 4 & 1 & 1 \\ 0 & -17 & -1 & -4 \\ 0 & 0 & \frac{-18}{17} & \frac{-21}{17} \end{pmatrix} \end{array} $

Así pues, en el método de Gauss:

  1. $n-1$ pasos para transformar la matriz de coeficientes en una matriz triangular.
  2. Resolver.

Siendo así:

1.er paso:  Multiplicar 1.a fila por un factor $\left(-\dfrac{a_{21}}{a_{11}}\right)$ y sumarlo a la 2.ª fila. Multiplicar 1.ª fila por un factor $\left(-\dfrac{a_{31}}{a_{11}}\right)$ y sumarlo a la 3.ª fila. $\vdots$ Multiplicar 1.ª fila por un factor $\left(-\dfrac{a_{n1}}{a_{11}}\right)$ y sumarlo a la enésima fila.

2.º paso:  Multiplicar 2.ª fila por un factor $\left(-\dfrac{a_{32}}{a_{22}}\right)$ y sumarlo a la 3.ª fila. Multiplicar 2.ª fila por un factor $\left(-\dfrac{a_{42}}{a_{22}}\right)$ y sumarlo a la 4.ª fila. $\vdots$ Multiplicar 2.ª fila por un factor $\left(-\dfrac{a_{n2}}{a_{22}}\right)$ y sumarlo a la enésima fila.

  $\vdots$

$(n-1)$.º paso:  Multiplicar $(n-1)$.ª fila por un factor $\left(-\dfrac{a_{n,(n-1)}}{a_{(n-1),(n-1)}}\right)$ y sumarlo a la enésima fila.

El pivote es el número sobre el que se apoyan todos los pasos. Estos pivotes son, respectivamente, los números de la diagonal.

Si en uno de los pasos el pivote es cero se reordenan las filas de tal manera que desaparezca.


Ejemplo:

$ \left. \begin{alignedat}{5} x_1 &-{} & x_2 &+{} & 2x_3 &-{} & x_4 &={} & -8 & \\[1ex] 2x_1 &-{} &2x_2 &+{} & 3x_3 &-{} & 3x_4 &={} & -20 & \\[1ex] x_1 &+{} & x_2 &+{} & x_3 & &&={} & -2 & \\[1ex] x_1 &-{} & x_2 &+{} & 4x_3 &+{} & 3x_4 &={} & 4 & \end{alignedat} \right\} $

Aplicando el método de Gauss sobre la matriz ampliada:

$ \begin{pmatrix} 1 & -1 & 2 & -1 & -8 \\ 2 & -2 & 3 & -3 & -20 \\ 1 & 1 & 1 & 0 & -2 \\ 1 & -1 & 4 & 3 & 4 \end{pmatrix} \xrightarrow[ \begin{array}{c} -2 {\rm F}_1 + {\rm F}_2 \\ - {\rm F}_1 + {\rm F}_3 \\ - {\rm F}_1 + {\rm F}_4 \end{array} ]{} \begin{pmatrix} 1 & -1 & 2 & -1 & -8 \\ 0 & 0 & -1 & -1 & -4 \\ 0 & 2 & -1 & 1 & 6 \\ 0 & 0 & 2 & 4 & 12 \end{pmatrix} \rightarrow \\[8ex] \xrightarrow[{\rm F}_2 \leftrightarrow {\rm F}_3]{} \begin{pmatrix} 1 & -1 & 2 & -1 & -8 \\ 0 & 2 & -1 & 1 & 6 \\ 0 & 0 & -1 & -1 & -4 \\ 0 & 0 & 2 & 4 & 12 \end{pmatrix} \xrightarrow[2{\rm F}_3 + {\rm F}_4]{} \begin{pmatrix} 1 & -1 & 2 & -1 & -8 \\ 0 & 2 & -1 & 1 & 6 \\ 0 & 0 & -1 & -1 & -4 \\ 0 & 0 & 0 & 2 & 4 \end{pmatrix} $

Por consiguiente:

$ \left. \begin{alignedat}{5} x_1 &-{} & x_2 &+{} & 2x_3 &-{} &x_4 &={} & -8 & \\[1ex] & & 2x_2 &-{} & x_3 &+{} & x_4 &={} & 6 & \\[1ex] & & & & -x_3 &-{} & x_4 &={} & -4 & \\[1ex] & & & & & & 2x_4 &= & 4 & \end{alignedat} \right\} \Rightarrow \begin{aligned} &x_1 = -8 + x_4 - 2x_3 + x_2 = -7 \\[1ex] &x_2 = (6 - x_4 + x_3){∕}2 = 3 \\[1ex] &x_3 = 4 - x_4 = 2 \\[1ex] &x_4 = 2 \end{aligned} $


En el método de Gauss con pivote máximo, se escoge como pivote el de valor absoluto máximo, reordenando para ello las filas que quedan. Esto es, sobre el ejemplo visto:

$ \begin{pmatrix} 2 & 4 & 1 & 1 \\ 8 & -1 & 3 & 0 \\ 2 & 5 & 0 & 0 \end{pmatrix} \xrightarrow[{\rm F}_1 \leftrightarrow {\rm F}_2]{} \begin{pmatrix} 8 & -1 & 3 & 0 \\ 2 & 4 & 1 & 1 \\ 2 & 5 & 0 & 0 \end{pmatrix} $

Sea:

$ \begin{pmatrix} 0 & 1 \\ 2 & 1 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} $

$ \begin{array}{l} x_2 = 1 \\ x_1 = -\dfrac{1}{2} \end{array} $

Se perturba el coeficiente con valor 0 sustituyéndolo por un número pequeño:

$ \begin{pmatrix} -10^{-5} & 1 \\ 2 & 1 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} $

Sin el método de Gauss, mediante álgebra, la solución exacta:

$ \begin{array}{l} x_1 = -0{,}4999975 \\[1ex] x_2 = 0{,}999995 \end{array} $

Al igual que un pequeño cambio en el sistema inicial comporta una solución diferente, el redondeo, un valor ligeramente distinto al exacto en cada cálculo del método de Gauss, conduce a una solución que no es la exacta. Esto es, aplicando el método de Gauss con, como máximo, 4 cifras significativas, expresando, como una máquina, los números en coma flotante:

$ \begin{pmatrix} -0{,}1 \cdot 10^{-4} & 0{,}1 \cdot 10^1 & 0{,1} \cdot 10^1 \\ 0{,}2 \cdot 10^1 & 0{,}1 \cdot 10^1 & 0 \end{pmatrix} \rightarrow \begin{pmatrix} -0{,}1 \cdot 10^{-4} & 0{,}1 \cdot 10^1 & 0{,1} \cdot 10^1 \\ 0 & 0{,}2 \cdot 10^6 & 0{,}2 \cdot 10^6 \end{pmatrix} $

Factor: $\dfrac{0{,}2 \cdot 10^1}{0{,}1 \cdot 10^{-4}} = 0{,}2 \cdot 10^6$

$0{,}1 \cdot 10^1 + (0{,}1 \cdot 10^1) (0{,}2 \cdot 10^6) = 0{,}2 \cdot 10^6$

Por tanto:

$ \left. \begin{aligned} -0{,}1 \cdot 10^{-4} x_1 + 0{,}1 \cdot 10^1 x_2 &= 0{,}1 \cdot 10^1 \\[1ex] 0{,}2 \cdot 10^6 x_2 &= 0{,}2 \cdot 10^6 \end{aligned} \right\} \Rightarrow \begin{array}{l} x_2 = 1 \\[1ex] x_1 = 0 \end{array} $

Esta "solución" no cumple con la segunda ecuación del sistema.

A la hora de resolver, en las divisiones, con un pivote muy pequeño actuando de denominador, el error puede ser muy grande. La imprecisión del numerador, el error que se comete en éste, aunque sea pequeño, se multiplica por mucho.

Además, también, el efecto del redondeo, su propagación, es mayor si algún pivote es muy pequeño, ya que entonces es grande el factor por el que se multiplican los coeficientes en el correspondiente paso del método de Gauss, multiplicándose los errores de redondeo que ya posean los coeficientes.

Si se aplica el método de Gauss con pivote máximo, se intercambian las filas:

$ \begin{pmatrix} 0{,}2 \cdot 10^1 & 0{,}1 \cdot 10^1 & 0 \\ -0{,}1 \cdot 10^{-4} & 0{,}1 \cdot 10^1 & 0{,1} \cdot 10^1 \end{pmatrix} \rightarrow \begin{pmatrix} 0{,}2 \cdot 10^1 & 0{,}1 \cdot 10^1 & 0 \\ 0 & 0{,}1 \cdot 10^1 & 0{,1} \cdot 10^1 \end{pmatrix} $

Factor: $\dfrac{0{,}1 \cdot 10^{-4}}{0{,}2 \cdot 10^1} = 0{,}5 \cdot 10^{-5}$

$0{,}1 \cdot 10^1 + (0{,}1 \cdot 10^1) (0{,}5 \cdot 10^{-5}) = 0{,}1 \cdot 10^1$

Por tanto:

$ \left. \begin{aligned} 0{,}2 \cdot 10^1 x_1 + 0{,}1 \cdot 10^1 x_2 &= 0 \\[1ex] 0{,}1 \cdot 10^1 x_2 &= 0{,}1 \cdot 10^1 \end{aligned} \right\} \Rightarrow \begin{array}{l} x_2 = 1 \\[2ex] x_1 = - \smash{\dfrac{0{,}1 \cdot 10^1}{0{,}2 \cdot 10^1}} = -0{,}5 \end{array} $

Que ya es una buena aproximación.


Ejemplo:

$ \left. \begin{alignedat}{2} 0{,}003000x_1 &+{} & 59{,}14x_2 &= 59{,}17 \\[1ex] 5{,}291x_1 &-{} & 6{,}130x_2 &= 46{,}78 \end{alignedat} \right\} $

Fijándose en primera ecuación, validándose para la segunda, la solución exacta es:

$ \begin{array}{l} x_2 = 1 \\[1ex] x_1 = 10 \end{array} $

A continuación, haciendo los cálculos con 4 cifras significativas y redondeo:

1ª variante del método de Gauss (sin escoger el pivote máximo):

$ \begin{pmatrix} 0{,}003 & 59{,}14 & 59{,}17 \\ 5{,}291 & -6{,}130 & 46{,}78 \end{pmatrix} \rightarrow \begin{pmatrix} 0{,}003 & 59{,}14 & 59{,}17 \\ 0 & -104300 & -104400 \end{pmatrix} $

Factor: $-\dfrac{5{,}291}{0{,}003} = -1764$

$ \begin{array}{c} -6{,}130 + (-1764)(59{,}14) = -6{,}130 - 104300 = -104300 \\[1ex] 46{,}78 + (-1764)(59{,}17) = 46{,}78 - 104400 = -104400 \end{array} $

Por tanto:

$ \left. \begin{alignedat}{2} 0{,}003x_1 + 59{,}14x_2 &={} & 59{,}17 & \\[1ex] -104300x_2 &={} & -104400 & \end{alignedat} \right\} \Rightarrow \begin{array}{l} x_2 = \dfrac{-104400}{-104300} = 1{,}001 \\[1ex] \vphantom{x_1 = \dfrac{59{,}17 - 59{,}14 \cdot 1{,}001}{0{,}003} =} \smash{ \begin{aligned}[t] x_1 &= \dfrac{59{,}17 - 59{,}14 \cdot 1{,}001}{0{,}003} = \\[1ex] &= 19720 - (19710)(1{,}001) = \\[1ex] &= 19720 - 19730 = -10{,}00 \end{aligned} } \end{array} $

El pequeño error que se comete en el valor de $x_2$, se magnifica cuando se pretende calcular la solución para $x_1$, al dividir por un pivote muy pequeño, arruinando el resultado.

2ª variante del método de Gauss (con pivote máximo):

$ \begin{pmatrix} 5{,}291 & -6{,}130 & 46{,}78 \\ 0{,}003 & 59{,}14 & 59{,}17 \end{pmatrix} \rightarrow \begin{pmatrix} 5{,}291 & -6{,}130 & 46{,}78 \\ 0 & 59{,}14 & 59{,}14 \end{pmatrix} $

Factor: $- \dfrac{0{,}003}{5{,}291} = -0{,}0005670$

$ \begin{array}{c} 59{,}14 + (-0{,}0005670)(-6{,}130) = 59{,}14 + 0{,}003476 = 59{,}14 \\[1ex] 59{,}17 + (-0{,}0005670)(46{,}78) = 59{,}17 - 0{,}02652 = 59{,}14 \end{array} $

Por tanto:

$ \left. \begin{aligned} 5{,}291x_1 - 6{,}130x_2 &= 46{,}78 \\[1ex] 59{,}14x_2 &= 59{,}14 \end{aligned} \right\} \Rightarrow \begin{array}{l} x_2 = 1 \\[2ex] x_1 = \smash{\dfrac{46{,}78 + 6{,}130}{5{,}291}} = 10 \end{array} $


3. Descomposición $LU$:

Consiste en factorizar una matriz expresándola como producto de dos matrices triangulares:

$A = LU$

Donde:

$L =$ Triangular inferior ("Lower"). $U =$ Triangular superior ("Upper").

- Método de Doolitle:

Requiere que la diagonal principal de $L$ esté formada por unos. Por ejemplo:

$ \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ l_{21} & 1 & 0 \\ l_{31} & l_{32} & 1 \end{pmatrix} \begin{pmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{pmatrix} $

• Paso 1:

Se iguala con la primera fila de la matriz producto:

$ \begin{array}{l} a_{11} = u_{11} \\[1ex] a_{12} = u_{12} \\[1ex] a_{13} = u_{13} \end{array} $

A continuación también con la primera columna:

$ \begin{array}{l} a_{21} = l_{21} u_{11} \Rightarrow l_{21} = \dfrac{a_{21}}{u_{11}} \\[1ex] a_{31} = l_{31} u_{11} \Rightarrow l_{31} = \dfrac{a_{31}}{u_{11}} \end{array} $

• Paso 2:

Se iguala la segunda fila:

$ \begin{array}{l} a_{22} = l_{21}u_{12} + u_{22} \Rightarrow u_{22} = a_{22} - l_{21}u_{12} \\[1ex] a_{23} = l_{21}u_{13} + u_{23} \Rightarrow u_{23} = a_{23} - l_{21}u_{13} \end{array} $

Ahora la segunda columna:

$a_{32} = l_{31}u_{12} + l_{32} u_{22} \Rightarrow l_{32} = \dfrac{1}{u_{22}} (a_{32} - l_{31}u_{12})$

• Paso 3:

En la tercera fila:

$a_{33} = l_{31}u_{13} + l_{32}u_{23} + u_{33} \Rightarrow u_{33} = a_{33} - l_{31}u_{13} - l_{32}u_{23}$

Teniéndose ya completadas las dos matrices triangulares.

En general, para una matriz $A$ de dimensión $n \times n$:

$ \begin{array}{l} u_{ij} = a_{ij} - \displaystyle \sum_{k=1}^{i-1} l_{ik} u_{kj} \quad i \leq j \\ l_{ii} = 1 \\ l_{ij} = \dfrac{1}{u_{jj}} \left( a_{ij} - \displaystyle \sum_{k=1}^{j-1} l_{ik} u_{kj} \right) \quad i > j \end{array} $


Ejemplo:

$ \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 2 \\ 3 & 1 & 5 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ l_{21} & 1 & 0 \\ l_{31} & l_{32} & 1 \end{pmatrix} \begin{pmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{pmatrix} $

• Paso 1:

Primera fila:

$ \begin{array}{l} 1 = u_{11} \\[1ex] 2 = u_{12} \\[1ex] 3 = u_{13} \end{array} $

Primera columna:

$ \begin{array}{l} 2 = l_{21} u_{11} \Rightarrow l_{21} = 2 \\[1ex] 3 = l_{31} u_{11} \Rightarrow l_{31} = 3 \end{array} $

Siendo pues:

$ \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 2 \\ 3 & 1 & 5 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & l_{32} & 1 \end{pmatrix} \begin{pmatrix} 1 & 2 & 3 \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{pmatrix} $

• Paso 2:

Segunda fila:

$ \begin{array}{l} 5 = 2 \cdot 2 + u_{22} \Rightarrow u_{22} = 1 \\[1ex] 2 = 2 \cdot 3 + u_{23} \Rightarrow u_{23} = -4 \end{array} $

Segunda columna:

$1= 3 \cdot 2 + l_{32} \cdot u_{22} \Rightarrow l_{32} = -5$

Siendo entonces:

$ \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 2 \\ 3 & 1 & 5 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & -5 & 1 \end{pmatrix} \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & -4 \\ 0 & 0 & u_{33} \end{pmatrix} $

• Paso tres:

Tercera fila:

$5 = 3 \cdot 3 + (-5) \cdot (-4) + u_{33} \Rightarrow u_{33} = -24$

Por tanto:

$ \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 2 \\ 3 & 1 & 5 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & -5 & 1 \end{pmatrix} \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & -4 \\ 0 & 0 & -24 \end{pmatrix} $


En un sistema lineal:

$ \begin{array}{c} A x = b \\[1ex] L \mspace{-2mu} \underbrace{Ux}_y \mspace{-2mu} = b \Rightarrow Ly = b \end{array} $

Entonces:

1.er paso: Hallar $y$ tal que $Ly = b\,$.

2.º paso: Hallar $x$ tal que $Ux = y\,$.


Ejemplo:

$ \left. \begin{alignedat}{3} x_1 &+{} & 2x_2 &+{} & 3x_3 &= 14 \\[1ex] 2x_1 &+{} & 5x_2 &+{} & 2x_3 &= 18 \\[1ex] 3x_1 &+{} & x_2 &+{} & 5x_3 &= 20 \end{alignedat} \right\} $

Por consiguiente:

$ \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 2 \\ 3 & 1 & 5 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ \end{pmatrix} = \begin{pmatrix} 14 \\ 18 \\ 20 \end{pmatrix} $

Usando, para resolver el sistema, el método de Doolittle, como se vio en el anterior ejemplo:

$ \underset{A}{ \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 2 \\ 3 & 1 & 5 \end{pmatrix} } = \underset{L}{ \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & -5 & 1 \end{pmatrix} } \, \underset{U}{ \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & -4 \\ 0 & 0 & -24 \end{pmatrix} } $

Entonces:

1.er paso:

$ \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & -5 & 1 \end{pmatrix} \begin{pmatrix} y_1 \\ y_2 \\ y_3 \end{pmatrix} = \begin{pmatrix} 14 \\ 18 \\ 20 \end{pmatrix} $

Así pues:

$ \left. \begin{alignedat}{3} y_1 &\hphantom{+{}} && &&= 14 \\[1ex] 2y_1 &+{} & y_2 &\hphantom{{+}{}} &&= 18 \\[1ex] 3y_1 &-{} & 5y_2 &+{} & y_3 &= 20 \end{alignedat} \right\} \Rightarrow \begin{array}{l} y_1 = 14 \\[1ex] y_2 = 18 - 2y_1 = -10 \\[1ex] y_3 = 20 - 3y_1 + 5y_2 = -72 \end{array} $

2º paso:

$ \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & -4 \\ 0 & 0 & -24 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} = \begin{pmatrix} 14 \\ -10 \\ -72 \end{pmatrix} $

Por tanto:

$ \left. \begin{alignedat}{3} x_1 + 2x_2 &+{} & 3x_3 &={} & 14 & \\[1ex] x_2 &-{} & 4x_3 &={} & -10 & \\[1ex] &-{} &24x_3 &={} & -72 & \end{alignedat} \right\} \Rightarrow \begin{array}{l} x_3 = 3 \\[1ex] x_2 = -10 + 4x_3 = 2 \\[1ex] x_1 = 14 - 2x_2 - 3x_3 = 1 \end{array} $


4. Norma y condición de una matriz:

1) Norma de un vector, que es una medida de su magnitud, siendo éste:

$ x = \begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix} $

Se denota por $\|x\|$.

Propiedades:

a) $\|x\| \geq 0\,.$

b) $\|x\| = 0$ sólo si $x = 0\,.$

c) $\|\alpha x\| = |\alpha| \|x\|\,,$ $\alpha$ es un escalar.

d) $\|x+y\| \leq \|x\| + \|y\|\,,$ desigualdad triangular.

Se define:

$\|x\|_2 = (x_1^2 + x_2^2 + \dotsb + x_n^2)^{1/2}\,,$   norma euclídea.

Alternativas:

  1. $\|x\|_1 = |x_1| + |x_2| + \dotsb + |x_n|$
  2. $\|x\|_\infty = \max (|x_1|, |x_2|, \dotsc, |x_n|)\,,$   norma del máximo.

Todas ellas cumplen las propiedades.


Ejemplo:

$ x = \begin{pmatrix} 1 \\ 2 \end{pmatrix} $

Entonces:

$ \begin{array}{l} \|x\|_2 = \sqrt{5} \\[1ex] \|x\|_1 = 3 \\[1ex] \|x\|_\infty = 2 \end{array} $


2) Norma de una matriz, siendo ésta:

$ A = \begin{pmatrix} a_{11} & \dots & a_{1n} \\ \vdots & & \vdots \\ a_{n1} & \dots & a_{nn} \end{pmatrix} $

Se define:

$ \|A\| = \max\limits_{\|x\| = 1} \|Ax\| \Rightarrow \left\{ \begin{array}{l} \|A\|_2 \\[1ex] \|A\|_1 \\[1ex] \|A\|_\infty \end{array} \right. $

Que es la cantidad máxima que un vector de longitud (norma) 1, de todos los posibles, se magnifica al ser multiplicado por $A$.


Ejemplo:

$ A = \begin{pmatrix} 1{∕}3 & 1{∕}4 \\ 1{∕}4 & 1{∕}5 \end{pmatrix} \qquad \|A\|_\infty \text{ ?} $

Siendo así:

$ A x = \begin{pmatrix} 1{∕}3 & 1{∕}4 \\ 1{∕}4 & 1{∕}5 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} \frac{1}{3} x_1 + \frac{1}{4} x_2 \\ \frac{1}{4} x_1 + \frac{1}{5} x_2 \end{pmatrix} $

Se quiere hallar:

$\|A\|_{\infty} = \max\limits_{\|x\|_\infty = 1} \|Ax\|_\infty$

Teniendo en cuenta que:

$ \|x\|_{\infty} = 1 \Rightarrow \left\{ \begin{array}{l} |x_1| \leq 1, |x_2| = 1 \\ \enspace \text{ó} \\ |x_2| \leq 1, |x_1| = 1 \end{array} \right. $

Así que con:

$ x = \begin{pmatrix} 1 \\ 1 \end{pmatrix} $ ó $ \begin{pmatrix} -1 \\ -1 \end{pmatrix} $

Entonces:

$\|A\|_{\infty} = \max\limits_{\|x\|_\infty = 1} \|Ax\|_\infty = \dfrac{1}{3} + \dfrac{1}{4} = \dfrac{7}{12}$


Propiedades:

a) $\|A\| \geq 0\,.$

b) $\|A\| = 0$ sólo si $A = 0\,.$

c) $\|\alpha A\| = |\alpha| \|A\|\,,$ $\alpha$ es un escalar.

d) $\|A + B\| \leq \|A\|+\|B\|\,.$

e) $\|Ax\| \leq \|A\|\|x\|\,.$

g) $\|A B\| \leq \|A\| \|B\|\,.$

3) Número de condición de una matriz, el cual se define como:

$ \kappa(A) = \|A\| \|A^{-1}\| \Rightarrow \left\{ \begin{array}{l} \kappa_{\infty}(A) \\[1ex] \kappa_2(A) \\[1ex] \kappa_1(A) \end{array} \right. $


Ejemplo:

Hallar $\kappa_\infty(A)$ de la matriz del ejemplo anterior:

$ A = \begin{pmatrix} 1{∕}3 & 1{∕}4 \\ 1{∕}4 & 1{∕}5 \end{pmatrix} $

Se calcula $A^{-1}$, obteniéndose:

$ A^{-1} = \begin{pmatrix} 48 & -60 \\ -60 & 80 \end{pmatrix} $

Siendo:

$ A^{-1} x = \begin{pmatrix} 48x_1 - 60x_2 \\ -60x_1 + 80x_2 \end{pmatrix} $

Entonces:

$\|A^{-1}\|_\infty = \max\limits_{\|x\|_\infty = 1} \|A^{-1}x\|_\infty = 140\,,$ con $ x = \begin{pmatrix} -1 \\ 1 \end{pmatrix} $ ó $ \begin{pmatrix} 1 \\ -1 \end{pmatrix} $

Por tanto:

$\kappa_\infty(A) = \|A\|_\infty \|A^{-1}\|_\infty = \dfrac{7}{12} 140 = 81{,}7$


Para un sistema lineal $Ax = b$:

Error $\Delta b \Rightarrow$ Error $\Delta x$

Esto es:

$ \begin{array}{c} A(x + \Delta x) = b + \Delta b \\[1ex] \cancel{Ax} \! + A \Delta x = \! \cancel{b} \! + \Delta b \\[1ex] A \Delta x = \Delta b \\[1ex] \Delta x = A^{-1} \Delta b \end{array} $

Siendo el error de forma relativa (o error relativo):

$\dfrac{\|\Delta x\|}{\|x\|} \,; \dfrac{\|\Delta b\|}{\|b\|}$

Para averiguar su importancia, se empieza por:

$ \begin{array}{c} \|\Delta x\| = \|A^{-1} \Delta b\| \leq \|A^{-1}\| \|\Delta b\| \\[1ex] \dfrac{\|\Delta x\|}{\|x\|} \leq \dfrac{\|A^{-1}\| \|\Delta b\|}{\|x\|} \end{array} $

También:

$ \begin{array}{c} \|b\| = \|Ax\| \leq \|A\| \|x\| \\[1ex] \dfrac{1}{\|x\|} \leq \dfrac{\|A\|}{\|b\|} \end{array} $

Así que:

$\dfrac{\|\Delta x\|}{\|x\|} \leq \dfrac{\|A^{-1}\| \|\Delta b\|}{\|x\|} \leq \underbrace{\|A\| \|A^{-1}\|}_{\kappa(A)} \dfrac{\|\Delta b\|}{\|b\|}$

Por tanto:

$\boxed{\dfrac{\|\Delta x\|}{\|x\|} \leq \kappa(A) \dfrac{\|\Delta b\|}{\|b\|}}$

Siendo:

$\kappa(A) = \|A\|\|A^{-1}\| \geq \|AA^{-1}\| = \|I\|$

Donde $I$ es la matriz identidad, para la cual:

$\|I\| = \max\limits_{\|x\| = 1} \|Ix\| = \max\limits_{\|x\| = 1} \|x\| = 1$

Así pues:

$\kappa(A) \geq 1$

Cuando su valor es grande se dice que es un problema mal condicionado.


Ejemplo:

Se tiene el sistema $Ax = b$ tal que:

$ A = \begin{pmatrix} 1{∕}3 & 1{∕}4 \\ 1{∕}4 & 1{∕}5 \end{pmatrix} \qquad b = \begin{pmatrix} 7{∕}12 \\ 0{,}45 \end{pmatrix} $

Cuya solución exacta es:

$ x = \begin{pmatrix} 1 \\ 1 \end{pmatrix} $

Para un vector término independiente ligeramente distinto:

$ \overline{b} = \begin{pmatrix} 0{,}583 \\ 0{,}45 \end{pmatrix} \Rightarrow \overline{x} = \begin{pmatrix} 0{,}984 \\ 1{,}020 \end{pmatrix} $

Entonces:

$ \begin{array}{l} \begin{aligned} \Delta b &= \overline{b} - b = \begin{pmatrix} 0{,}583 \\ 0{,}45 \end{pmatrix} - \begin{pmatrix} 7{∕}12 \\ 0{,}45 \end{pmatrix} = \\[1ex] &= \begin{pmatrix} 0{,}583 - 0{,}5833333\ldots \\ 0 \end{pmatrix} = \begin{pmatrix} -10^{-3}{∕}3 \\ 0 \end{pmatrix} \end{aligned} \\[1em] \begin{aligned} \Delta x &= \overline{x} - x = \begin{pmatrix} 0{,}984 \\ 1{,}020 \end{pmatrix} - \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} -0{,}016 \\ 0{,}020 \end{pmatrix} \end{aligned} \end{array} $

Siendo pues:

$ \begin{array}{l} \|\Delta b\|_\infty = 10^{-3}{∕}3 \\[1ex] \|\Delta x\|_\infty = 0{,}020 \end{array} $

Por consiguiente:

$ \begin{array}{l} \dfrac{\|\Delta x\|_\infty}{\|x\|_\infty} = 0{,}020 \\[1ex] \dfrac{\|\Delta b\|_\infty}{\|b\|_\infty} = \dfrac{4}{7} \cdot 10^{-3} \end{array} $

Según la fórmula que se vio:

$\dfrac{\|\Delta x\|_\infty}{\|x\|_\infty} \leq \kappa_\infty (A) \dfrac{\|\Delta b\|_\infty}{\|b\|_\infty} = 81{,}7 \cdot \dfrac{4}{7} \cdot 10^{-3} = 0{,}047$

Donde se ha usado para el número de condición el valor que se halló en el ejemplo previo.