Skip to content

Commit 4c0e3b4

Browse files
wikkujakobkogler
authored andcommitted
Fix typos (#370)
1 parent b45b5cd commit 4c0e3b4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/algebra/big-integer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ while (a.size() > 1 && a.back() == 0)
154154

155155
The idea is to store the integer as its factorization, i.e. the powers of primes which divide it.
156156

157-
This approach is very easy to implement, and allows to do multiplication and division easily (assymptotically faster than the classical method), but not addition or subtraction. It is also very memory-efficient compared to the classical approach.
157+
This approach is very easy to implement, and allows to do multiplication and division easily (asymptotically faster than the classical method), but not addition or subtraction. It is also very memory-efficient compared to the classical approach.
158158

159159
This method is often used for calculations modulo non-prime number M; in this case a number is stored as powers of divisors of M which divide the number, plus the remainder modulo M.
160160

src/algebra/discrete-log.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The discrete logarithm is an integer $x$ solving the equation
66

77
$a^x \equiv b \pmod m$
88

9-
where $a$ and $m$ are relatively prime. (`Note`: if they are not relatively prime, then the algorithm described below is incorret, though it can be modified so that it can work).
9+
where $a$ and $m$ are relatively prime. (`Note`: if they are not relatively prime, then the algorithm described below is incorrect, though it can be modified so that it can work).
1010

1111
In this article, we describe the `Baby step - giant step` algorithm, proposed by Shanks in 1971, which has complexity $O(\sqrt{m} \log m)$. This algorithm is also known as `meet-in-the-middle`, because of it uses technique separation of tasks in half.
1212

@@ -30,7 +30,7 @@ Using the fact that $a$ and $m$ are relatively prime, we obtain:
3030

3131
$a^{np} \equiv ba^q \pmod m$
3232

33-
This new equation can be rewriten in a simplified form:
33+
This new equation can be rewritten in a simplified form:
3434

3535
$f_1(p) = f_2(q)$.
3636

src/algebra/euclid-algorithm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Let $d = \gcd(a, b)$. Then by definition $d\mid a$ and $d\mid b$.
6262
Now let's represent the remainder of the division of $a$ by $b$ as follows:
6363
$$a \bmod b = a - b \cdot \Bigl\lfloor\dfrac{a}{b}\Bigr\rfloor$$
6464
65-
From this it follows that $d \mid (a \bmod b)$, which means we have the system of divisiblities:
65+
From this it follows that $d \mid (a \bmod b)$, which means we have the system of divisibilities:
6666
$$\begin{cases}d \mid b,\\\\ d \mid (a \mod b)\end{cases}$$
6767
6868
Now we use the fact that for any three numbers $p$, $q$, $r$, if $p\mid q$ and $p\mid r$ then $p\mid \gcd(q, r)$. In our case, we get:

src/algebra/fft.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ And since all the elements $a[i] = 0$ for $i \ge n$:
537537
$$c[k] = \sum_{i=0}^{n-1} a[i] b[k-i]$$
538538
It is easy to see that this sum is just the scalar product of the vector $a$ with the $(k - (n - 1))$-th cyclic left shift of $b$.
539539
Thus these coefficients are the answer to the problem, and we were still able to obtain it in $O(n \log n)$ time.
540-
Note here that $c[2n-1]$ also gives us the $n$-th cyclic shift but that is the same as the $0$-th cyclic shift so we don't need to consider that seperately into our answer.
540+
Note here that $c[2n-1]$ also gives us the $n$-th cyclic shift but that is the same as the $0$-th cyclic shift so we don't need to consider that separately into our answer.
541541
542542
### Two stripes
543543

src/combinatorics/inclusion-exclusion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Consider its generalization to calculate number of elements which are present in
8383

8484
$$\left|\bigcup_{|B|=r}\left[\bigcap_{i \in B} A_i \cap \bigcap_{j \not\in B} \overline{A_j}\right]\right|=\sum_{m=r}^n (-1)^{m-r}\dbinom{m}{r} \sum_{|X|=m} \left|\bigcap_{i \in X} A_{i}\right|$$
8585

86-
To proove this formula, consider some particular $B$. Due to basic inclusion-exclusion principle we can say about it that:
86+
To prove this formula, consider some particular $B$. Due to basic inclusion-exclusion principle we can say about it that:
8787

8888
$$\left|\bigcap_{i \in B} A_i \cap \bigcap_{j \not \in B} \overline{A_j}\right|=\sum_{m=r}^{n} (-1)^{m-r} \sum_{\substack{|X|=m \newline B \subset X}}\left|\bigcap_{i\in X} A_{i}\right|$$
8989

@@ -228,7 +228,7 @@ Notice first that we can easily count the number of strings that satisfy at once
228228
229229
Learn now to solve the first version of the problem: when the string must satisfy exactly $k$ of the patterns.
230230
231-
To solve it, iterate and fix a specific subset $X$ from the set of patterns consisting of $k$ patterns. Then we have to count the number of strings that satisfy this set of patterns, and only matches it, that is, they don't match any other pattern. We will use the inclusion-exclusion principle in a slightly different manner: we sum on all supersets $Y$ (subsets from the original set of strings that cointain $X$), and either add to the current answer of subtract it from the number of strings:
231+
To solve it, iterate and fix a specific subset $X$ from the set of patterns consisting of $k$ patterns. Then we have to count the number of strings that satisfy this set of patterns, and only matches it, that is, they don't match any other pattern. We will use the inclusion-exclusion principle in a slightly different manner: we sum on all supersets $Y$ (subsets from the original set of strings that contain $X$), and either add to the current answer of subtract it from the number of strings:
232232
233233
$$ ans(X) = \sum_{Y \supseteq X} (-1)^{|Y|-k} \cdot f(Y) $$
234234

0 commit comments

Comments
 (0)