summaryrefslogtreecommitdiff
path: root/content/math/math.tex
diff options
context:
space:
mode:
authorLucas Schwebler <lucas.schwebler@gmail.com>2024-09-08 14:57:14 +0200
committerLucas Schwebler <lucas.schwebler@gmail.com>2024-09-08 14:57:14 +0200
commitdf963645ca0c5d0bed4fb9c02e93233dcfd53dae (patch)
tree91afe44c50073d32fc6c4e7b182ca607d8463883 /content/math/math.tex
parentde2c4df728e62c5761edf7d58a30f3c59d7d4d20 (diff)
add min mod (mimumum of linear function modulo m)
Diffstat (limited to 'content/math/math.tex')
-rw-r--r--content/math/math.tex9
1 files changed, 8 insertions, 1 deletions
diff --git a/content/math/math.tex b/content/math/math.tex
index fffdf37..6b765ca 100644
--- a/content/math/math.tex
+++ b/content/math/math.tex
@@ -344,11 +344,18 @@ sich alle Lösungen von $x^2-ny^2=c$ berechnen durch:
\begin{algorithm}{Div Sum}
- \method{divSum}{berechnet $\sum_{i=0}^{n-1} \frac{a\cdot i + b}{m}$}{\log(n)}
+ \method{divSum}{berechnet $\sum_{i=0}^{n-1} \left\lfloor \frac{a\cdot i + b}{m} \right\rfloor$}{\log(n)}
\textbf{Wichtig:} $b$ darf nicht negativ sein!
\sourcecode{math/divSum.cpp}
\end{algorithm}
+\begin{algorithm}{Min Mod}
+ \method{firstVal}{berechnet den ersten Wert von $0,\ a, \ldots,\ a \cdot i \bmod{m}$, der in $[l, r]$ liegt. Gibt $-1$ zurück, falls er nicht existiert.}{\log(m)}
+ \method{minMod}{berechnet das Minimum von $(a \cdot i + b) \bmod{m}$ für $i \in [0, n)$}{\log(m)}
+ \textbf{Wichtig:} $0 \leq a, b, l, r < m$
+ \sourcecode{math/minMod.cpp}
+\end{algorithm}
+
\subsection{Satz von \textsc{Sprague-Grundy}}
Weise jedem Zustand $X$ wie folgt eine \textsc{Grundy}-Zahl $g\left(X\right)$ zu:
\[