Skip to content

Commit 58b525c

Browse files
authored
[markov_chain_II] Update figure to avoid overlaps and fix a typo in greeksquare (#459)
* update figure size to avoid overlaps * use tight layout instead of figsize * update aligned for math environment
1 parent 441606f commit 58b525c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lectures/greek_square.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ $$
217217
where $\eta_1$ and $\eta_2$ are chosen to satisfy the prescribed initial conditions $y_{-1}, y_{-2}$:
218218
219219
$$
220-
\begin{align}
220+
\begin{aligned}
221221
\lambda_1^{-1} \eta_1 + \lambda_2^{-1} \eta_2 & = y_{-1} \cr
222222
\lambda_1^{-2} \eta_1 + \lambda_2^{-2} \eta_2 & = y_{-2}
223-
\end{align}
223+
\end{aligned}
224224
$$(eq:leq_sq)
225225
226226
System {eq}`eq:leq_sq` of simultaneous linear equations will play a big role in the remainder of this lecture.

lectures/markov_chains_II.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.14.4
7+
jupytext_version: 1.16.1
88
kernelspec:
99
display_name: Python 3 (ipykernel)
1010
language: python
@@ -248,8 +248,6 @@ Hence we expect that $\hat p_n(x) \approx \psi^*(x)$ when $n$ is large.
248248
The next figure shows convergence of $\hat p_n(x)$ to $\psi^*(x)$ when $x=1$ and
249249
$X_0$ is either $0, 1$ or $2$.
250250

251-
252-
253251
```{code-cell} ipython3
254252
P = np.array([[0.971, 0.029, 0.000],
255253
[0.145, 0.778, 0.077],
@@ -330,6 +328,8 @@ for i in range(n):
330328
axes[i].plot(p_hat, label=f'$x_0 = \, {x0} $')
331329
332330
axes[i].legend()
331+
332+
plt.tight_layout()
333333
plt.show()
334334
```
335335

@@ -395,8 +395,6 @@ ax.legend()
395395
plt.show()
396396
```
397397

398-
399-
400398
### Expectations of geometric sums
401399

402400
Sometimes we want to compute the mathematical expectation of a geometric sum, such as

0 commit comments

Comments
 (0)