Skip to content

Commit c82e857

Browse files
committed
latex fix
1 parent 6f78ed9 commit c82e857

File tree

12 files changed

+96
-96
lines changed

12 files changed

+96
-96
lines changed

IP-Finals/2017resit/problem1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
$\color{cadetblue}{\text{\huge Problem 1}}$
1+
$\huge\color{cadetblue}{\text{Problem 1}}$
22

33
---------------
44

5-
${\color{darkkhaki}\text{\Large Prob 1.1: }}\space{\color{olive}\text{\Large b}}$
5+
$\Large{\color{darkkhaki}\text{Prob 1.1: }}\space{\color{olive}\text{b}}$
66

77
```java
88
// x + 2 * y = A ∧ x + y = 2 * A
@@ -21,7 +21,7 @@ $\quad \lbrace \space y = A \space \rbrace$
2121

2222
---------------
2323

24-
${\color{darkkhaki}\text{\Large Prob 1.2: }}\space{\color{olive}\text{\Large b}}$
24+
$\Large{\color{darkkhaki}\text{Prob 1.2: }}\space{\color{olive}\text{b}}$
2525

2626
```java
2727
// 2 * x + y = A + B ∧ x + y = 2 * B
@@ -55,7 +55,7 @@ $\quad \lbrace \space x = A \space \land \space y = B \space \rbrace$
5555

5656
---------------
5757

58-
${\color{darkkhaki}\text{\Large Prob 1.3: }}\space{\color{olive}\text{\Large c}}$
58+
$\Large{\color{darkkhaki}\text{Prob 1.3: }}\space{\color{olive}\text{c}}$
5959

6060
```java
6161
// x + A = B ∧ y + B = 2 * A
@@ -79,7 +79,7 @@ $\quad \lbrace \space x = 2 * A - B \space \land \space y = 2 * B - 3 * A \space
7979

8080
---------------
8181

82-
${\color{darkkhaki}\text{\Large Prob 1.4: }}\space{\color{olive}\text{\Large a}}$
82+
$\Large{\color{darkkhaki}\text{Prob 1.4: }}\space{\color{olive}\text{a}}$
8383

8484
```java
8585
// x = A + 2 * B ∧ y = A + B
@@ -104,7 +104,7 @@ $\quad \lbrace \space x = A + B \space \land \space y = B \space \rbrace$
104104

105105
---------------
106106

107-
${\color{darkkhaki}\text{\Large Prob 1.5: }}\space{\color{olive}\text{\Large c}}$
107+
$\Large{\color{darkkhaki}\text{Prob 1.5: }}\space{\color{olive}\text{c}}$
108108

109109
```java
110110
// x = A ∧ y = 2 * B
@@ -126,7 +126,7 @@ $\quad \lbrace \space x = 2 * B \space \land \space y = A \space \rbrace$
126126

127127
---------------
128128

129-
${\color{darkkhaki}\text{\Large Prob 1.6: }}\space{\color{olive}\text{\Large a}}$
129+
$\Large{\color{darkkhaki}\text{Prob 1.6: }}\space{\color{olive}\text{a}}$
130130

131131
```java
132132
// x + z = A ∧ y + z = A - B

IP-Finals/2017resit/problem2.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
$\color{cadetblue}{\text{\huge Problem 2}}$
1+
$\huge\color{cadetblue}{\text{Problem 2}}$
22

33
----------------------
44

5-
${\color{rosybrown}\text{\Large Prob 2.1: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N)}}}$
5+
$\Large{\color{rosybrown}\text{Prob 2.1: }}{\color{darkseagreen}{{\space \mathcal{O}(N)}}}$
66

77
<br/>
88

@@ -15,7 +15,7 @@ for (int i = N; i > 0; i /= 2) {
1515
}
1616
```
1717

18-
The outer loop runs $\log(N)$ times, since $i$ starts at $N$ and is then halved after each iteration. The inner loop runs $i$ times for each value of $i$, which is $\frac{N}{2^k}$ for $k \in \lbrace 0, 1, \dots, \lceil \log(N) \rceil \rbrace$. The total number of iterations of the inner loop is therefore given by:
18+
The outer loop runs $\log(N)$ times, since $i$ starts at $N$ and is then halved after each iteration. The inner loop runs $i$ times for each value of $i$, which is $N/2^k$ for $k \in \lbrace 0, 1, \dots, \lceil \log(N) \rceil \rbrace$. The total number of iterations of the inner loop is therefore given by:
1919

2020
$$
2121
\begin{align*}
@@ -27,7 +27,7 @@ $$
2727
\end{align*}
2828
$$
2929

30-
In $\color{peru}{(1)}$ we use the formula for the sum of a geometric series, with $a = \frac{1}{2}$ and $n = \lceil \log(N) \rceil$:
30+
In $\color{peru}{(1)}$ we use the formula for the sum of a geometric series, with $a = 1/2$ and $n = \lceil \log(N) \rceil$:
3131

3232
$$
3333
\sum_{k=0}^n a^k = \frac{a^{n+1} - 1}{a - 1} \quad \text{for} \quad a \neq 1
@@ -41,7 +41,7 @@ Note that we could have run an argument for a complexity in $\mathcal{O}(N \log(
4141

4242
----------------------
4343

44-
${\color{rosybrown}\text{\Large Prob 2.2: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N \log (N))}}}$
44+
$\Large{\color{rosybrown}\text{Prob 2.2: }}{\color{darkseagreen}{{\space \mathcal{O}(N \log (N))}}}$
4545

4646
<br/>
4747

@@ -72,7 +72,7 @@ Therefore, the fragment's time complexity is in $\mathcal{O}(N\log(N))$.
7272

7373
----------------------
7474

75-
${\color{rosybrown}\text{\Large Prob 2.3: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N^2)}}}$
75+
$\Large{\color{rosybrown}\text{Prob 2.3: }}{\color{darkseagreen}{{\space \mathcal{O}(N^2)}}}$
7676

7777
<br/>
7878

@@ -85,7 +85,7 @@ for (int i = N; i > 0; i--) {
8585
}
8686
```
8787

88-
The outer loop runs $N$ times, and the inner loop runs $\frac {i}{2}$ times for each value of $i$. The total number of iterations of the inner loop is therefore given by:
88+
The outer loop runs $N$ times, and the inner loop runs $i/2$ times for each value of $i$. The total number of iterations of the inner loop is therefore given by:
8989

9090
$$
9191
\begin{align*}
@@ -102,7 +102,7 @@ Therefore, the fragment's time complexity is in $\mathcal{O}(N^2)$.
102102

103103
----------------------
104104

105-
${\color{rosybrown}\text{\Large Prob 2.4: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(\sqrt N)}}}$
105+
$\Large{\color{rosybrown}\text{Prob 2.4: }}{\color{darkseagreen}{{\space \mathcal{O}(\sqrt N)}}}$
106106

107107
<br/>
108108

@@ -120,7 +120,7 @@ To be fair, though, the program fragment will actually result in undefined behav
120120

121121
----------------------
122122

123-
${\color{rosybrown}\text{\Large Prob 2.5: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(\log (N))}}}$
123+
$\Large{\color{rosybrown}\text{Prob 2.5: }}{\color{darkseagreen}{{\space \mathcal{O}(\log (N))}}}$
124124

125125
<br/>
126126

@@ -139,7 +139,7 @@ The variable $i$ is initialized to $N$, and is either decremented by $1$ or divi
139139

140140
----------------------
141141

142-
${\color{rosybrown}\text{\Large Prob 2.6: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N)}}}$
142+
$\Large{\color{rosybrown}\text{Prob 2.6: }}{\color{darkseagreen}{{\space \mathcal{O}(N)}}}$
143143

144144
<br/>
145145

IP-Finals/2018/problem1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
$\color{cadetblue}{\text{\huge Problem 1}}$
1+
$\huge\color{cadetblue}{\text{Problem 1}}$
22

33
---------------
44

5-
${\color{darkkhaki}\text{\Large Prob 1.1: }}\space{\color{olive}\text{\Large c}}$
5+
$\Large{\color{darkkhaki}\text{Prob 1.1: }}\space{\color{olive}\text{c}}$
66

77
```java
88
// 10 < 2 * x + 6 * y < 20
@@ -23,7 +23,7 @@ $\quad \lbrace \space 10 \space < x \space < 15 \space \rbrace$
2323

2424
---------------
2525

26-
${\color{darkkhaki}\text{\Large Prob 1.2: }}\space{\color{olive}\text{\Large b}}$
26+
$\Large{\color{darkkhaki}\text{Prob 1.2: }}\space{\color{olive}\text{b}}$
2727

2828
```java
2929
// x = A + B ∧ y = A - B
@@ -49,7 +49,7 @@ $\quad \lbrace \space x = A \space \land \space y = B \space \rbrace$
4949

5050
---------------
5151

52-
${\color{darkkhaki}\text{\Large Prob 1.3: }}\space{\color{olive}\text{\Large c}}$
52+
$\Large{\color{darkkhaki}\text{Prob 1.3: }}\space{\color{olive}\text{c}}$
5353

5454
```java
5555
// x = A ∧ y = B
@@ -73,7 +73,7 @@ $\quad \lbrace \space x - 2 * B = A \space \land \space y = B \space \rbrace$
7373

7474
---------------
7575

76-
${\color{darkkhaki}\text{\Large Prob 1.4: }}\space{\color{olive}\text{\Large b}}$
76+
$\Large{\color{darkkhaki}\text{Prob 1.4: }}\space{\color{olive}\text{b}}$
7777

7878
```java
7979
// x = A ∧ y = B
@@ -104,7 +104,7 @@ $\quad \lbrace \space x = 6 * A + 4 * B \space \land \space y = 2 * A + 2 * B \s
104104

105105
---------------
106106

107-
${\color{darkkhaki}\text{\Large Prob 1.5: }}\space{\color{olive}\text{\Large a}}$
107+
$\Large{\color{darkkhaki}\text{Prob 1.5: }}\space{\color{olive}\text{a}}$
108108

109109
```java
110110
// x = A ∧ y = B
@@ -126,7 +126,7 @@ $\quad \lbrace \space x = B \space \land \space y = A \space \land \space z = A
126126

127127
---------------
128128

129-
${\color{darkkhaki}\text{\Large Prob 1.6: }}\space{\color{olive}\text{\Large b}}$
129+
$\Large{\color{darkkhaki}\text{Prob 1.6: }}\space{\color{olive}\text{b}}$
130130

131131
```java
132132
// y = A ∧ x = z = B

IP-Finals/2018/problem2.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
$\color{cadetblue}{\text{\huge Problem 2}}$
1+
$\huge\color{cadetblue}{\text{Problem 2}}$
22

33
----------------------
44

5-
${\color{rosybrown}\text{\Large Prob 2.1: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N^2)}}}$
5+
$\Large{\color{rosybrown}\text{Prob 2.1: }}{\color{darkseagreen}{{\space \mathcal{O}(N^2)}}}$
66

77
<br/>
88

@@ -17,14 +17,14 @@ while (j > 5) {
1717
}
1818
```
1919

20-
The first loop runs $N$ times, computing the sum of the first $N$ integers, so that after the loop has terminated, we have $j = \frac{N(N+1)}{2}$ by Gauss' formula. The second loop iterates a total number of $j - 5$ times. It is quadratic in $N$, since $j$ is decremented by $1$ at each iteration.
20+
The first loop runs $N$ times, computing the sum of the first $N$ integers, so that after the loop has terminated, we have $j = N(N+1)/2$ by Gauss' formula. The second loop iterates a total number of $j - 5$ times. It is quadratic in $N$, since $j$ is decremented by $1$ at each iteration.
2121
The loops are not nested, so the most expensive one determines the fragment's time complexity, which is therefore in $\mathcal{O}(N^2)$.
2222

2323
<br/>
2424

2525
----------------------
2626

27-
${\color{rosybrown}\text{\Large Prob 2.2: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(\log (N))}}}$
27+
$\Large{\color{rosybrown}\text{Prob 2.2: }}{\color{darkseagreen}{{\space \mathcal{O}(\log (N))}}}$
2828

2929
<br/>
3030

@@ -42,7 +42,7 @@ The variable $i$ is doubled at each iteration, so that the loop runs $\log(N^2)
4242

4343
----------------------
4444

45-
${\color{rosybrown}\text{\Large Prob 2.3: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N)}}}$
45+
$\Large{\color{rosybrown}\text{Prob 2.3: }}{\color{darkseagreen}{{\space \mathcal{O}(N)}}}$
4646

4747
<br/>
4848

@@ -53,13 +53,13 @@ for (int i = 42; i < 7*N; i += 3) {
5353
}
5454
```
5555

