Ejercicios realizados

parent 421c5bf6
...@@ -987,7 +987,7 @@ ...@@ -987,7 +987,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 27,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -999,63 +999,63 @@ ...@@ -999,63 +999,63 @@
" [ 0. 0. 2. -1. 2.]\n", " [ 0. 0. 2. -1. 2.]\n",
" [ 1. 1. 0. 2. -1.]\n", " [ 1. 1. 0. 2. -1.]\n",
" [ 2. 0. -1. 1. 1.]\n", " [ 2. 0. -1. 1. 1.]\n",
" [ 0. 0. 0. 1. 8.]] \n", " [ 0. 1. 0. 1. 8.]] \n",
"\n", "\n",
"Intercambio renglon 1 por renglon 4 :\n", "Intercambio renglon 1 por renglon 4 :\n",
" [[ 2. 0. -1. 1. 1.]\n", " [[ 2. 0. -1. 1. 1.]\n",
" [ 0. 0. 2. -1. 2.]\n", " [ 0. 0. 2. -1. 2.]\n",
" [ 1. 1. 0. 2. -1.]\n", " [ 1. 1. 0. 2. -1.]\n",
" [ 0. 2. -3. 4. 5.]\n", " [ 0. 2. -3. 4. 5.]\n",
" [ 0. 0. 0. 1. 8.]] \n", " [ 0. 1. 0. 1. 8.]] \n",
"\n", "\n",
"Elimino Columna 1 :\n", "Elimino Columna 1 :\n",
" [[ 1. 0. -0.5 0.5 0.5]\n", " [[ 1. 0. -0.5 0.5 0.5]\n",
" [ 0. 0. -2. 1. -2. ]\n", " [ 0. 0. -2. 1. -2. ]\n",
" [ 0. -1. -0.5 -1.5 1.5]\n", " [ 0. -1. -0.5 -1.5 1.5]\n",
" [ 0. -2. 3. -4. -5. ]\n", " [ 0. -2. 3. -4. -5. ]\n",
" [ 0. 0. -0. -1. -8. ]] \n", " [ 0. -1. -0. -1. -8. ]] \n",
"\n", "\n",
"Intercambio renglon 2 por renglon 4 :\n", "Intercambio renglon 2 por renglon 4 :\n",
" [[ 1. 0. -0.5 0.5 0.5]\n", " [[ 1. 0. -0.5 0.5 0.5]\n",
" [ 0. -2. 3. -4. -5. ]\n", " [ 0. -2. 3. -4. -5. ]\n",
" [ 0. -1. -0.5 -1.5 1.5]\n", " [ 0. -1. -0.5 -1.5 1.5]\n",
" [ 0. 0. -2. 1. -2. ]\n", " [ 0. 0. -2. 1. -2. ]\n",
" [ 0. 0. -0. -1. -8. ]] \n", " [ 0. -1. -0. -1. -8. ]] \n",
"\n", "\n",
"Elimino Columna 2 :\n", "Elimino Columna 2 :\n",
" [[ 1. 0. -0.5 0.5 0.5]\n", " [[ 1. 0. -0.5 0.5 0.5]\n",
" [-0. 1. -1.5 2. 2.5]\n", " [-0. 1. -1.5 2. 2.5]\n",
" [ 0. 0. 2. -0.5 -4. ]\n", " [ 0. 0. 2. -0.5 -4. ]\n",
" [-0. 0. 2. -1. 2. ]\n", " [-0. 0. 2. -1. 2. ]\n",
" [-0. 0. 0. 1. 8. ]] \n", " [ 0. 0. 1.5 -1. 5.5]] \n",
"\n", "\n",
"Elimino Columna 3 :\n", "Elimino Columna 3 :\n",
" [[ 1. 0. -0.5 0.5 0.5 ]\n", " [[ 1. 0. -0.5 0.5 0.5 ]\n",
" [-0. 1. -1.5 2. 2.5 ]\n", " [-0. 1. -1.5 2. 2.5 ]\n",
" [ 0. 0. 1. -0.25 -2. ]\n", " [ 0. 0. 1. -0.25 -2. ]\n",
" [ 0. 0. 0. 0.5 -6. ]\n", " [ 0. 0. 0. 0.5 -6. ]\n",
" [ 0. 0. 0. -1. -8. ]] \n", " [ 0. 0. 0. 0.625 -8.5 ]] \n",
"\n", "\n",
"Intercambio renglon 4 por renglon 5 :\n", "Intercambio renglon 4 por renglon 5 :\n",
" [[ 1. 0. -0.5 0.5 0.5 ]\n", " [[ 1. 0. -0.5 0.5 0.5 ]\n",
" [-0. 1. -1.5 2. 2.5 ]\n", " [-0. 1. -1.5 2. 2.5 ]\n",
" [ 0. 0. 1. -0.25 -2. ]\n", " [ 0. 0. 1. -0.25 -2. ]\n",
" [ 0. 0. 0. -1. -8. ]\n", " [ 0. 0. 0. 0.625 -8.5 ]\n",
" [ 0. 0. 0. 0.5 -6. ]] \n", " [ 0. 0. 0. 0.5 -6. ]] \n",
"\n", "\n",
"Elimino Columna 4 :\n", "Elimino Columna 4 :\n",
" [[ 1. 0. -0.5 0.5 0.5 ]\n", " [[ 1. 0. -0.5 0.5 0.5 ]\n",
" [-0. 1. -1.5 2. 2.5 ]\n", " [ -0. 1. -1.5 2. 2.5 ]\n",
" [ 0. 0. 1. -0.25 -2. ]\n", " [ 0. 0. 1. -0.25 -2. ]\n",
" [-0. -0. -0. 1. 8. ]\n", " [ 0. 0. 0. 1. -13.6 ]\n",
" [-0. -0. -0. 0. 10. ]] \n", " [ 0. 0. 0. 0. -0.8 ]] \n",
"\n", "\n",
"Elimino Columna 5 :\n", "Elimino Columna 5 :\n",
" [[ 1. 0. -0.5 0.5 0.5 ]\n", " [[ 1. 0. -0.5 0.5 0.5 ]\n",
" [-0. 1. -1.5 2. 2.5 ]\n", " [ -0. 1. -1.5 2. 2.5 ]\n",
" [ 0. 0. 1. -0.25 -2. ]\n", " [ 0. 0. 1. -0.25 -2. ]\n",
" [-0. -0. -0. 1. 8. ]\n", " [ 0. 0. 0. 1. -13.6 ]\n",
" [-0. -0. -0. 0. 1. ]] \n", " [ -0. -0. -0. -0. 1. ]] \n",
"\n", "\n",
"Ahora hacia arriba:\n", "Ahora hacia arriba:\n",
"Elimino Columna 5 :\n", "Elimino Columna 5 :\n",
...@@ -1063,49 +1063,49 @@ ...@@ -1063,49 +1063,49 @@
" [ 0. -1. 1.5 -2. 0. ]\n", " [ 0. -1. 1.5 -2. 0. ]\n",
" [ 0. 0. -1. 0.25 0. ]\n", " [ 0. 0. -1. 0.25 0. ]\n",
" [ 0. 0. 0. -1. 0. ]\n", " [ 0. 0. 0. -1. 0. ]\n",
" [-0. -0. -0. 0. 1. ]] \n", " [-0. -0. -0. -0. 1. ]] \n",
"\n", "\n",
"Elimino Columna 4 :\n", "Elimino Columna 4 :\n",
" [[ 1. 0. -0.5 0. 0. ]\n", " [[ 1. 0. -0.5 0. 0. ]\n",
" [ 0. 1. -1.5 0. 0. ]\n", " [ 0. 1. -1.5 0. 0. ]\n",
" [-0. -0. 1. 0. -0. ]\n", " [-0. -0. 1. 0. -0. ]\n",
" [-0. -0. -0. 1. -0. ]\n", " [-0. -0. -0. 1. -0. ]\n",
" [-0. -0. -0. 0. 1. ]] \n", " [-0. -0. -0. -0. 1. ]] \n",
"\n", "\n",
"Elimino Columna 3 :\n", "Elimino Columna 3 :\n",
" [[-1. 0. 0. -0. 0.]\n", " [[-1. 0. 0. -0. 0.]\n",
" [ 0. -1. 0. -0. 0.]\n", " [ 0. -1. 0. -0. 0.]\n",
" [-0. -0. 1. 0. -0.]\n", " [-0. -0. 1. 0. -0.]\n",
" [-0. -0. -0. 1. -0.]\n", " [-0. -0. -0. 1. -0.]\n",
" [-0. -0. -0. 0. 1.]] \n", " [-0. -0. -0. -0. 1.]] \n",
"\n", "\n",
"Elimino Columna 2 :\n", "Elimino Columna 2 :\n",
" [[ 1. 0. -0. 0. -0.]\n", " [[ 1. 0. -0. 0. -0.]\n",
" [-0. 1. -0. 0. -0.]\n", " [-0. 1. -0. 0. -0.]\n",
" [-0. -0. 1. 0. -0.]\n", " [-0. -0. 1. 0. -0.]\n",
" [-0. -0. -0. 1. -0.]\n", " [-0. -0. -0. 1. -0.]\n",
" [-0. -0. -0. 0. 1.]] \n", " [-0. -0. -0. -0. 1.]] \n",
"\n", "\n",
"Elimino Columna 1 :\n", "Elimino Columna 1 :\n",
" [[ 1. 0. -0. 0. -0.]\n", " [[ 1. 0. -0. 0. -0.]\n",
" [-0. 1. -0. 0. -0.]\n", " [-0. 1. -0. 0. -0.]\n",
" [-0. -0. 1. 0. -0.]\n", " [-0. -0. 1. 0. -0.]\n",
" [-0. -0. -0. 1. -0.]\n", " [-0. -0. -0. 1. -0.]\n",
" [-0. -0. -0. 0. 1.]] \n", " [-0. -0. -0. -0. 1.]] \n",
"\n", "\n",
"Mi Inversa=\n", "Mi Inversa=\n",
" [[ 0.05 0.35 -0.1 0.55 -0.2 ]\n", " [[ 3.25 5.75 -2.5 1.75 -4. ]\n",
" [ 0.8 1.35 -0.6 0.3 -0.95]\n", " [ 16. 27. -12. 6. -19. ]\n",
" [-0.25 0. 0.5 -0.25 0.25]\n", " [ -4.25 -6.75 3.5 -1.75 5. ]\n",
" [-0.4 -0.8 0.8 -0.4 0.6 ]\n", " [-10. -17. 8. -4. 12. ]\n",
" [ 0.05 0.1 -0.1 0.05 0.05]]\n", " [ -0.75 -1.25 0.5 -0.25 1. ]]\n",
"\n", "\n",
"np.linalg.inv=\n", "np.linalg.inv=\n",
" [[ 0.05 0.35 -0.1 0.55 -0.2 ]\n", " [[ 3.25 5.75 -2.5 1.75 -4. ]\n",
" [ 0.8 1.35 -0.6 0.3 -0.95]\n", " [ 16. 27. -12. 6. -19. ]\n",
" [-0.25 0. 0.5 -0.25 0.25]\n", " [ -4.25 -6.75 3.5 -1.75 5. ]\n",
" [-0.4 -0.8 0.8 -0.4 0.6 ]\n", " [-10. -17. 8. -4. 12. ]\n",
" [ 0.05 0.1 -0.1 0.05 0.05]]\n" " [ -0.75 -1.25 0.5 -0.25 1. ]]\n"
] ]
} }
], ],
...@@ -1115,7 +1115,7 @@ ...@@ -1115,7 +1115,7 @@
" [0, 0, 2, -1, 2],\n", " [0, 0, 2, -1, 2],\n",
" [1, 1, 0, 2, -1],\n", " [1, 1, 0, 2, -1],\n",
" [2, 0, -1, 1, 1],\n", " [2, 0, -1, 1, 1],\n",
" [0, 0, 0, 1, 8]])\n", " [0, 1, 0, 1, 8]])\n",
"\n", "\n",
"print('Mi Inversa=\\n', Inversa(H))\n", "print('Mi Inversa=\\n', Inversa(H))\n",
"print('\\nnp.linalg.inv=\\n', np.linalg.inv(H))" "print('\\nnp.linalg.inv=\\n', np.linalg.inv(H))"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment