Saltar al contenido principal
LibreTexts Español

10.3: Básico Gauss Jordan

  • Page ID
    115585
  • \( \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}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    #  Load Useful Python Libraries
    import numpy as np
    import sympy as sym
    sym.init_printing(use_unicode=True)

    A continuación se presenta la implementación del algoritmo básico de eliminación Gauss-Jordan para Matrix\(A^{m \times n}\) (pseudocódigo):

    for i from 1 to m:
        for j from 1 to m    
            if i ≠ j:
                Ratio = A[j,i]/A[i,i]
                #Elementary Row Operation 3
                for k from 1 to n:
                    A[j,k] = A[j,k] - Ratio * A[i,k]
                next k
            endif
        next j
        
        #Elementary Row Operation 2
        Const = A[i,i]
        for k from 1 to n:
            A[i,k] = A[i,k]/Const
    next i
    
    Hacer esto

    usando el Pseudocódigo proporcionado anteriormente, escriba una función basic_gauss_jordan que tome una lista de listas\(A\) como entrada y devuelva la lista modificada de listas:

    # Put your answer here.

    Comprobemos su función aplicando la función basic_gauss_jordan y verifiquemos para ver si coincide con la respuesta de la matriz\(A\) en el video previo a la clase:

    A = [[1, 1, 1, 2], [2, 3, 1, 3], [0, -2, -3, -8]]
    answer = basic_gauss_jordan(A)
    sym.Matrix(answer)
    answer_from_video = [[1, 0, 0, -1], [0, 1, 0, 1], [0, 0, 1, 2]]
    np.allclose(answer, answer_from_video)

    El psuedocode anterior no funciona correctamente para todas las matrices. Por ejemplo, considere la siguiente matriz aumentada:

    \ [\ begin {split}
    B =\ left [
    \ begin {matrix}
    0 & 1 & 33\\
    5 & 3 & 7\\
    6 & 69 & 4
    \ end {matrix}
    \,\ middle\ vert\,
    \ begin {matrix}
    30\\
    90\\
    420
    \ end {matriz}
    \ derecha]
    \ end {split}\ nonumber\]

    Pregunta

    Explica por qué la función basic_gauss_jordan proporcionada no funciona en la matriz\(B\)?

    Pregunta

    Describe cómo podrías modificar la matriz\(B\) para que funcione con basic_gauss_jordan Y aún así dar la solución correcta?


    This page titled 10.3: Básico Gauss Jordan 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.