-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
632 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Midterm Winter 2019 | ||
path: comp2804/midterm-winter-2019 | ||
author: Michiel Smid | ||
course: comp2804 | ||
questions: | ||
- comp2804/midterm-winter-2019/1 | ||
- comp2804/midterm-winter-2019/2 | ||
- comp2804/midterm-winter-2019/3 | ||
- comp2804/midterm-winter-2019/4 | ||
- comp2804/midterm-winter-2019/5 | ||
- comp2804/midterm-winter-2019/6 | ||
- comp2804/midterm-winter-2019/7 | ||
- comp2804/midterm-winter-2019/8 | ||
- comp2804/midterm-winter-2019/9 | ||
- comp2804/midterm-winter-2019/10 | ||
- comp2804/midterm-winter-2019/11 | ||
- comp2804/midterm-winter-2019/12 | ||
- comp2804/midterm-winter-2019/13 | ||
- comp2804/midterm-winter-2019/14 | ||
- comp2804/midterm-winter-2019/15 | ||
- comp2804/midterm-winter-2019/16 | ||
- comp2804/midterm-winter-2019/17 | ||
--- |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/1/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/1 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/1/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
21 changes: 21 additions & 0 deletions
21
src/content/questions/comp2804/midterm-winter-2019/1/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
Consider bitstrings of length 13. The positions in these strings are numbered as $1,2,3,\dots,13$. | ||
How many such bitstrings have the property that all bits at the odd positions are equal? | ||
`; | ||
|
||
const label1 = String.raw`32`; | ||
const label2 = String.raw`64`; | ||
const label3 = String.raw`128`; | ||
const label4 = String.raw`256`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: false }, | ||
{ label: label3, correct: true }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/10/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/10 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/10/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
24 changes: 24 additions & 0 deletions
24
src/content/questions/comp2804/midterm-winter-2019/10/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
A bitstring is called 00-<em>free</em>, if it does not contain two 0's next to each other. | ||
In class, we have seen that for any $m \geq 1$, | ||
the number of 00-free bitstrings of length $m$ is equal to the $(m+2)$-th Fibonacci number | ||
$f_{m+2}$. <br> | ||
What is the number of 00-free bitstrings of length 77 that have 0 at position 59? (The positions are numbered $1,2,\dots,77$.) | ||
`; | ||
|
||
const label1 = String.raw`$f_{17} \cdot f_{57}$`; | ||
const label2 = String.raw`$f_{18} \cdot f_{58}$`; | ||
const label3 = String.raw`$f_{19} \cdot f_{59}$`; | ||
const label4 = String.raw`$f_{20} \cdot f_{60}$`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: false }, | ||
{ label: label3, correct: true }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/11/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/11 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/11/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
27 changes: 27 additions & 0 deletions
27
src/content/questions/comp2804/midterm-winter-2019/11/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
The function $f : \mathbb{N} \rightarrow \mathbb{N}$ is recursively defined as follows: | ||
$$ | ||
\begin{align} | ||
f(0) &= 6, \\ | ||
f(n) &= 4 \cdot f(n-1) + 2^{n} \ \ \mathrm{if}\ n \geq 1. | ||
\end{align} | ||
$$ | ||
Which of the following is true for all integers $n \geq 0$? | ||
`; | ||
|
||
const label1 = String.raw`$f(n) = 6 \cdot 4^{n} - 2^{n}$`; | ||
const label2 = String.raw`$f(n) = 7 \cdot 4^{n} - 2^{n}$`; | ||
const label3 = String.raw`$f(n) = 8 \cdot 4^{n} - 2^{n+1}$`; | ||
const label4 = String.raw`None of the above.`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: true }, | ||
{ label: label3, correct: false }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/12/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/12 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/12/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
23 changes: 23 additions & 0 deletions
23
src/content/questions/comp2804/midterm-winter-2019/12/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
Consider strings of characters, where each character is an element of the set $\{a, b, c\}$. Such a | ||
string is called <em>awesome</em>, if it does not contain $aa$, and does not contain $aba$, and does not contain $abb$. <br> | ||
For any integer $n \geq 1$, let $A_n$ be the number of awesome strings of length $n$. <br> | ||
Which of the following is true for any integer $n \geq 4$? | ||
`; | ||
|
||
const label1 = String.raw`$A_n = A_{n-1} + 2 \cdot A_{n-2} + 2 \cdot A_{n-3}$`; | ||
const label2 = String.raw`$A_n = A_{n-1} + 2 \cdot A_{n-2} + A_{n-3}$`; | ||
const label3 = String.raw`$A_n = 2 \cdot A_{n-1} + A_{n-2} + 2 \cdot A_{n-3}$`; | ||
const label4 = String.raw`$A_n = 2 \cdot A_{n-1} + A_{n-2} + A_{n-3}$`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: false }, | ||
{ label: label3, correct: false }, | ||
{ label: label4, correct: true }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/13/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/13 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/13/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
32 changes: 32 additions & 0 deletions
32
src/content/questions/comp2804/midterm-winter-2019/13/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
We consider binary $2 \times n$ matrices, i.e., matrices with 2 rows and $n$ columns, in which each | ||
entry is 0 or 1. A column in such a matrix is called a <span class="sticky">$1 \atop 1$-<em>column</em>,</span> | ||
if both bits in the column are 1. <br> | ||
For any integer $n \geq 1$ and integer $k$ with $0 \leq k \leq n$, let $M(n,k)$ be the number of binary $2 \times n$ matrices | ||
<ul style="margin: 0.5rem 0;"> | ||
<li> | ||
that do not contain any $1 \atop 1$-column, and | ||
</li> | ||
<li> | ||
contain exactly $k$ many 1's. | ||
</li> | ||
</ul> | ||
Which of the following is true for all <span class="sticky">integers $n \geq 2$</span> and $k$ with $1 \leq k \leq n-1$? | ||
`; | ||
|
||
const label1 = String.raw`$M(n,k) = M(n-1,k)\ +$$\ M(n-1,k-1)$`; | ||
const label2 = String.raw`$M(n,k) = M(n-1,k)\ +$$\ 2 \cdot M(n-1,k-1)$`; | ||
const label3 = String.raw`$M(n,k) = M(n,k-1)\ +$$\ M(n-1,k-1)$`; | ||
const label4 = String.raw`$M(n,k) = M(n,k-1)\ +$$\ 2 \cdot M(n-1,k-1)$`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: true }, | ||
{ label: label3, correct: false }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/14/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/14 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/14/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
35 changes: 35 additions & 0 deletions
35
src/content/questions/comp2804/midterm-winter-2019/14/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
<div hidden>$\newcommand{\HelloWorld}{{\rm H {\scriptsize ELLO} W {\scriptsize ORLD}}}$</div> | ||
Consider the recursive algorithm $\HelloWorld$, which takes as input an integer $n \geq 0$: | ||
<p> | ||
$\mathbf{Algorithm}\ \HelloWorld(n)\mathrm{:}$ <br> | ||
$\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$ <br> | ||
$\mathbf{then}\ \mathrm{print}\ \mathit{Hello}\ \mathit{World}$ <br> | ||
$\mathbf{else}\ \mathbf{if}\ n \text{ is a multiple of } 3$ <br> | ||
$\qquad \mathbf{then}\ \HelloWorld\left( n \middle/ 3 \right);$ <br> | ||
$\qquad \qquad \ \ \mathrm{print}\ \mathit{Hello}\ \mathit{World};$ <br> | ||
$\qquad \qquad \ \ \HelloWorld\left( 2n \middle/ 3 \right)$ <br> | ||
$\qquad \mathbf{else}\ \HelloWorld(n + 1)$ <br> | ||
$\qquad \mathbf{endif};$ <br> | ||
$\mathbf{endif}$ | ||
</p> | ||
Which of the following is correct? | ||
`; | ||
|
||
const label1 = String.raw`For any integer $n \geq 0$, algorithm $\HelloWorld(n)$ terminates.`; | ||
const label2 = String.raw`There exists an integer $n \geq 0$, for which algorithm $\HelloWorld(n)$ does not terminate.`; | ||
const label3 = String.raw`All of the above.`; | ||
const label4 = String.raw`None of the above.`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: true }, | ||
{ label: label3, correct: false }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/15/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/15 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/15/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
39 changes: 39 additions & 0 deletions
39
src/content/questions/comp2804/midterm-winter-2019/15/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
The Carleton Computer Science Society (CCSS) is organizing their annual Saint Patrick's Day party. | ||
The CCSS has bought three types of drinks: | ||
<ul style="margin: 0.5rem 0;"> | ||
<li> | ||
Porterhouse Brewing Co. Oyster Stout, | ||
</li> | ||
<li> | ||
Guinness Extra Stout, | ||
</li> | ||
<li> | ||
Magners Original Irish Cider. | ||
</li> | ||
</ul> | ||
There is an unlimited supply for each of these types. <br> | ||
There are 75 students at the party, and each of them gets one drink, which is chosen uniformly at random from these three types. <br> | ||
Let $A$ be the event | ||
[defs] | ||
A = "exactly 50 students get Magners Original Irish Cider". | ||
[/defs] | ||
What is $\Pr(A)$? | ||
`; | ||
|
||
const label1 = String.raw`$\frac{{ 75 \choose 50 } \cdot 2^{25}}{3^{75}}$`; | ||
const label2 = String.raw`$\frac{3^{75}}{{75 \choose 50} \cdot 2^{25}}$`; | ||
const label3 = String.raw`$\frac{75 \choose 50}{3^{75}}$`; | ||
const label4 = String.raw`$\frac{{75 \choose 50} \cdot 3^{25}}{3^{75}}$`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: true }, | ||
{ label: label2, correct: false }, | ||
{ label: label3, correct: false }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/16/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/16 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/16/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
24 changes: 24 additions & 0 deletions
24
src/content/questions/comp2804/midterm-winter-2019/16/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
Consider a standard 6-sided fair die. We roll this die 8 times. Let $A$ be the event | ||
[defs] | ||
A = "there are at least two 5's in the sequence of 8 rolls". | ||
[/defs] | ||
What is $\Pr(A)$? | ||
`; | ||
|
||
const label1 = String.raw`$1 - {\frac{8 \cdot 5^{7}}{6^{8}}}$`; | ||
const label2 = String.raw`$1 - {\frac{6^{8}}{5^{8} + 8 \cdot 5^{7}}}$`; | ||
const label3 = String.raw`$1 - {\frac{5^{8} + 8 \cdot 5^{7}}{6^{8}}}$`; | ||
const label4 = String.raw`$1 - {\frac{8^{5} + 8 \cdot 7^{5}}{8^{6}}}$`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: false }, | ||
{ label: label3, correct: true }, | ||
{ label: label4, correct: false }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/17/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/17 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/17/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
26 changes: 26 additions & 0 deletions
26
src/content/questions/comp2804/midterm-winter-2019/17/question.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; | ||
|
||
const body = String.raw` | ||
This midterm has 17 questions. For each question, four options are given, exactly one of which is | ||
correct. Assume that you answer each question, by choosing one of the four options uniformly at random. <br> | ||
Let A be the event | ||
[defs] | ||
A = "you answer at least 16 questions correctly". | ||
[/defs] | ||
What is $\Pr(A)$? | ||
`; | ||
|
||
const label1 = String.raw`$\frac{4^{17}}{52}$`; | ||
const label2 = String.raw`$\frac{51}{4^{17}}$`; | ||
const label3 = String.raw`$\frac{49}{4^{17}}$`; | ||
const label4 = String.raw`$\frac{52}{4^{17}}$`; | ||
|
||
export const question: MultipleChoiceQuestion = { | ||
body: body, | ||
options: [ | ||
{ label: label1, correct: false }, | ||
{ label: label2, correct: false }, | ||
{ label: label3, correct: false }, | ||
{ label: label4, correct: true }, | ||
], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/content/questions/comp2804/midterm-winter-2019/2/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: N/A | ||
path: comp2804/midterm-winter-2019/2 | ||
type: multiple-choice | ||
author: Michiel Smid | ||
question: comp2804/midterm-winter-2019/2/question.ts | ||
tags: | ||
- comp2804 | ||
--- |
Oops, something went wrong.