56-
The variable $s$ does not affect the complexity of the fragment. The loop runs $\frac{7N - 42}{3}$ $= \frac{7}{3}N - 14$ times. The fragment's time complexity is therefore in $\mathcal{O}(N)$.
56+
The variable $s$ does not affect the complexity of the fragment. The loop runs $(7N - 42)/3$ $= 7/3N - 14$ times. The fragment's time complexity is therefore in $\mathcal{O}(N)$.
5757

5858
<br/>
5959

6060
----------------------
6161

62-
${\color{rosybrown}\text{\Large Prob 2.4: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(\sqrt N)}}}$
62+
$\Large{\color{rosybrown}\text{Prob 2.4: }}{\color{darkseagreen}{{\space \mathcal{O}(\sqrt N)}}}$
6363

6464
<br/>
6565

@@ -81,7 +81,7 @@ The first loop ends when $s = i^2 \geq N$, so that $i \geq \sqrt{N}$. In the sec
8181

8282
----------------------
8383

84-
${\color{rosybrown}\text{\Large Prob 2.5: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N \log (N))}}}$
84+
$\Large{\color{rosybrown}\text{Prob 2.5: }}{\color{darkseagreen}{{\space \mathcal{O}(N \log (N))}}}$
8585

8686
<br/>
8787

@@ -94,7 +94,7 @@ for (int i = N; i > 0; i = i/2) {
9494
}
9595
```
9696

97-
The index $i$ is initialized to $N$ and is halved at the end of each iteration of the outer loop, which therefore runs a total number of $\log(N)$ times. The inner loop runs $N - i$ times for each value of $i$, which is $\frac{N}{2^k}$ for the $k$-th iteration of the outer loop, where $k \in \lbrace 1, \dots, \lfloor \log(N) \rfloor \rbrace$.[^1]
97+
The index $i$ is initialized to $N$ and is halved at the end of each iteration of the outer loop, which therefore runs a total number of $\log(N)$ times. The inner loop runs $N - i$ times for each value of $i$, which is $N/2^k$ for the $k$-th iteration of the outer loop, where $k \in \lbrace 1, \dots, \lfloor \log(N) \rfloor \rbrace$.[^1]
9898
The total number of iterations of the inner loop is therefore given by:
9999

100100
$$
@@ -117,7 +117,7 @@ From the above, we conclude that the fragment's time complexity is in $\mathcal{
117117

118118
----------------------
119119

120-
${\color{rosybrown}\text{\Large Prob 2.6: }}{\color{darkseagreen}{{\Large \space \mathcal{O}(N)}}}$
120+
$\Large{\color{rosybrown}\text{Prob 2.6: }}{\color{darkseagreen}{{\space \mathcal{O}(N)}}}$
121121

122122
<br/>
123123

@@ -131,6 +131,6 @@ for (i = 0; i*i < j; i++) {
131131
}
132132
```
133133

134-
The first loop runs $N$ times, computing the sum of the first $N - 1$ integers, so that in the end $j = \frac{N(N-1)}{2}$ by Gauss' formula. The second loop runs about $\sqrt{j}$ times, which is also linear in $N$. The loops are not nested, so the fragment's time complexity is therefore in $\mathcal{O}(N)$.
134+
The first loop runs $N$ times, computing the sum of the first $N - 1$ integers, so that in the end $j = N(N-1)/2$ by Gauss' formula. The second loop runs about $\sqrt{j}$ times, which is also linear in $N$. The loops are not nested, so the fragment's time complexity is therefore in $\mathcal{O}(N)$.
135135

136136
<br/>

IP-Finals/2018resit/problem1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
$\color{cadetblue}{\text{\huge Problem 1}}$
1+
$\huge\color{cadetblue}{\text{Problem 1}}$
22

33
---------------
44

5-
${\color{darkkhaki}\text{\Large Prob 1.1: }}\space{\color{olive}\text{\Large b}}$
5+
$\Large{\color{darkkhaki}\text{Prob 1.1: }}\space{\color{olive}\text{b}}$
66

