Skip to content

Commit 3961964

Browse files
longye-tianmmcky
andauthored
[linear_equations]Update the example environment (#528)
* update the example environment * update example environment * update example environment * update example * Update lectures/linear_equations.md * add lecture label --------- Co-authored-by: Matt McKay <[email protected]>
1 parent 716df5d commit 3961964

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

lectures/linear_equations.md

+23-5
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,12 @@ column vectors.
141141

142142
The set of all $n$-vectors is denoted by $\mathbb R^n$.
143143

144-
For example,
144+
```{prf:example}
145+
:label: le_ex_dim
145146
146147
* $\mathbb R^2$ is the plane --- the set of pairs $(x_1, x_2)$.
147148
* $\mathbb R^3$ is 3 dimensional space --- the set of vectors $(x_1, x_2, x_3)$.
149+
```
148150

149151
Often vectors are represented visually as arrows from the origin to the point.
150152

@@ -185,7 +187,8 @@ multiplication, which we now describe.
185187

186188
When we add two vectors, we add them element-by-element.
187189

188-
For example,
190+
```{prf:example}
191+
:label: le_ex_add
189192
190193
$$
191194
\begin{bmatrix}
@@ -208,6 +211,7 @@ $$
208211
1
209212
\end{bmatrix}.
210213
$$
214+
```
211215

212216
In general,
213217

@@ -273,7 +277,8 @@ plt.show()
273277

274278
Scalar multiplication is an operation that multiplies a vector $x$ with a scalar elementwise.
275279

276-
For example,
280+
```{prf:example}
281+
:label: le_ex_mul
277282
278283
$$
279284
-2
@@ -292,6 +297,7 @@ $$
292297
14
293298
\end{bmatrix}.
294299
$$
300+
```
295301

296302
More generally, it takes a number $\gamma$ and a vector $x$ and produces
297303

@@ -429,7 +435,8 @@ matrices.
429435

430436
Scalar multiplication and addition are generalizations of the vector case:
431437

432-
Here is an example of scalar multiplication
438+
```{prf:example}
439+
:label: le_ex_asm
433440
434441
$$
435442
3
@@ -443,6 +450,7 @@ $$
443450
0 & 15
444451
\end{bmatrix}.
445452
$$
453+
```
446454

447455
In general for a number $\gamma$ and any matrix $A$,
448456

@@ -461,6 +469,9 @@ $$
461469
\end{bmatrix}.
462470
$$
463471

472+
```{prf:example}
473+
:label: le_ex_ma
474+
464475
Consider this example of matrix addition,
465476
466477
$$
@@ -479,6 +490,7 @@ $$
479490
7 & 12
480491
\end{bmatrix}.
481492
$$
493+
```
482494

483495
In general,
484496

@@ -518,6 +530,9 @@ $j$-th column of $B$.
518530
If $A$ is $n \times k$ and $B$ is $j \times m$, then to multiply $A$ and $B$
519531
we require $k = j$, and the resulting matrix $A B$ is $n \times m$.
520532

533+
```{prf:example}
534+
:label: le_ex_2dmul
535+
521536
Here's an example of a $2 \times 2$ matrix multiplied by a $2 \times 1$ vector.
522537
523538
$$
@@ -536,6 +551,7 @@ Ax =
536551
a_{21}x_1 + a_{22}x_2
537552
\end{bmatrix}
538553
$$
554+
```
539555

540556
As an important special case, consider multiplying $n \times k$
541557
matrix $A$ and $k \times 1$ column vector $x$.
@@ -839,6 +855,8 @@ In matrix form, the system {eq}`la_se` becomes
839855
\end{bmatrix}.
840856
```
841857

858+
```{prf:example}
859+
:label: le_ex_gls
842860
For example, {eq}`n_eq_sys_la` has this form with
843861
844862
$$
@@ -848,7 +866,7 @@ $$
848866
\quad \text{and} \quad
849867
x = p.
850868
$$
851-
869+
```
852870

853871
When considering problems such as {eq}`la_gf`, we need to ask at least some of
854872
the following questions

0 commit comments

Comments
 (0)