Saltar al contenido principal
LibreTexts Español

11.2: Multiplicar Matriz

  • Page ID
    115544
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Lea la Sección 10.1 del libro de álgebra lineal aplicada de Stephen Boyd y Lieven Vandenberghe que cubre la Multiplicación de Matrices. Aquí hay una revisión rápida:

    Dos matrices\(A\) y se\(B\) pueden multiplicar juntas si y sólo si sus “dimensiones internas” son las mismas,\(A\) es decir, es\(n \times d \) y\(B\) es\(d \times m\) (tenga en cuenta que las columnas de\(A\) y las filas de\(B\) son ambas\(d\)). La multiplicación de estas dos matrices da como resultado una tercera matriz\(C\) con la dimensión de\(n \times m\). Tenga en cuenta que\(C\) tiene la misma primera dimensión que\(A\) y la misma segunda dimensión que\(B\). es decir\(n \times m\).

    El elemento (\(i\),\(j\)) en\(C\) es el producto punto de la fila\(i\) th de\(A\) y la\(j\) th columna de\(B\).

    La fila\(i\) th de\(A\) es:

    \[ [ a_{i1}, a_{i2}, \dots , a_{id} ], \nonumber \]

    y la columna\(j\) th de\(B\) es:

    \ [\ begin {split}
    \ left [
    \ begin {matrix}
    b_ {1j}\\
    b_ {2j}\\
    \ vdots\\
    b_ {dj}
    \ end {matrix}
    \ derecha]
    \ end {split}\ nonumber\]

    Entonces, el producto punto de estos dos vectores es:

    \[c_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \dots + a_{id}b_{dj} \nonumber \]

    Considera el\(2 \times 2\) ejemplo simple a continuación:

    \ [\ begin {split}
    \ left [
    \ begin {matrix}
    a & b\\
    c & d
    \ end {matrix}
    \ right]
    \ left [
    \ begin {matrix}
    w & x\\
    y & z
    \ end {matrix}
    \ right]
    =
    \ left [
    \ begin {matrix}
    aw+by & ax+bz\\
    cw + dy & cx + dz
    \ end {matrix}
    \ right]
    \ end {split}\ nonumber\]

    Hagamos un ejemplo usando numpy y mostremos los resultados usando sympy:

    import numpy as np
    import sympy as sym
    sym.init_printing(use_unicode=True) # Trick to make matrixes look nice in jupyter
    A = np.matrix([[1,1], [2,2]])
    sym.Matrix(A)
    # 'Run' this cell to see the output
    B = np.matrix([[3,4], [3,4]])
    sym.Matrix(B)
    # 'Run' this cell to see the output
    sym.Matrix(A*B)
    # 'Run' this cell to see the output
    Hacer esto

    Dadas dos matrices;\(A\) y\(B\), mostrar que el orden importa al hacer una matriz multiplicar. Es decir, en general,\(AB \neq BA\). Muestra esto con un ejemplo usando dos\(3 \times 3\) matrices y numpy.

    # Put your code here.

    Ahora considere el siguiente conjunto de ecuaciones lineales:

    \[ 3x_1-3x_2+9x_3 =~24 \nonumber \]

    \[ 2x_1-2x_2+7x_3 =~17 \nonumber \]

    \[ -x_1+2x_2-4x_3 = -11 \nonumber \]

    Normalmente escribimos esto en la siguiente forma:

    \ [\ begin {split}
    \ left [
    \ begin {matrix}
    3 & -3 & 9\\
    2 & -2 & 7\\
    -1 & 2 & 2 & -4
    \ end {matrix}
    \ right]
    \ left [
    \ begin {matrix}
    x_1\\
    x_2\\
    x_3
    \ final {matriz}
    \ derecha]
    =
    \ izquierda [
    \ comenzar {matriz}
    24\\
    17\
    -11
    \ final {matriz}
    \ derecha]
    \ end {split}\ nonumber\]

    Observe cómo hacer la multiplicación matricial resulta de nuevo en el sistema original de ecuaciones. Si renombramos las tres matrices de arriba a\(A\)\(x\),,\(x\) y\(b\) (note y\(b\) son minúsculas porque son vectores de columna) entonces obtenemos la ecuación principal para esta clase, que es:

    \[Ax=b \nonumber \]

    Tenga en cuenta que la información sobre la ecuación no cambia cuando cambia de formato. Por ejemplo, el formato de ecuación, el formato incrementado y el\(Ax=b\) formato contienen la misma información. Sin embargo, utilizamos los diferentes formatos para diferentes aplicaciones. Considere la función numpy.linalg.solve que asume el formato\(Ax=b\)

    A = np.matrix([[3, -3,9], [2, -2, 7], [-1, 2, -4]])
    sym.Matrix(A)
    # 'Run' this cell to see the output
    b = np.matrix([[24], [17], [-11]])
    sym.Matrix(b)
    # 'Run' this cell to see the output
    #Calculate answer to x using numpy
    x = np.linalg.solve(A,b)
    sym.Matrix(x)
    # 'Run' this cell to see the output
    Pregunta

    ¿Cuál es el tamaño de la matriz resultante de multiplicar una\(10 \times 40\) matriz por una\(40 \times 3\) matriz?


    This page titled 11.2: Multiplicar Matriz is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Dirk Colbry via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.