77
```java
88
// x = y + 7
@@ -22,7 +22,7 @@ $\quad \lbrace \space x = 11 \space \rbrace$
2222

2323
---------------
2424

25-
${\color{darkkhaki}\text{\Large Prob 1.2: }}\space{\color{olive}\text{\Large c}}$
25+
$\Large{\color{darkkhaki}\text{Prob 1.2: }}\space{\color{olive}\text{c}}$
2626

2727
```java
2828
// x = A ∧ y = B
@@ -49,7 +49,7 @@ $\quad \lbrace \space x = A - B \space \land \space y = A + B \space \rbrace$
4949

5050
---------------
5151

52-
${\color{darkkhaki}\text{\Large Prob 1.3: }}\space{\color{olive}\text{\Large b}}$
52+
$\Large{\color{darkkhaki}\text{Prob 1.3: }}\space{\color{olive}\text{b}}$
5353

5454
```java
5555
// x = A ∧ y = B
@@ -72,7 +72,7 @@ $\quad \lbrace \space x - y = A - B \space \rbrace$
7272

7373
---------------
7474

75-
${\color{darkkhaki}\text{\Large Prob 1.4: }}\space{\color{olive}\text{\Large a}}$
75+
$\Large{\color{darkkhaki}\text{Prob 1.4: }}\space{\color{olive}\text{a}}$
7676

7777
```java
7878
// x = A ∧ y = B
@@ -97,7 +97,7 @@ $\quad \lbrace \space x = B \space \land \space y = A - B \space \rbrace$
9797

9898
---------------
9999

100-
${\color{darkkhaki}\text{\Large Prob 1.5: }}\space{\color{olive}\text{\Large a}}$
100+
$\Large{\color{darkkhaki}\text{Prob 1.5: }}\space{\color{olive}\text{a}}$
101101

102102
```java
103103
// x = A ∧ y = B
@@ -124,7 +124,7 @@ $\quad \lbrace \space x = 3 * A + B \space \land \space y = A + B \space \land \
124124

125125
---------------
126126

127-
${\color{darkkhaki}\text{\Large Prob 1.6: }}\space{\color{olive}\text{\Large c}}$
127+
$\Large{\color{darkkhaki}\text{Prob 1.6: }}\space{\color{olive}\text{c}}$
128128

129129
```java
130130
// x = A + B ∧ y = A - B

IP-Finals/2018resit/problem2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ while (i > 1) {
1414
}
1515
```
1616

17-
The variable $i$ is halved in each loop iteration, so that after $k$ iterations $i = \frac{N}{2^k}$. The loop terminates when $i \leq 1$, which happens when $k \geq \log(N)$. The loop therefore runs in $\mathcal{O}(\log(N))$ time.
17+
The variable $i$ is halved in each loop iteration, so that after $k$ iterations $i = N/2^k$. The loop terminates when $i \leq 1$, which happens when $k \geq \log(N)$. The loop therefore runs in $\mathcal{O}(\log(N))$ time.
1818

1919
<br/>
2020

@@ -31,7 +31,7 @@ for (int i = 0; i < N; i += 10) {
3131
}
3232
```
3333

34-
Since the loop variable $i$ is incremented by 10 in each iteration, the loop runs $\frac{N}{10}$ times. The fragment's time complexity is therefore in $\mathcal{O}(N)$.
34+
Since the loop variable $i$ is incremented by 10 in each iteration, the loop runs $N/10$ times. The fragment's time complexity is therefore in $\mathcal{O}(N)$.
3535

3636
<br/>
3737

@@ -49,7 +49,7 @@ while (s < N) {
4949
}
5050
```
5151

52-
The variable $s$ is incremented by $i$ in each iteration, while $i$ just counts the number of iterations. After $i$ iterations, $s = \frac{i(i+1)}{2}$ by Gauss' formula. The loop terminates when:
52+
The variable $s$ is incremented by $i$ in each iteration, while $i$ just counts the number of iterations. After $i$ iterations, $s = i(i+1)/2$ by Gauss' formula. The loop terminates when:
5353

5454
$$
5555
\begin{align*}

0 commit comments

Comments
 (0)