Skip to content

Commit c9ac203

Browse files
committed
Exercises and solutions
1 parent 2552185 commit c9ac203

8 files changed

Lines changed: 1218 additions & 46 deletions

Applications.ipynb

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,28 @@
245245
"## Code solution here."
246246
]
247247
},
248+
{
249+
"cell_type": "markdown",
250+
"metadata": {},
251+
"source": [
252+
"**Exercise 2:** The further you travel out into the solar system and away from the Sun, the slower an object must be travelling to remain in its orbit. Here are the average radii of the orbits of the planets in our solar system, and their average orbital velocity around the Sun.\n",
253+
"\n",
254+
"|Planet | Distance from Sun (million km) | Orbital Velocity (km/s) |\n",
255+
"| ------------------------------- | ------------------------------- | ------------------------------- |\n",
256+
"|Mercury | 57.9 | 47.4 |\n",
257+
"|Venus | 108.2 | 35.0 | \n",
258+
"|Earth | 149.6 | 29.8 |\n",
259+
"|Mars | 228.0 | 24.1 |\n",
260+
"|Jupiter | 778.5 | 13.1 |\n",
261+
"|Saturn | 1432.0 | 9.7 |\n",
262+
"|Uranus | 2867.0 | 6.8 |\n",
263+
"|Neptune | 4515.0 | 5.4 |\n",
264+
"\n",
265+
"$(a)$ Find the unique first degree polynomial whose graph passes through points defined by Mercury and Jupiter. Plot the data points together with the graph of the polynomial to observe the fit. Amend your polynomial and graph by adding Saturn, and then Earth. What do you notice as you add more points? What if you had started with different planets?\n",
266+
" \n",
267+
"$(b)$ Expand your work in part $(a)$ to a seventh degree poynomial that passes through all eight planets. The first object in the Kuiper Belt, Ceres, was discovered by Giuseppe Piazzi in 1801. Ceres has an average distance from the sun of 413.5 million km. Based on the points on the graph, estimate the orbital velocity of Ceres. What does the polynomial suggest the value would be?"
268+
]
269+
},
248270
{
249271
"cell_type": "markdown",
250272
"metadata": {},
@@ -1362,8 +1384,17 @@
13621384
"\n",
13631385
"- Krebs, Charles J.; Boonstra, Rudy; Boutin, Stan (2017), Using experimentation to understand the 10‐year snowshoe hare cycle in the boreal forest of North America, Journal of Animal Ecology, Article-journal, https://doi.org/10.1111/1365-2656.12720\n",
13641386
"\n",
1365-
"- Kwak, Jin Ho and Sungpyo Hong. *Linear Algebra*. 2nd ed., Birkhauser., 2004."
1387+
"- Kwak, Jin Ho and Sungpyo Hong. *Linear Algebra*. 2nd ed., Birkhauser., 2004.\n",
1388+
"\n",
1389+
"- Williams, David, *Planetary Fact Sheet*, https://nssdc.gsfc.nasa.gov/planetary/factsheet/, NASA Goddard Space Flight Center, 2021"
13661390
]
1391+
},
1392+
{
1393+
"cell_type": "code",
1394+
"execution_count": null,
1395+
"metadata": {},
1396+
"outputs": [],
1397+
"source": []
13671398
}
13681399
],
13691400
"metadata": {

Bases.ipynb

Lines changed: 137 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"cell_type": "markdown",
7272
"metadata": {},
7373
"source": [
74-
"We see that the RREF of $A$ is the $5\\times 5$ identity matrix, which indicates that $A$ has is a pivot in each row and each column. This verifies that the columns of $A$ form a basis for $\\mathbb{R}^5$, and guarantees that the linear system $AX=Y$ has a unique solution for any vector $Y$. "
74+
"We see that the RREF of $A$ is the $5\\times 5$ identity matrix, which indicates that $A$ has a pivot in each row and each column. This verifies that the columns of $A$ form a basis for $\\mathbb{R}^5$, and guarantees that the linear system $AX=Y$ has a unique solution for any vector $Y$. "
7575
]
7676
},
7777
{
@@ -197,7 +197,7 @@
197197
"cell_type": "markdown",
198198
"metadata": {},
199199
"source": [
200-
"In this system, $x_3$ and $_4$ are free variables. If we set $x_3 = t$, and $x_4=s$, then $x_1 = 2s -3t$ and \n",
200+
"In this system, $x_3$ and $x_4$ are free variables. If we set $x_3 = t$, and $x_4=s$, then $x_1 = 2s -3t$ and \n",
201201
"$x_2 = 4s -9t$. We can write the components of a general solution vector $X$ in terms of these parameters.\n",
202202
"\n",
203203
"$$\n",
@@ -208,7 +208,7 @@
208208
"\\end{equation}\n",
209209
"$$\n",
210210
"\n",
211-
"In this form we can see that any solution of $AX=B$ must be a linear combination of the vectors $W_1$ and $W_2$ defined as follows.\n",
211+
"In this form we can see that any solution of $AX=B$ must be a linear combination of the vectors $W_1$ and $W_2$ defined as follows:\n",
212212
"\n",
213213
"\n",
214214
"$$\n",
@@ -325,7 +325,7 @@
325325
"\n",
326326
"We now understand that if we are given a basis $\\{V_1, V_2, V_3, ... V_n\\}$ for $\\mathbb{R}^n$ and a vector $X$ in $\\mathbb{R}^n$, there is a unique linear combination of the basis vectors equal to $X$. The **coordinates** of $X$ with respect to this basis is the unique set of weights $c_1$, $c_2$, ... $c_n$ that satisfy the vector equation $X=c_1V_1 + c_2V_2 + ... c_nV_n$. It becomes useful at this point to assign labels to bases that are under discussion. For example, we might say that $\\beta = \\{V_1, V_2, V_3, ... V_n\\}$, and refer to the coordinates of $X$ with respect to $\\beta$. It is only natural to collect these weights into an $n\\times 1$ array, to which we will assign the notation $[X]_{\\beta}$. Despite potential confusion, this array is referred to as the \"coordinate vector\".\n",
327327
"\n",
328-
"To demonstrate, suppose that we use the basis for $\\mathbb{R}^5$ given in **Example 1**, and assign it the label $\\beta$. Consider then the calculation need to find of the coordinates of a vector $X$ with respect to $\\beta$.\n",
328+
"To demonstrate, suppose that we use the basis for $\\mathbb{R}^5$ given in **Example 1**, and assign it the label $\\beta$. Consider then the calculation needed to find of the coordinates of a vector $X$ with respect to $\\beta$.\n",
329329
"\n",
330330
"\n",
331331
"$$\n",
@@ -442,7 +442,7 @@
442442
"cell_type": "markdown",
443443
"metadata": {},
444444
"source": [
445-
"**Exercise 4:** Calculate the dimension of the span of the following vectors.\n",
445+
"**Exercise 4:** Calculate the dimension of the span of $ \\{U_1, U_2, U_3, U_4\\}$.\n",
446446
"\n",
447447
"$$\n",
448448
"\\begin{equation}\n",
@@ -462,6 +462,138 @@
462462
"source": [
463463
"## Code solution here."
464464
]
465+
},
466+
{
467+
"cell_type": "markdown",
468+
"metadata": {},
469+
"source": [
470+
"**Exercise 5:** Determine whether the set of vectors $ \\{V_1, V_2, V_3\\}$ is a basis for $\\mathbb{R}^4$. If not, find a vector which can be added to the set such that the resulting set of vectors is a basis for $\\mathbb{R}^4$.\n",
471+
"\n",
472+
"$$\n",
473+
"\\begin{equation}\n",
474+
"V_1 = \\left[ \\begin{array}{r} 1 \\\\ 2 \\\\ 1 \\\\ 1 \\end{array}\\right] \\hspace{0.7cm} \n",
475+
"V_2 = \\left[ \\begin{array}{r} 1 \\\\ 0 \\\\ 2 \\\\ 2 \\end{array}\\right] \\hspace{0.7cm}\n",
476+
"V_3 = \\left[ \\begin{array}{r} 1 \\\\ 3 \\\\ 1 \\\\ 2 \\end{array}\\right] \\hspace{0.7cm}\n",
477+
"\\end{equation}\n",
478+
"$$\n",
479+
"\n"
480+
]
481+
},
482+
{
483+
"cell_type": "code",
484+
"execution_count": 27,
485+
"metadata": {},
486+
"outputs": [],
487+
"source": [
488+
"## Code solution here"
489+
]
490+
},
491+
{
492+
"cell_type": "markdown",
493+
"metadata": {},
494+
"source": [
495+
"**Exercise 6:** Find the dimension of the subspace spanned by $\\{W_1, W_2\\}$. Explain your answer.\n",
496+
"\n",
497+
"$$\n",
498+
"\\begin{equation}\n",
499+
"W_1 = \\left[ \\begin{array}{r} 1 \\\\ 2 \\\\ 0 \\\\ 0 \\end{array}\\right] \\hspace{0.7cm} \n",
500+
"W_2 = \\left[ \\begin{array}{r} 2 \\\\ 3 \\\\ 0 \\\\ 0 \\end{array}\\right] \\hspace{0.7cm}\n",
501+
"\\end{equation}\n",
502+
"$$\n",
503+
"\n"
504+
]
505+
},
506+
{
507+
"cell_type": "code",
508+
"execution_count": 28,
509+
"metadata": {},
510+
"outputs": [],
511+
"source": [
512+
"## Code solution here"
513+
]
514+
},
515+
{
516+
"cell_type": "markdown",
517+
"metadata": {},
518+
"source": [
519+
"**Exercise 7:** Find the value(s) of $a$ for which the set of vectors $\\{X_1,X_2,X_3\\}$ is **not** a basis for $\\mathbb{R}^3$.\n",
520+
"\n",
521+
"$$\n",
522+
"\\begin{equation}\n",
523+
"X_1 = \\left[ \\begin{array}{r} 1 \\\\ 2 \\\\ 1 \\end{array}\\right] \\hspace{0.7cm} \n",
524+
"X_2 = \\left[ \\begin{array}{r} 2 \\\\ a \\\\ 3 \\end{array}\\right] \\hspace{0.7cm}\n",
525+
"X_3 = \\left[ \\begin{array}{r} 1 \\\\ 2 \\\\ a \\end{array}\\right] \\hspace{0.7cm}\n",
526+
"\\end{equation}\n",
527+
"$$\n",
528+
"\n"
529+
]
530+
},
531+
{
532+
"cell_type": "code",
533+
"execution_count": 29,
534+
"metadata": {},
535+
"outputs": [],
536+
"source": [
537+
"## Code solution here"
538+
]
539+
},
540+
{
541+
"cell_type": "markdown",
542+
"metadata": {},
543+
"source": [
544+
"**Exercise 8:** Let $U$ be the subspace of $\\mathbb{R}^5$ which contains vectors with their first and second entries equal and their third entry equal to zero. What the vectors in the subspace $U$ look like? Use this information to find a basis for $U$ and determine the dimension of $U$."
545+
]
546+
},
547+
{
548+
"cell_type": "code",
549+
"execution_count": 30,
550+
"metadata": {},
551+
"outputs": [],
552+
"source": [
553+
"## Code solution here"
554+
]
555+
},
556+
{
557+
"cell_type": "markdown",
558+
"metadata": {},
559+
"source": [
560+
"**Exercise 9:** Let $\\beta = \\{U_1,U_2,U_3\\}$ be a basis for $\\mathbb{R}^3$. Find the **coordinates** of $V$ with respect to $\\beta$.\n",
561+
"\n",
562+
"$$\n",
563+
"\\begin{equation}\n",
564+
"U_1 = \\left[ \\begin{array}{r} 1 \\\\ 2 \\\\ 3 \\end{array}\\right] \\hspace{0.7cm} \n",
565+
"U_2 = \\left[ \\begin{array}{r} 2 \\\\ 1 \\\\ 0 \\end{array}\\right] \\hspace{0.7cm}\n",
566+
"U_3 = \\left[ \\begin{array}{r} 3 \\\\ 2 \\\\ 5 \\end{array}\\right] \\hspace{0.7cm}\n",
567+
"V = \\left[ \\begin{array}{r} 8 \\\\ 6 \\\\ 8 \\end{array}\\right] \\hspace{0.7cm}\n",
568+
"\\end{equation}\n",
569+
"$$\n",
570+
"\n"
571+
]
572+
},
573+
{
574+
"cell_type": "code",
575+
"execution_count": null,
576+
"metadata": {},
577+
"outputs": [],
578+
"source": [
579+
"## Code solution here"
580+
]
581+
},
582+
{
583+
"cell_type": "markdown",
584+
"metadata": {},
585+
"source": [
586+
"**Exercise 10:** Can a set of four vectors in $\\mathbb{R}^3$ be a basis for $\\mathbb{R}^3$? Explain and verify your answer through a computation."
587+
]
588+
},
589+
{
590+
"cell_type": "code",
591+
"execution_count": null,
592+
"metadata": {},
593+
"outputs": [],
594+
"source": [
595+
"## Code solution here"
596+
]
465597
}
466598
],
467599
"metadata": {

General_Linear_Systems.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,16 @@
415415
"**Exercise 6:** Write a function that accepts the augmented matrix for a system and returns the number of free variables in that system. Make use of $\\texttt{FullRowReduction}$ in the $\\texttt{laguide}$ module. "
416416
]
417417
},
418+
{
419+
"cell_type": "markdown",
420+
"metadata": {},
421+
"source": [
422+
"**Exercise 7:** Write a function that accepts the augmented matrix for a system and returns whether or not that system is consistent. The function should return the value 1 if the system is consistent or the value 0 if the system is inconsistent. Make use of $\\texttt{FullRowReduction}$ in the $\\texttt{laguide}$ module. "
423+
]
424+
},
418425
{
419426
"cell_type": "code",
420-
"execution_count": null,
427+
"execution_count": 4,
421428
"metadata": {},
422429
"outputs": [],
423430
"source": [

Linear_Transformations.ipynb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"source": [
1414
"In this chapter the focus shifts from solving linear systems to the use of matrix algebra to represent maps between vector spaces. We will see that certain class of useful maps called linear transformations can be described with matrix multiplication.\n",
1515
"\n",
16-
"A **mapping** between vector spaces is a rule that associates input vectors with output vectors. We say that the input vectors get \"mapped\" to the output vectors. The input and output vectors may be in different spaces, or they may be in the same space. There maybe multiple input vectors that get mapped to a single output vector, but it is important that each input vector gets mapped to a unique output vector. In the language of calculus, mappings are known as functions.\n",
16+
"A **mapping** between vector spaces is a rule that associates input vectors with output vectors. We say that the input vectors get \"mapped\" to the output vectors. The input and output vectors may be in different spaces, or they may be in the same space. There may be multiple input vectors that get mapped to a single output vector, but it is important that each input vector gets mapped to a unique output vector. In the language of calculus, mappings are known as functions.\n",
1717
"\n",
1818
"\n",
1919
"When we refer to a specific map, we might use a symbol, such as $T$. In order to specify which spaces contain the input and output vectors, say $\\mathbb{R}^2$ and $\\mathbb{R}^3$, we write $T: \\mathbb{R}^2 \\to \\mathbb{R}^3$. This notation means that $T$ is a mapping that takes vectors in $\\mathbb{R}^2$ as inputs, and maps them to vectors in $\\mathbb{R}^3$. When we refer to the output associated with a specific vector, say $V$, we use the notation $T(V)$. (*This notation is read \"$T$ of $V$\". The reader familiar with calculus will recognize the notation as that commonly used with functions.*). Finally, if we wish to label the output vector as $W$, we will write $T(V)=W$, meaning that the input vector $V$ gets mapped to the output vector $W$ by the map $T$. The vector $W$ is said to be the **image** of $V$ under the map $T$. Similarly, the vector $V$ is said to be the **preimage** of $W$."
@@ -32,7 +32,7 @@
3232
"source": [
3333
"### Example 1: Transformation from $\\mathbb{R}^2$ to $\\mathbb{R}^3$\n",
3434
"\n",
35-
"A Python function that accepts one vector as an argument, and provides on vector in return, is a perfect model of a mapping. As an example, let's write a function that accepts a vector from $\\mathbb{R}^2$ and returns a vector in $\\mathbb{R}^3$."
35+
"A Python function that accepts one vector as an argument, and provides one vector in return, is a perfect model of a mapping. As an example, let's write a function that accepts a vector from $\\mathbb{R}^2$ and returns a vector in $\\mathbb{R}^3$."
3636
]
3737
},
3838
{
@@ -129,15 +129,16 @@
129129
"text": [
130130
"[[42.]\n",
131131
" [ 0.]\n",
132-
" [35.]]\n",
132+
" [35.]] \n",
133+
"\n",
133134
"[[42.]\n",
134135
" [ 0.]\n",
135-
" [35.]]\n",
136-
"\n",
136+
" [35.]] \n",
137137
"\n",
138138
"[[4.]\n",
139139
" [0.]\n",
140-
" [8.]]\n",
140+
" [8.]] \n",
141+
"\n",
141142
"[[4.]\n",
142143
" [0.]\n",
143144
" [8.]]\n"
@@ -148,10 +149,9 @@
148149
"U = np.array([[-1],[3]])\n",
149150
"V = np.array([[3],[5]])\n",
150151
"k = 7\n",
151-
"print(T(k*V))\n",
152-
"print(k*T(V))\n",
153-
"print('\\n')\n",
154-
"print(T(U+V))\n",
152+
"print(T(k*V),'\\n')\n",
153+
"print(k*T(V),'\\n')\n",
154+
"print(T(U+V),'\\n')\n",
155155
"print(T(U)+T(V))"
156156
]
157157
},
@@ -181,7 +181,7 @@
181181
},
182182
{
183183
"cell_type": "code",
184-
"execution_count": 4,
184+
"execution_count": 5,
185185
"metadata": {},
186186
"outputs": [
187187
{
@@ -251,7 +251,7 @@
251251
},
252252
{
253253
"cell_type": "code",
254-
"execution_count": 5,
254+
"execution_count": 6,
255255
"metadata": {},
256256
"outputs": [
257257
{
@@ -278,12 +278,12 @@
278278
"\n",
279279
"When applying a given linear transformations, we often consider if it is possible to *reverse the transformation*. That is, we would like to know if it is possible to map all the vectors in the output space back to vectors in the input space such that images get sent back to their preimages. If this is possible we say that the transformation is invertible. More formally, a linear transformation $L:\\mathbb{V}\\to\\mathbb{W}$ is said to be **invertible** if there exists another transformation $L^{-1}:\\mathbb{W}\\to\\mathbb{V}$, known as the inverse, such that $(L^{-1}\\circ L)(X) = X$ for any vector $X$ in $\\mathbb{V}$. \n",
280280
"\n",
281-
"The transformation $L$ in **Example 2** is invertible since the matrix $A$ is invertible. If $X$ is any vector in $\\mathbb{R}^3$ and $Y=AX$ is image vector of $X$, it is possible to find $X$ given $Y$ by using $X=A^{-1}Y$. "
281+
"The transformation $L$ in **Example 2** is invertible since the matrix $A$ is invertible. If $X$ is any vector in $\\mathbb{R}^3$ and $Y=AX$ is the image vector of $X$, it is possible to find $X$ given $Y$ by using $X=A^{-1}Y$. "
282282
]
283283
},
284284
{
285285
"cell_type": "code",
286-
"execution_count": 6,
286+
"execution_count": 7,
287287
"metadata": {},
288288
"outputs": [
289289
{
@@ -292,7 +292,8 @@
292292
"text": [
293293
"[[ 4]\n",
294294
" [11]\n",
295-
" [ 1]]\n",
295+
" [ 1]] \n",
296+
"\n",
296297
"[[1.]\n",
297298
" [3.]\n",
298299
" [5.]]\n"
@@ -310,7 +311,7 @@
310311
" return W\n",
311312
"\n",
312313
"V = np.array([[1],[3],[5]])\n",
313-
"print(L(V))\n",
314+
"print(L(V),'\\n')\n",
314315
"print(L_inverse(L(V)))\n"
315316
]
316317
},
@@ -329,7 +330,7 @@
329330
"source": [
330331
"### Exercises\n",
331332
"\n",
332-
"- Find the vector $\\texttt{T(V)}$ where\n",
333+
"**Exercise 1:** Find the vector $T(V)$ where\n",
333334
"\n",
334335
"$$\n",
335336
"\\begin{equation}\n",
@@ -351,7 +352,7 @@
351352
"cell_type": "markdown",
352353
"metadata": {},
353354
"source": [
354-
"- Find the vector $U$ so that \n",
355+
"**Exercise 2:** Find the vector $U$ so that \n",
355356
"\n",
356357
"$$\n",
357358
"\\begin{equation}\n",
@@ -373,7 +374,7 @@
373374
"cell_type": "markdown",
374375
"metadata": {},
375376
"source": [
376-
"- Write a Python function that implements the transformation $N:\\mathbb{R}^3\\to\\mathbb{R}^2$, given by the following rule. Use the function to find evidence that $N$ is **not linear**.\n",
377+
"**Exercise 3:** Write a Python function that implements the transformation $N:\\mathbb{R}^3\\to\\mathbb{R}^2$, given by the following rule. Use the function to find evidence that $N$ is **not linear**.\n",
377378
"\n",
378379
"$$\n",
379380
"\\begin{equation}\n",
@@ -396,8 +397,7 @@
396397
"cell_type": "markdown",
397398
"metadata": {},
398399
"source": [
399-
"\n",
400-
"- Consider the two transformations, $S$ and $R$, defined below. Write a Python function that implements the composition $R\\circ S$. Explain why it is not possible to form the composition $S \\circ R$.\n",
400+
"**Exercise 4:** Consider the two transformations, $S$ and $R$, defined below. Write a Python function that implements the composition $R\\circ S$. Explain why it is not possible to form the composition $S \\circ R$.\n",
401401
"\n",
402402
"$$\n",
403403
"\\begin{equation}\n",

0 commit comments

Comments
 (0)