Skip to content

Commit 14ffbb0

Browse files
committed
Solutions updated
1 parent c54ffb4 commit 14ffbb0

1 file changed

Lines changed: 51 additions & 14 deletions

File tree

Inner_Products_Solutions.ipynb

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,20 @@
18461846
"**Exercise 7:** If $A$ is an $n \\times n$ invertible matrix, explain why $A^TA$ is also invertible. "
18471847
]
18481848
},
1849+
{
1850+
"cell_type": "markdown",
1851+
"id": "e9d5b7d6",
1852+
"metadata": {},
1853+
"source": [
1854+
"**Solution:**\n",
1855+
"\n",
1856+
"If we assume that the matrix $A$ is invertible, then it has a pivot in each column. This means that the columns of $A$ are linearly independent and that $A$ has a $QR$ factorization.\n",
1857+
"\n",
1858+
"So, $ A^TA = (QR)^T(QR)$ = $ R^TQ^TQR = R^T(Q^TQ)R = R^TR $.\n",
1859+
"\n",
1860+
"Since $R$ is an upper-triangular matrix with non-zero enteries on the diagonal we can reduce it to the identity matrix $I$ by performing row operations. This means that $R$ is invertible. The matrix $R^T$ is lower triangular with non-zero entries on the diagonal and is invertible for the same reason. Since $A^TA$ is the product of two invertible matrices, it must also be invertible. (*See exercises in [Inverse Matrices](Inverse_Matrices.ipynb).)*"
1861+
]
1862+
},
18491863
{
18501864
"cell_type": "markdown",
18511865
"id": "71cfd633",
@@ -3599,42 +3613,65 @@
35993613
},
36003614
{
36013615
"cell_type": "code",
3602-
"execution_count": 12,
3603-
"id": "a9b1fa21",
3616+
"execution_count": 14,
3617+
"id": "a547e7e3",
36043618
"metadata": {},
36053619
"outputs": [
36063620
{
36073621
"name": "stdout",
36083622
"output_type": "stream",
36093623
"text": [
3610-
"Pivot could not be found in column 2 .\n",
3611-
"Zero entry found in U pivot position 2 .\n",
3612-
"X_cap: \n",
3613-
" [[0.16666667]\n",
3614-
" [0.66666667]\n",
3615-
" [0. ]] \n",
3624+
"A_aug_red: \n",
3625+
" [[1. 0. 2. 0.16666667]\n",
3626+
" [0. 1. 0. 0.66666667]\n",
3627+
" [0. 0. 0. 0. ]] \n",
36163628
"\n"
36173629
]
36183630
}
36193631
],
36203632
"source": [
3621-
"X_cap = lag.SolveSystem(A, B_cap)\n",
3633+
"A_aug = np.array([[1,2,2,1.5],[2,1,4,1],[1,2,2,1.5]])\n",
3634+
"A_aug_red = lag.FullRowReduction(A_aug)\n",
36223635
"\n",
3623-
"print(\"X_cap: \\n\", X_cap, '\\n')"
3636+
"print(\"A_aug_red: \\n\", A_aug_red, '\\n')"
36243637
]
36253638
},
36263639
{
36273640
"cell_type": "markdown",
3628-
"id": "de71d3e3",
3641+
"id": "b9155d0c",
36293642
"metadata": {},
36303643
"source": [
3631-
"There are an infinite number of least square solutions for the given system. One such solution is \n",
3644+
"Let\n",
36323645
"\n",
36333646
"$$\n",
36343647
"\\begin{equation}\n",
3635-
"\\hat{X} = \\left[\\begin{array}{r} 0.16666667 \\\\0.66666667 \\\\ 0\\end{array}\\right] \n",
3648+
"\\hat{X} = \\left[\\begin{array}{r} a \\\\b \\\\ c\\end{array}\\right] \n",
36363649
"\\end{equation}\n",
3637-
"$$\n"
3650+
"$$\n",
3651+
"\n",
3652+
"\n",
3653+
"We can see that $c$ is a free variable. So, let $c=t$ where $t$ is a scalar. Then, $b = 0.67$, $a = 0.167 - 2t$.\n",
3654+
"\n",
3655+
"\n",
3656+
"So, \n",
3657+
"\n",
3658+
"\n",
3659+
"$$\n",
3660+
"\\begin{equation}\n",
3661+
"\\hat{X} = \\left[\\begin{array}{r} 0.167-2t \\\\ 0.67 \\\\ t\\end{array}\\right] \n",
3662+
"= \\left[\\begin{array}{r} 0.167 \\\\ 0.67 \\\\ 0\\end{array}\\right] +t\\left[\\begin{array}{r} -2 \\\\ 0 \\\\ 1\\end{array}\\right]\n",
3663+
"\\end{equation}\n",
3664+
"$$\n",
3665+
"\n",
3666+
"Hence, we can conclude that there are infintely many solutions for the system $ A\\hat{X} = \\hat{B}$. One possible solution is:\n",
3667+
"\n",
3668+
"$$\n",
3669+
"\\begin{equation}\n",
3670+
"\\hat{X} = \\left[\\begin{array}{r} 0.167 \\\\ 0.67 \\\\ 0\\end{array}\\right] \n",
3671+
"\\end{equation}\n",
3672+
"$$\n",
3673+
"\n",
3674+
"when $t=0$."
36383675
]
36393676
},
36403677
{

0 commit comments

Comments
 (0)