Skip to content

Instantly share code, notes, and snippets.

@viniciusmss
Created September 25, 2019 12:43
Show Gist options
  • Select an option

  • Save viniciusmss/cdd4b2864b38011d23c79735265de5bd to your computer and use it in GitHub Desktop.

Select an option

Save viniciusmss/cdd4b2864b38011d23c79735265de5bd to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Assignment 1: Linear Systems of Equations\n",
"---\n",
"## Skill-Building\n",
"### 1.1\n",
"\n",
"\n",
"a)\n",
"\n",
"$$\n",
"x + 2y + z = 3\n",
"$$\n",
"\n",
"$$\n",
"x + 3y -z = 1\n",
"$$\n",
"\n",
"$$\n",
"3x + 8y +4z = 10\n",
"$$\n",
"\n",
"__Augmented Matrix__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & 2 & 1 & 3 \\\\\n",
"1 & 3 & -1 & 1 \\\\\n",
"3 & 8 & 4 & 10\n",
"\\end{bmatrix}\n",
"$$\n",
"\n",
"__RREF__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & 2 & 1 & 3 \\\\\n",
"1 & 3 & -1 & 1 \\\\\n",
"3 & 8 & 4 & 10\n",
"\\end{bmatrix}\\xrightarrow[R_3=R_3-3R_1]{R_2=R_2-R_1}\\begin{bmatrix}\n",
"1 & 2 & 1 & 3 \\\\\n",
"0 & 1 & -2 & -2 \\\\\n",
"0 & 2 & 1 & 1\n",
"\\end{bmatrix}\\xrightarrow{R_3=R_3-2R_2}\\begin{bmatrix}\n",
"1 & 2 & 1 & 3 \\\\\n",
"0 & 1 & -2 & -2 \\\\\n",
"0 & 0 & 5 & 5\n",
"\\end{bmatrix}\\xrightarrow{R_3=\\frac{R_3}{5}}\\begin{bmatrix}\n",
"1 & 2 & 1 & 3 \\\\\n",
"0 & 1 & -2 & -2 \\\\\n",
"0 & 0 & 1 & 1\n",
"\\end{bmatrix}\\xrightarrow[R_1=R_1-R_3]{R_2=R_2+2R_3}\\begin{bmatrix}\n",
"1 & 2 & 0 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 1\n",
"\\end{bmatrix}\\xrightarrow{R_1=R_1-2R_2}\\begin{bmatrix}\n",
"1 & 0 & 0 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 1\n",
"\\end{bmatrix}$$\n",
"\n",
"__Consistency__\n",
"\n",
"All matrix columns have pivots, leading to a unique solution. The system is consistent.\n",
"\n",
"__Solution__\n",
"\n",
"Unique. $(x, y, z) = (2, 0, 1)$\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[1 0 0 2]\n",
"[0 1 0 0]\n",
"[0 0 1 1]"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"show(matrix([[1, 2, 1, 3], [1, 3, -1, 1], [3, 8, 4, 10]]).rref())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"b)\n",
"$$\n",
"4x -8y + 16z = 8\n",
"$$\n",
"$$\n",
"2x - 3y +5z = 3\n",
"$$\n",
"$$\n",
"3x -4y +6z = 7\n",
"$$\n",
"\n",
"__Augmented Matrix__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"4 & -8 & 16 & 8 \\\\\n",
"2 & -3 & 5 & 3 \\\\\n",
"3 & -4 & 6 & 7\n",
"\\end{bmatrix}\n",
"$$\n",
"\n",
"__RREF__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"4 & -8 & 16 & 8 \\\\\n",
"2 & -3 & 5 & 3 \\\\\n",
"3 & -4 & 6 & 7\n",
"\\end{bmatrix}\\xrightarrow[R_2=R_2-\\frac{R_1}{2}]{R_3=R_3-\\frac{3R_1}{4}}\\begin{bmatrix}\n",
"4 & -8 & 16 & 8 \\\\\n",
"0 & 1 & -3 & -1 \\\\\n",
"0 & 2 & -6 & 1\n",
"\\end{bmatrix}\\xrightarrow{R_3=R_3-2R_2}\\begin{bmatrix}\n",
"4 & -8 & 16 & 8 \\\\\n",
"0 & 1 & -3 & -1 \\\\\n",
"0 & 0 & 0 & 3\n",
"\\end{bmatrix}$$\n",
"\n",
"__Consistency__\n",
"\n",
"The coefficients of all variables in the third row are zero whereas the independent value is non-zero, showing that the system is inconsistent. \n",
"\n",
"__Solution__\n",
"\n",
"Does not exist.\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & 0 & -2 & 0 \\\\\n",
"0 & 1 & -3 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[ 1 0 -2 0]\n",
"[ 0 1 -3 0]\n",
"[ 0 0 0 1]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"show(matrix([[4, -8, 16, 8], [2, -3, 5, 3], [3, -4, 6, 7]]).rref()) \n",
"# The RREF form does not need to equate the one given above, since it still shows that the system is inconsistent"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"c)\n",
"$$\n",
"x +y + 3z = 1\n",
"$$\n",
"$$\n",
"6x +9y -3z = 9\n",
"$$\n",
"$$\n",
"10x +14y +2z = 14\n",
"$$\n",
"\n",
"__Augmented Matrix__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & 1 & 3 & 1 \\\\\n",
"6 & 9 & -3 & 9 \\\\\n",
"10 & 14 & 2 & 14\n",
"\\end{bmatrix}\n",
"$$\n",
"\n",
"__RREF__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & 1 & 3 & 1 \\\\\n",
"6 & 9 & -3 & 9 \\\\\n",
"10 & 14 & 2 & 14\n",
"\\end{bmatrix}\\xrightarrow[R_2=R_2-6R_1]{R_3=R_3-10R_1}\\begin{bmatrix}\n",
"1 & 1 & 3 & 1 \\\\\n",
"0 & 3 & -21 & 3 \\\\\n",
"0 & 4 & -28 & 4\n",
"\\end{bmatrix}\\xrightarrow{R_3=R_3-\\frac{4R_2}{3}}\\begin{bmatrix}\n",
"1 & 1 & 3 & 1 \\\\\n",
"0 & 3 & -21 & 3 \\\\\n",
"0 & 0 & 0 & 0\n",
"\\end{bmatrix}\\xrightarrow{R_2=\\frac{R_2}{3}}\\begin{bmatrix}\n",
"1 & 1 & 3 & 1 \\\\\n",
"0 & 1 & -7 & 1 \\\\\n",
"0 & 0 & 0 & 0\n",
"\\end{bmatrix}\\xrightarrow{R_1=R_1-R_2}\\begin{bmatrix}\n",
"1 & 0 & 10 & 0 \\\\\n",
"0 & 1 & -7 & 1 \\\\\n",
"0 & 0 & 0 & 0\n",
"\\end{bmatrix}$$\n",
"\n",
"__Consistency__\n",
"\n",
"Both all variables and independent terms on the third row are equal to zero. The third row has no pivot. The system is consistent and has one degree of freedom.\n",
"\n",
"__Solution__\n",
"\n",
"Since $y - 7z = 1$, let $y(z) = 1 + 7z$. Furthermore, since $x + 10z = 0$, let $x(z) = -10z$. The solution set will be given by $\\{(-10z,1 + 7z), \\forall z \\in \\mathbb{R}\\}$.\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & 0 & 10 & 0 \\\\\n",
"0 & 1 & -7 & 1 \\\\\n",
"0 & 0 & 0 & 0\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[ 1 0 10 0]\n",
"[ 0 1 -7 1]\n",
"[ 0 0 0 0]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"show(matrix([[1, 1, 3, 1], [6, 9, -3, 9], [10, 14, 2, 14]]).rref())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1.2\n",
"\n",
"$$\\begin{bmatrix}\n",
"1 & 2 & 3 & a \\\\\n",
"0 & 4 & 5 & b \\\\\n",
"0 & 0 & d & c\n",
"\\end{bmatrix}$$\n",
"\n",
"__a) No solutions__\n",
"\n",
"For a system to have no solutions, the variable of one row should be all reduced to zero and an independent term should be non-zero. The only row where these conditions can be realized is the third one for $d = 0$ and $c \\neq 0$, regardless of the values of $a$ and $b$. \n",
"\n",
"__b) Infinitely-many solutions__\n",
"\n",
"A system with infinitely-many solutions will have one degree of freedom, which entails a row completed with zeros. Hence, we require $d = c = 0$. The system would then have a free variable which would determine the values of $a$ and $b$.\n",
"\n",
"In both cases, we can see that the values of $a$ and $b$ do not affect the solvability of the system."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1.3\n",
"\n",
"Homogeneous systems are those of the form \n",
"$$\\begin{bmatrix}\n",
"a & b & c & 0 \\\\\n",
"d & e & f& 0 \\\\\n",
"g & h & i & 0\n",
"\\end{bmatrix}.$$\n",
"\n",
"A system is inconsistent _only_ when it constains a row for which all variable coefficients are zero and the independent term in non-zero. Given that all independent terms of a homogeneous system are zero, this condition will never be fulfilled. That zero vector will always satisfy homogeneous systems.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2.1\n",
"\n",
"__For Matrix a)__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__i)__\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & -2 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & -1 \\\\\n",
"0 & 1 & 2 \\\\\n",
"0 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & 0 & 1/5 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & -2 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"-1 & 1 & 0 \\\\\n",
"-3 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 2 & 1 & 3 \\\\\n",
"1 & 3 & -1 & 1 \\\\\n",
"3 & 8 & 4 & 10\n",
"\\end{bmatrix}=\\begin{bmatrix}\n",
"1 & 0 & 0 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 1\n",
"\\end{bmatrix}$$\n",
"\n",
"__ii)__\n",
"The matrix is invertible since there's a set of elementary matrices that turns the matrix A into the identity matrix. If these elementary matrices were multiplied together, they would form A's inverse.\n",
"\n",
"\n",
"__iii)__\n",
"As mentioned above, the inverse of A combines all the operations from the elementary matrices.\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & -2 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & -1 \\\\\n",
"0 & 1 & 2 \\\\\n",
"0 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & 0 & 1/5 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & -2 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"-1 & 1 & 0 \\\\\n",
"-3 & 0 & 1 \n",
"\\end{bmatrix}=\\begin{bmatrix}\n",
"4 & 0 & -1 \\\\\n",
"-\\frac{7}{5} & \\frac{1}{5} & \\frac{2}{5} \\\\\n",
"-\\frac{1}{5} & -\\frac{2}{5} & \\frac{1}{5} \n",
"\\end{bmatrix}$$"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[1 0 0 2]\n",
"[0 1 0 0]\n",
"[0 0 1 1]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"show(matrix([[1, -2, 0], [0, 1, 0], [0, 0, 1]]) *matrix([[1, 0, -1], [0, 1, 2], [0, 0, 1]]) * matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1/5]]) * matrix([[1, 0, 0], [0, 1, 0], [0, -2, 1]]) * matrix([[1, 0, 0], [-1, 1, 0], [-3, 0, 1]]) * matrix([[1, 2, 1, 3], [1, 3, -1, 1], [3, 8, 4, 10]]))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrr}\n",
"4 & 0 & -1 \\\\\n",
"-\\frac{7}{5} & \\frac{1}{5} & \\frac{2}{5} \\\\\n",
"-\\frac{1}{5} & -\\frac{2}{5} & \\frac{1}{5}\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[ 4 0 -1]\n",
"[-7/5 1/5 2/5]\n",
"[-1/5 -2/5 1/5]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"invert = matrix([[1, -2, 0], [0, 1, 0], [0, 0, 1]]) *matrix([[1, 0, -1], [0, 1, 2], [0, 0, 1]]) * matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1/5]]) * matrix([[1, 0, 0], [0, 1, 0], [0, -2, 1]]) * matrix([[1, 0, 0], [-1, 1, 0], [-3, 0, 1]])\n",
"show(invert)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"assert identity_matrix(3) == matrix([[1, 2, 1], [1, 3, -1], [3, 8, 4]]) * invert"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__For matrix b)__\n",
"\n",
"__i)__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & -2 & 1\n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"-\\frac{1}{2} & 1 & 0 \\\\\n",
"-\\frac{3}{4} & 0 & 1\n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"4 & -8 & 16 & 8 \\\\\n",
"2 & -3 & 5 & 3 \\\\\n",
"3 & -4 & 6 & 7\n",
"\\end{bmatrix}=\\begin{bmatrix}\n",
"4 & -8 & 16 & 8 \\\\\n",
"0 & 1 & -3 & -1 \\\\\n",
"0 & 0 & 0 & 3\n",
"\\end{bmatrix}$$\n",
"\n",
"__ii)__\n",
"If there is not set of operations (or elementary matrices) that when multiplied by A gives the identity matrix, then the original matrix is not invertible.\n",
"\n",
"__iii)__\n",
"Non-invertible.\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 4 -8 16]\n",
"[ 0 1 -3]\n",
"[ 0 0 0]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"matrix([[1, 0, 0], [0, 1, 0], [0, -2, 1]]) * matrix([[1, 0, 0], [-1/2, 1, 0], [-3/4, 0, 1]]) * matrix([[4, -8, 16], [2, -3, 5], [3, -4, 6]])"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"matrix([[4, -8, 16], [2, -3, 5], [3, -4, 6]]).determinant()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__For matrix c)__\n",
"\n",
"__i)__\n",
"\n",
"$$\n",
"\\begin{bmatrix}\n",
"1 & -1 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & \\frac{1}{3} & 0 \\\\\n",
"0 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"0 & 1 & 0 \\\\\n",
"0 & -\\frac{4}{3} & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 0 & 0 \\\\\n",
"-6 & 1 & 0 \\\\\n",
"-10 & 0 & 1 \n",
"\\end{bmatrix}\\times\\begin{bmatrix}\n",
"1 & 1 & 3 & 1 \\\\\n",
"6 & 9 & -3 & 9 \\\\\n",
"10 & 14 & 2 & 14\n",
"\\end{bmatrix}=\\begin{bmatrix}\n",
"1 & 0 & 10 & 0 \\\\\n",
"0 & 1 & -7 & 1 \\\\\n",
"0 & 0 & 0 & 0\n",
"\\end{bmatrix}$$\n",
"\n",
"__ii)__\n",
"Same as above.\n",
"\n",
"__iii)__\n",
"Non-invertible.\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1 0 10 0]\n",
"[ 0 1 -7 1]\n",
"[ 0 0 0 0]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"matrix([[1, -1, 0], [0, 1, 0], [0, 0, 1]]) *matrix([[1, 0, 0], [0, 1/3, 0], [0, 0, 1]]) *matrix([[1, 0, 0], [0, 1, 0], [0, -4/3, 1]]) *matrix([[1, 0, 0], [-6, 1, 0], [-10, 0, 1]]) * matrix([[1, 1, 3, 1], [6, 9, -3, 9], [10, 14, 2, 14]])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2.2\n",
"\n",
"a)\n",
"$$\n",
"\\text{Let }B = \\begin{bmatrix}\n",
"0 & 2 \\\\\n",
"2 & 0\n",
"\\end{bmatrix}\\text{, } C = \\begin{bmatrix}\n",
"2 & 0 \\\\\n",
"0 & -2\n",
"\\end{bmatrix}$$\n",
"\n",
"$$BC = \\begin{bmatrix}\n",
"0 & -4 \\\\\n",
"4 & 0\n",
"\\end{bmatrix}$$\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rr}\n",
"0 & -4 \\\\\n",
"4 & 0\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[ 0 -4]\n",
"[ 4 0]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rr}\n",
"0 & 4 \\\\\n",
"-4 & 0\n",
"\\end{array}\\right)</script></html>"
],
"text/plain": [
"[ 0 4]\n",
"[-4 0]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"B = matrix([[0, 2], [2, 0]])\n",
"C = matrix([[2, 0], [0, -2]])\n",
"\n",
"show(B*C)\n",
"show(C*B)\n",
"assert B*C == -(C*B)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"b)\n",
"$$\n",
"M=\\begin{bmatrix}\n",
"1 & -1 \\\\\n",
"1 & -1\n",
"\\end{bmatrix}$$"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[0 0]\n",
"[0 0]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M = matrix([[1, -1], [1, -1]])\n",
"M ** 2\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[0 0]\n",
"[0 0]"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M * M"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"c)\n",
"\n",
"$$\n",
"\\text{Let }A = \\begin{bmatrix}\n",
"1 & 0 \\\\\n",
"0 & 1\n",
"\\end{bmatrix}\\text{, } B = \\begin{bmatrix}\n",
"0 & 1 \\\\\n",
"1 & 0\n",
"\\end{bmatrix}$$\n",
"\n",
"$$A + B = \\begin{bmatrix}\n",
"1 & 1 \\\\\n",
"1 & 1\n",
"\\end{bmatrix}$$"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"True\n",
"True\n",
"False\n"
]
}
],
"source": [
"A = matrix([[1, 0], [0, 1]]); B = matrix([[0, 1], [1, 0]])\n",
"print A.is_invertible()\n",
"print B.is_invertible()\n",
"print (A+B).is_invertible()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"d)\n",
"\n",
"$$\n",
"\\text{Let }C = \\begin{bmatrix}\n",
"1 & 1 \\\\\n",
"0 & 0\n",
"\\end{bmatrix}\\text{, } D = \\begin{bmatrix}\n",
"1 & 0 \\\\\n",
"1 & 0\n",
"\\end{bmatrix}$$\n",
"\n",
"$$C + D = \\begin{bmatrix}\n",
"2 & 1 \\\\\n",
"1 & 0\n",
"\\end{bmatrix}$$"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"False\n",
"False\n",
"True\n"
]
}
],
"source": [
"C = matrix([[1, 1], [0, 0]]); D = matrix([[1, 0], [1, 0]])\n",
"print C.is_invertible()\n",
"print D.is_invertible()\n",
"print (C+D).is_invertible()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 3.1\n",
"\n",
"a) If `det(A) = 0` then at least one of the cofactors must be zero.\n",
"\n",
"__Answer:__ False. In the simplest case of a 2x2 matrix,\n",
"\n",
"$$\n",
"\\det \\begin{bmatrix}\n",
"1 & 1 \\\\\n",
"1 & 1\n",
"\\end{bmatrix} = 1 \\times \\det \\begin{bmatrix} 1 \\end{bmatrix} - 1 \\times \\det \\begin{bmatrix} 1 \\end{bmatrix} = 1 - 1 = 0\n",
"$$\n",
"\n",
"We see that the determinant of `A` is zero, but none of its (two) cofactors is zero.\n",
"\n",
"\n",
"b) A matrix whose entries are 0s and 1s has determinant 1, 0, or −1.\n",
"\n",
"__Answer:__ False. In the case of a 3x3 matrix,\n",
"$$\n",
"\\det \\begin{bmatrix}\n",
"1 & 0 & 1 \\\\\n",
"1 & 1 & 0 \\\\\n",
"0 & 1 & 1\n",
"\\end{bmatrix} = 1 \\times \\det \\begin{bmatrix}\n",
"1 & 0 \\\\\n",
"1 & 1\n",
"\\end{bmatrix} - 0 \\times \\det \\begin{bmatrix}\n",
"1 & 0 \\\\\n",
"0 & 1\n",
"\\end{bmatrix} + 1 \\times \\det \\begin{bmatrix}\n",
"1 & 1 \\\\\n",
"0 & 1\n",
"\\end{bmatrix} = 1 + 1 = 2\n",
"$$\n",
"\n",
"c) If matrices $A$ and $B$ are identical except that $b_{11} = 2a_{11}$, then $B = 2A$.\n",
"\n",
"__Answer:__ False. Take the case of the following 2x2 matrix:\n",
"\n",
"$$\\text{Let } A = \\begin{bmatrix}\n",
"1 & 1 \\\\\n",
"1 & 0\n",
"\\end{bmatrix}\\text{, then }B = \\begin{bmatrix}\n",
"2 & 1 \\\\\n",
"1 & 0\n",
"\\end{bmatrix}\\text{, where }\\det B = \\det A = -1 \\neq 2(\\det A) = -2\n",
"$$\n",
"\n",
"d) The determinant of a matrix is the product of its pivots.\n",
"\n",
"__Answer:__ True. If A is a pivoted matrix, it entails that it is a upper triangular matrix (i.e., the entries below the main diagonal are all zero). We can set the proof as follows,\n",
"\n",
"$$\n",
"A_{n\\times n} = \n",
" \\begin{bmatrix}\n",
" p_1 & b_{12} & \\cdots & b_{1n} \\\\\n",
" 0& p_2 & \\ddots & b_{2n} \\\\ \n",
" 0& 0 & \\ddots & \\vdots \\\\\n",
" 0& 0& 0& p_n\n",
" \\end{bmatrix}.$$\n",
"$$\\det A = p_1 \\times (\\det A_{1,1}) - b_{12} \\times (\\det A_{1,2}) \\dots, $$\n",
"\n",
"where $p_i$ is the matrix pivot at line $i$, $b_{ij}$ is the entry at line $i$ and column $j$, and $A_{ij}$ is the minor produced by removing line $i$ and column $j$ from matrix $A$. We note that for all non-principal minors $A$ (i.e., $A_{ij} \\mid i \\neq j$), the minor will contain one column with only zero entries. For example,\n",
"\n",
"$$\n",
"A_{12} = \n",
" \\begin{bmatrix}\n",
" 0& b_{23} & b_{2n} \\\\ \n",
" 0& \\ddots & \\vdots \\\\\n",
" 0& 0& p_n\n",
" \\end{bmatrix}.$$\n",
"\n",
"It is a property of determinants that if a matrix contains either a column or row with only zero entries, its determinant is equal to zero. Hence, the expansion of $\\det A$ above reduces to \n",
"\n",
"$$\\det A = p_1 \\times (\\det A_{1,1}) - b_{12} \\times (\\det A_{1,2}) \\dots = p_1 \\times (\\det A_{1,1}).$$\n",
"\n",
"We now note that $A_{1,1}$ is also an upper triangular matrix. The same argument applies, where only the principal minors of $A_{1,1}$ will have non-zero determinants. Hence,\n",
"\n",
"\n",
"$$\\det A = p_1 \\times (\\det A_{1,1}) = p_1 \\times p_2 \\times (\\det A_{[1,2], [1,2]}) = \\prod_{i=1}^np_i$$.\n",
"\n",
"Note that a tighter induction proof could be constructed following the same reasoning as above by noting that $\\det [p_n] = p_n$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 3.2\n",
"\n",
"a) If `A` is invertible and `B` is singular, then `AB` is singular.\n",
"\n",
"If `A` is invertible, we know that its determinant is non-zero. Hence,\n",
"\n",
"$$\\det A = \\det \\begin{bmatrix}\n",
"a & b \\\\\n",
"c & d\n",
"\\end{bmatrix} = ad - bc \\neq 0 \\iff ad \\neq bc.$$\n",
"\n",
"On the other hand, if `B` is singular, we know that its determinant is zero. Thus,\n",
"\n",
"$$\\det B = \\det \\begin{bmatrix}\n",
"e & f \\\\\n",
"g & h\n",
"\\end{bmatrix} = eh - fg = 0 \\iff eh = fg.$$\n",
"\n",
"Now, `AB` has the form\n",
"$$\n",
"\\begin{bmatrix}\n",
"a & b \\\\\n",
"c & d\n",
"\\end{bmatrix} \\begin{bmatrix}\n",
"e & f \\\\\n",
"g & h\n",
"\\end{bmatrix} = \\begin{bmatrix}\n",
"ae + bg & af + bh \\\\\n",
"ce + dg & cf + dh\n",
"\\end{bmatrix},\n",
"$$\n",
"\n",
"whose determinant is\n",
"\n",
"$$\n",
"\\begin{align}\n",
"\\det \\begin{bmatrix}\n",
"ae + bg & af + bh \\\\\n",
"ce + dg & cf + dh\n",
"\\end{bmatrix} &= (ae + bg)(cf + dh) - (ce + dg)(af + bh) \\\\\n",
"&= acef + adeh + bcfg + bdgh - acef - bceh - adfg - bdgh \\\\\n",
"&= adeh + bcfg - bceh - adfg \\\\\n",
"&= adfg + bcfg - bcfg - adfg \\quad\\text{(since } eh = fg \\text{)} \\\\ \n",
"&= 0 \n",
"\\end{align}\n",
"$$\n",
"\n",
"b) If $A$ is singular then $A^T$ is singular.\n",
"\n",
"Since `A` is singular, we know that its determinant is zero. Therefore,\n",
"\n",
"$$\\det A = \\det \\begin{bmatrix}\n",
"a & b \\\\\n",
"c & d\n",
"\\end{bmatrix} = ad - bc = 0 \\iff ad = bc.$$\n",
"\n",
"If we compute the determinant of $A^T$, we find\n",
"\n",
"$$\\det A^T = \\det \\begin{bmatrix}\n",
"a & c \\\\\n",
"b & d\n",
"\\end{bmatrix} = ad - bc = 0.$$\n",
"\n",
"\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Deep Dive\n",
"### 1\n",
"--- \n",
"a) Show that the following two matrices are row-equivalent."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"M1 = matrix([[0, 2, -6, 4], [1, 0, 2, 1], [4, -1, 11, 2]])\n",
"M2 = matrix([[3, -1, 9, 1], [0, 1, -3, 2], [6, 0, 12, 6]])\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1 0 2 1]\n",
"[ 0 1 -3 2]\n",
"[ 0 0 0 0]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M1.rref()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1 0 2 1]\n",
"[ 0 1 -3 2]\n",
"[ 0 0 0 0]"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M2.rref()"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"assert M1.rref() == M2.rref()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"b) Use Sage (or another computational tool) to show that these matrices are row equivalent. Show that if you remove the fourth column instead, the resulting matrices are also row equivalent."
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"# Removing third column\n",
"N1 = matrix([[0, 2, 4], [1, 0, 1], [4, -1, 2]])\n",
"N2 = matrix([[3, -1, 1], [0, 1, 2], [6, 0, 6]])"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"assert N1.rref() == N2.rref()"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"# Removing fourth column\n",
"N3 = matrix([[0, 2, -6], [1, 0, 2], [4, -1, 11]])\n",
"N4 = matrix([[3, -1, 9], [0, 1, -3], [6, 0, 12]])"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"assert N3.rref() == N4.rref()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"c) Could removing the same column from a pair of equivalent matrices affect row equivalance? If so, give an example. If not, give a short justification.\n",
"\n",
"__Answer__: No. Row operations work element-wise, i.e., the $i$th element of row $j$ can only be affected by the $i$th element of a given row $k$. Hence, removing a column has no effect on whether two matrices are row-equivalent since the same operations which change one matrix to the other will continue to work after the removal of equal-index columns from the two matrices. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"d) Show that the system of equations corresponding to the augmented matrix below has no solutions.\n",
"\n",
"__Answer:__ When we reduce the matrix to RREF, we see that the last row contains only zeros except for the last column of independent terms. The RREF thus indicates that the system is inconsistent and has no solutions.\n",
"\n",
"$$\n",
"M = \\begin{bmatrix}\n",
"2 & 4 & 5 \\\\\n",
"2 & 9 & -1 \\\\\n",
"4 & 1 & 20\n",
"\\end{bmatrix}\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1 0 0]\n",
"[0 1 0]\n",
"[0 0 1]"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M = matrix([[2, 4, 5], [2, 9, -1], [4, 1, 20]])\n",
"M.rref()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"e) What happens to the solution set if you remove a row? What does this tell you about the effect of removing a row on row equivalence?\n",
"\n",
"__???__"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1 0 75/14]\n",
"[ 0 1 -10/7]"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Mr = matrix([[2, 4, 5], [4, 1, 20]])\n",
"Mr.rref()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"f) Determine whether the following statements are true or false. If the statement is true, give a 2 to 3 sentence proof. If the statement is false, give a counter example.\n",
"\n",
"i. Row equivalent augmented matrices have the same solution set.\n",
"\n",
"ii. Augmented matrices with the same solution set are row equivalent.\n",
"\n",
"__Answer:__ Both statements are true and can be proven by considering that row equivalent augmented matrices have the same RREF form. If $f$ is a set of row operations that changes matrix $A$ to matrix $B$ and $g$ is a set of operations that transforms $B$ into its RREF form, then $g \\circ f$ takes matrix $B$ to its RREF form. Since $A$ and $B$, have the same RREF form, they have the solution set (i). The inverse is also true, i.e., $f^{-1}$ should take the RREF form (solution set) to matrix $A$ and $g^{-1}$ takes matrix $A$ to matrix $B$. Since $f$ and $g$ are a composition of linear transformations and swaps, which themselves have inverses, we can guarantee that $f^{-1}$ and $g^{-1}$ if $f$ and $g$ exist. Since $g^{-1}$ exists, $A$ and $B$ are row equivalent (ii).\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2\n",
"\n",
"a) We wish to model the total production of all sectors as the sum of internal and external demands. Let the right-hand side of the system of equations simply be the total production $x_i$ for the sector $i$. The left-hand side will be the sum of demands retrieved from the table. Thus,\n",
"\n",
"$$\n",
"\\begin{cases}\n",
"0.2x_A + 0.2x_N + 0.4x_R + 0.1x_D + 0.2x_T +2 &= x_A \\\\\n",
"0.2x_A + 0.1x_N + 0.2x_R + 0.3x_D + 0.2x_T +10 &= x_N\\\\\n",
"0.2x_A + 0.2x_N + 0.1x_R + 0.1x_D + 0.4x_T &= x_R\\\\\n",
"0.2x_A + 0.05x_N + 0.15x_R + 0.3x_D + 0.05x_T + 15 &= x_D \\\\\n",
"0.2x_A + 0.2x_N + 0.15x_R + 0.2x_D + 0.05x_T + 5 &= x_T \n",
"\\end{cases}.\n",
"$$\n",
"\n",
"b) We can rewrite the system above to find\n",
"\n",
"\n",
"$$\n",
"\\begin{cases}\n",
"-0.8x_A + 0.2x_N + 0.4x_R + 0.1x_D + 0.2x_T &= -2 \\\\\n",
"0.2x_A -0.9x_N + 0.2x_R + 0.3x_D + 0.2x_T &= -10\\\\\n",
"0.2x_A + 0.2x_N -0.9x_R + 0.1x_D + 0.4x_T &= 0\\\\\n",
"0.2x_A + 0.05x_N + 0.15x_R -0.7x_D + 0.05x_T &= -15\\\\\n",
"0.2x_A + 0.2x_N + 0.15x_R + 0.2x_D -0.95x_T &= -5\n",
"\\end{cases}.\n",
"$$\n",
"\n",
"If we let $\\vec{x} = (x_A, x_N, x_R, x_D, x_T)^T$ and $\\vec{d} = (-2, -10, 0, -15, -5)$, we can express this system as $M\\vec{x}=\\vec{d}$ for the matrix M\n",
"\n",
"\n",
"$$\n",
"M =\n",
"\\begin{bmatrix}\n",
"-0.8 & 0.2 & 0.4 & 0.1 & 0.2 \\\\\n",
"0.2 &-0.9 & 0.2 & 0.3 & 0.2 \\\\\n",
"0.2 & 0.2 &-0.9 & 0.1 & 0.4 \\\\\n",
"0.2 & 0.05 & 0.15 &-0.7 & 0.05 \\\\\n",
"0.2 & 0.2 & 0.15 & 0.2 &-0.95 \n",
"\\end{bmatrix}\n",
"$$.\n",
"\n",
"In this model, $\\vec{x}$ represents the total number of units produced by and $\\vec{d}$ the different between internal and total demand in units for all sectors.\n",
"\n",
"c) Let us check whether the system has a solution in the code cell below."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1.00000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 99.8933684778051]\n",
"[0.000000000000000 1.00000000000000 0.000000000000000 0.000000000000000 0.000000000000000 96.9747798478405]\n",
"[0.000000000000000 0.000000000000000 1.00000000000000 0.000000000000000 0.000000000000000 87.2353681183730]\n",
"[0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000 0.000000000000000 81.1298148924699]\n",
"[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000 77.5630503803990]"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M = matrix([[-0.8, 0.2, 0.4, 0.1, 0.2], \n",
" [0.2, -0.9, 0.2, 0.3, 0.2], \n",
" [0.2, 0.2, -0.9, 0.1, 0.4], \n",
" [0.2, 0.05, 0.15, -0.7, 0.05], \n",
" [0.2, 0.2, 0.15, 0.2, -0.95]])\n",
"M_aug = matrix([[-0.8, 0.2, 0.4, 0.1, 0.2, -2], \n",
" [0.2, -0.9, 0.2, 0.3, 0.2, -10], \n",
" [0.2, 0.2, -0.9, 0.1, 0.4, 0], \n",
" [0.2, 0.05, 0.15, -0.7, 0.05, -15], \n",
" [0.2, 0.2, 0.15, 0.2, -0.95, -5]])\n",
"M_aug.rref()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Hence, the system does have a unique solution.\n",
"\n",
"d) For infinitely many solutions, we can imagine a sector that takes no resources as input and can hence produce as many units as it wishes. We can represent that by having an empty row in our table. For the case of a no solution, we can imagine a sector for which there is no demand, thus having a column full of zeros, but that still requires resources from other sectors. We can see the RREFs for these two modified systems below."
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1.00000000000000 0.000000000000000 0.000000000000000 0.000000000000000 -1.00546345139412 21.9065561416729]\n",
"[ 0.000000000000000 1.00000000000000 0.000000000000000 0.000000000000000 -0.857950263752826 30.4295403165034]\n",
"[ 0.000000000000000 0.000000000000000 1.00000000000000 0.000000000000000 -0.927279577995479 15.3127354935946]\n",
"[ 0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000 -0.618688771665411 33.1424265259985]\n",
"[ 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# i) Infinitely many solutions\n",
"M_aug = matrix([[-0.8, 0.2, 0.4, 0.1, 0.2, -2], \n",
" [0.2, -0.9, 0.2, 0.3, 0.2, -10], \n",
" [0.2, 0.2, -0.9, 0.1, 0.4, 0], \n",
" [0.2, 0.05, 0.15, -0.7, 0.05, -15], \n",
" [0, 0, 0, 0, 0, 0]])\n",
"\n",
"M_aug.rref()"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1.00000000000000 0.000000000000000 0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000]\n",
"[ 0.000000000000000 1.00000000000000 0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000]\n",
"[ 0.000000000000000 0.000000000000000 1.00000000000000 0.000000000000000 -0.000000000000000 0.000000000000000]\n",
"[ 0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000 -0.000000000000000 0.000000000000000]\n",
"[ 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000]"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M_aug = matrix([[-0.8, 0.2, 0.4, 0.1, 0, -2], \n",
" [0.2, -0.9, 0.2, 0.3, 0, -10], \n",
" [0.2, 0.2, -0.9, 0.1, 0, 0], \n",
" [0.2, 0.05, 0.15, -0.7, 0, -15], \n",
" [0.2, 0.2, 0.15, 0.2, 0, 0]])\n",
"\n",
"M_aug.rref()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"e) \n",
"\n",
"i. Let\n",
"$$\n",
"M = \n",
" \\begin{bmatrix}\n",
" a_{11}-1 & a_{12} & \\cdots & a_{1n} \\\\\n",
" a_{21}& a_{22}-1 & \\dots & a_{2n} \\\\ \n",
" \\vdots & \\vdots & \\ddots & \\vdots \\\\\n",
" a_{n1}& a_{n2}& \\dots& a_{nn}-1\n",
" \\end{bmatrix}\\text{, }\\vec{x}=(x_1, x_2, \\dots, x_n)^T\\text{, }\\vec{d}=(d_1, d_2, \\dots, d_n)^T$$\n",
"\n",
"The system of equations will then be given by\n",
"\n",
"$$M\\vec{x}=\\vec{d}$$\n",
"\n",
"ii. Since the only difference between M and A is in the main diagonal, we have $M=A-I_n$, where $I_n$ is the $n\\times n$ identity matrix.\n",
"\n",
"iii. The condition is that $det(M)!=0$. \n",
"\n",
"iv. Since $M\\vec{x}=\\vec{d}\\rightarrow (A-I_n)\\vec{x}=\\vec{d}$, if $A-I_n$ is invertible $\\vec{x}$ will be given by $\\vec{x}=(A-I_n)^{-1}\\vec{d}$.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Appendix\n",
"\n",
"#variables: The approach to solving problem 2 in the deep dive section required a deep consideration of the variables in the system and how they relate to the coefficient table outlined in the problem descriptions.\n",
"\n",
"#modeling: Similarly, the problems in the deep dive section required a thoughtful analysis of how these systems could be properly model through linear algebra. We also took the step of abstracting the given systems to any order of magnitude and derived general principles that they should follow (e.g., solvability given by the determinant)."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment