Latex in markdown reference

to be used in jupyter to blog
jupyter
latex
Published

January 23, 2023

Reference

https://en.wikibooks.org/wiki/LaTeX/Mathematics

Examples

We can integrate markdown between $ $ or $$ $$

Single $ will be inline

Double $$ will be centered into a new line

LaTeX Markdow
\(\widehat{q}\) \widehat{q}
\(|x-x_M|\) |x-x_M|
\(f_M(x)\) f_M(x)
\(\displaystyle\sum_{m}\) \displaystyle\sum_{m}
\(\langle{x,w_m}\rangle\) \langle{x,w_m}\rangle
\(\| v_m \|\) \| v_m \|
\(\cos\) \cos
\(\mathbb{Z}^d\) \mathbb{Z}$^d
\(\infty\) \infty
\(f \in L^2\) f \in L^2
$$ \implies
\(\lim\limits_{M \to \infty}\) \lim\limits_{M \to \infty}
\(P(A|B) = \frac{P(B|A)*P(A)}{P(B)}\) P(A|B) = \frac{P(B|A)*P(A)}{P(B)}
\(\begin{align} \\ Q_t(a) &= \frac{\text{sum of rewards when } \mathit{a} \text{ taken prior to }\mathit{t}}{\text{number of times } \mathit{a} \text{ taken prior to }\mathit{t}} \\ & = \frac{\displaystyle\sum_{i=1}^{t-1} R_i.\mathcal{1}_{A_i=a}}{\displaystyle\sum_{i=1}^{t-1} \mathcal{1}_{A_i=a}} \end{align}\) \begin{align} \\  Q_t(a) &= \frac{\text{sum of rewards when } \mathit{a} \text{ taken prior to }\mathit{t}}{\text{number of times } \mathit{a} \text{ taken prior to }\mathit{t}} \\  & = \frac{\displaystyle\sum_{i=1}^{t-1} R_i.\mathcal{1}_{A_i=a}}{\displaystyle\sum_{i=1}^{t-1} \mathcal{1}_{A_i=a}}  \end{align}
\(A_t=\underset{a}{\mathrm{argmax}}{\text{ }Q_t(a)}\) A_t=\underset{a}{\mathrm{argmax}}{\text{ }Q_t(a)}
\(p(s',r|s,a) \doteq Pr\{S_t=s', R_t=r|S_{t-1}=s, A_{t-1}=a\}\) p(s',r|s,a) \doteq Pr\{S_t=s', R_t=r|S_{t-1}=s, A_{t-1}=a\}
\(q_\pi(s,a) \doteq \mathbb{E}[R_{t+1}+\gamma.G_{t+1}|S_t=s, A_t=a]\) q_\pi(s,a) \doteq \mathbb{E}[R_{t+1}+\gamma.G_{t+1}|S_t=s, A_t=a]
\(v_*(s)\doteq \max\limits_{\pi} v_\pi(s), \forall s \in S\) v_*(s)\doteq \max\limits_{\pi} v_\pi(s), \forall s \in S
\(q_\pi(s,a) \doteq \mathbb{E}[R_{t+1}+\gamma.G_{t+1}|S_t=s, A_t=a]\) q_\pi(s,a) \doteq \mathbb{E}[R_{t+1}+\gamma.G_{t+1}|S_t=s, A_t=a]
\(l(w,b)=\frac{1}{N}\displaystyle\sum_{n=1}^{N}(y_n-(x_nw+b))^2\) l(w,b)=\frac{1}{N}\displaystyle\sum_{n=1}^{N}(y_n-(x_nw+b))^2
\(\nabla l(w,b) = \begin{bmatrix}\frac{\partial l(w,b)}{\partial w_1}\\ \vdots \\\frac{\partial l(w,b)}{\partial w_d}\end{bmatrix}\) \nabla l(w,b) = \begin{bmatrix}\frac{\partial l(w,b)}{\partial w_1}\\ \vdots \\\frac{\partial l(w,b)}{\partial w_d}\end{bmatrix}
\(\\ H(X) = – \sum_{x \in X} P(x) * \log(P(x))\) \\ H(X) = – \sum_{x \in X} P(x) * \log(P(x))
\(X \sim \mathcal{N}(\mu,\,\sigma^{2})\) X \sim \mathcal{N}(\mu,\,\sigma^{2})
\(\sqrt[n]{1+x+x^2+x^3+\dots+x^n}\) \sqrt[n]{1+x+x^2+x^3+\dots+x^n}