From 51fe80737b663015c3fb3aef2c0cbef88f4c1dd6 Mon Sep 17 00:00:00 2001 From: Florian Knoch Date: Sun, 7 Mar 2021 17:35:44 +0100 Subject: [PATCH] Add math exercise --- content/maths.tex | 3 ++- exercises/maths/math-formulas.done.tex | 25 ++++++++++++++++++++++ exercises/maths/math-formulas.raw.tex | 29 ++++++++++++++++++++++++++ exercises/maths/task.tex | 3 +++ main.tex | 1 + praeamble.tex | 2 +- 6 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 exercises/maths/math-formulas.done.tex create mode 100644 exercises/maths/math-formulas.raw.tex create mode 100644 exercises/maths/task.tex diff --git a/content/maths.tex b/content/maths.tex index f7e442c..c1bc1cc 100644 --- a/content/maths.tex +++ b/content/maths.tex @@ -21,9 +21,10 @@ Die \cref{tbl:maths-common-commands,tbl:maths-logic-sets-braces} listen einige h \mintinline{latex}{e^{\pi}} & $e^{\pi}$ \\ \mintinline{latex}{\sum_{i=1}\^{n}x^2} & $\sum_{i=1}^{n}x^2$ \\ \mintinline{latex}{12 \leq 4 x^2 + 13} & $12 \leq 4 x^2 + 13$ \\ + \mintinline{latex}{{n \choose k}} & ${n \choose k}$ \\ \bottomrule \end{tabular} - \caption{Häufig verwendete Befehle (Wurzel, Bruch, Exponent, Summe, Vergleichszeichen). Durch \mintinline{latex}{^{…}} und \mintinline{latex}{_{…}} werden die Inhalte in den Klammern hoch- oder tiefgestellt.} + \caption{Häufig verwendete Befehle (Wurzel, Bruch, Exponent, Summe, Vergleichszeichen, Binomialkoeffizient). Durch \mintinline{latex}{^{…}} und \mintinline{latex}{_{…}} werden die Inhalte in den Klammern hoch- oder tiefgestellt.} \label{tbl:maths-common-commands} \end{table} diff --git a/exercises/maths/math-formulas.done.tex b/exercises/maths/math-formulas.done.tex new file mode 100644 index 0000000..6b29369 --- /dev/null +++ b/exercises/maths/math-formulas.done.tex @@ -0,0 +1,25 @@ +\begin{minted}{latex} + +% Fallbeschleunigung in Deutschland +$$9,81\,\frac{m}{s^2}$$ + +% pq-Formel +$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ + +% Mitternachtsformel +$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ + +% Catalansche Zahlen +\begin{equation*} + C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} +\end{equation*} + +% Definition der Fakultät +$$n! = \prod_{i=1}^{n} i$$ + +% Menge aller ungeraden natürlichen Zahlen +$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$ + +% Elimination $\neg\exists x$ +$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$ +\end{minted} \ No newline at end of file diff --git a/exercises/maths/math-formulas.raw.tex b/exercises/maths/math-formulas.raw.tex new file mode 100644 index 0000000..4f6311c --- /dev/null +++ b/exercises/maths/math-formulas.raw.tex @@ -0,0 +1,29 @@ +\begin{center} + +\textbf{Fallbeschleunigung in Deutschland} +$$9,81\,\frac{m}{s^2}$$ \\ +~ \\ + +\textbf {pq-Formel} +$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ \\ +~ \\ + +\textbf{Mitternachtsformel} +$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ \\ +~ \\ + +\textbf{Catalansche Zahlen} +\begin{equation*} C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} \end{equation*} \\ +~ \\ + +\textbf{Definition der Fakultät} +$$n! = \prod_{i=1}^{n} i$$ \\ +~ \\ + +\textbf{Menge aller ungeraden natürlichen Zahlen} +$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$ +~ \\ + +\textbf{Elimination $\neg\exists x$} +$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$ +\end{center} \ No newline at end of file diff --git a/exercises/maths/task.tex b/exercises/maths/task.tex new file mode 100644 index 0000000..07a9cf7 --- /dev/null +++ b/exercises/maths/task.tex @@ -0,0 +1,3 @@ +Setze die folgenden Formeln und beachte dabei die Größe der Klammern. + +\exercisematerial{exercises/maths/math-formulas} \ No newline at end of file diff --git a/main.tex b/main.tex index 8792c76..261cb1d 100644 --- a/main.tex +++ b/main.tex @@ -30,6 +30,7 @@ \input{content/formatting-paragraphs.tex} \input{content/lists.tex} \input{content/maths.tex} +\exercise{maths} \input{content/source-code-listings.tex} \input{content/graphics.tex} \input{content/tables.tex} diff --git a/praeamble.tex b/praeamble.tex index 346fdd8..0512dfd 100644 --- a/praeamble.tex +++ b/praeamble.tex @@ -9,7 +9,7 @@ \usepackage{eurosym, tipa, textcomp, textgreek, upgreek} % Mathematical symbols -\usepackage{amssymb, amsfonts, amsmath} +\usepackage{amssymb, amsfonts, amsmath, dsfont} % References and URLs \usepackage[hidelinks]{hyperref}