diff --git a/src/content/evaluations/comp2804/midterm-winter-2019.md b/src/content/evaluations/comp2804/midterm-winter-2019.md new file mode 100644 index 00000000..08d78a67 --- /dev/null +++ b/src/content/evaluations/comp2804/midterm-winter-2019.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/1/index.md b/src/content/questions/comp2804/midterm-winter-2019/1/index.md new file mode 100644 index 00000000..f03e97c3 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/1/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/1/question.ts b/src/content/questions/comp2804/midterm-winter-2019/1/question.ts new file mode 100644 index 00000000..0e6d2c6e --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/1/question.ts @@ -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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/10/index.md b/src/content/questions/comp2804/midterm-winter-2019/10/index.md new file mode 100644 index 00000000..93b550d4 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/10/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/10/question.ts b/src/content/questions/comp2804/midterm-winter-2019/10/question.ts new file mode 100644 index 00000000..c5be4c0c --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/10/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +A bitstring is called 00-free, 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}$.
+ 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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/11/index.md b/src/content/questions/comp2804/midterm-winter-2019/11/index.md new file mode 100644 index 00000000..6df449b0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/11/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/11/question.ts b/src/content/questions/comp2804/midterm-winter-2019/11/question.ts new file mode 100644 index 00000000..cef01d53 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/11/question.ts @@ -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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/12/index.md b/src/content/questions/comp2804/midterm-winter-2019/12/index.md new file mode 100644 index 00000000..673faf93 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/12/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/12/question.ts b/src/content/questions/comp2804/midterm-winter-2019/12/question.ts new file mode 100644 index 00000000..cff19943 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/12/question.ts @@ -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 awesome, if it does not contain $aa$, and does not contain $aba$, and does not contain $abb$.
+ For any integer $n \geq 1$, let $A_n$ be the number of awesome strings of length $n$.
+ 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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/13/index.md b/src/content/questions/comp2804/midterm-winter-2019/13/index.md new file mode 100644 index 00000000..7a97d04c --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/13/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/13/question.ts b/src/content/questions/comp2804/midterm-winter-2019/13/question.ts new file mode 100644 index 00000000..7f6f8572 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/13/question.ts @@ -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 $1 \atop 1$-column, + if both bits in the column are 1.
+ 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 + + Which of the following is true for all integers $n \geq 2$ 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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/14/index.md b/src/content/questions/comp2804/midterm-winter-2019/14/index.md new file mode 100644 index 00000000..eec9317d --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/14/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/14/question.ts b/src/content/questions/comp2804/midterm-winter-2019/14/question.ts new file mode 100644 index 00000000..697a76c1 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/14/question.ts @@ -0,0 +1,35 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the recursive algorithm $\HelloWorld$, which takes as input an integer $n \geq 0$: +

+ $\mathbf{Algorithm}\ \HelloWorld(n)\mathrm{:}$
+ $\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
+ $\mathbf{then}\ \mathrm{print}\ \mathit{Hello}\ \mathit{World}$
+ $\mathbf{else}\ \mathbf{if}\ n \text{ is a multiple of } 3$
+ $\qquad \mathbf{then}\ \HelloWorld\left( n \middle/ 3 \right);$
+ $\qquad \qquad \ \ \mathrm{print}\ \mathit{Hello}\ \mathit{World};$
+ $\qquad \qquad \ \ \HelloWorld\left( 2n \middle/ 3 \right)$
+ $\qquad \mathbf{else}\ \HelloWorld(n + 1)$
+ $\qquad \mathbf{endif};$
+ $\mathbf{endif}$ +

+ 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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/15/index.md b/src/content/questions/comp2804/midterm-winter-2019/15/index.md new file mode 100644 index 00000000..747eb9d8 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/15/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/15/question.ts b/src/content/questions/comp2804/midterm-winter-2019/15/question.ts new file mode 100644 index 00000000..eb438a79 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/15/question.ts @@ -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: + + There is an unlimited supply for each of these types.
+ There are 75 students at the party, and each of them gets one drink, which is chosen uniformly at random from these three types.
+ 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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/16/index.md b/src/content/questions/comp2804/midterm-winter-2019/16/index.md new file mode 100644 index 00000000..e9572479 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/16/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/16/question.ts b/src/content/questions/comp2804/midterm-winter-2019/16/question.ts new file mode 100644 index 00000000..d0e34c1a --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/16/question.ts @@ -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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/17/index.md b/src/content/questions/comp2804/midterm-winter-2019/17/index.md new file mode 100644 index 00000000..fde60f00 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/17/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/17/question.ts b/src/content/questions/comp2804/midterm-winter-2019/17/question.ts new file mode 100644 index 00000000..ac044214 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/17/question.ts @@ -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.
+ 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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/2/index.md b/src/content/questions/comp2804/midterm-winter-2019/2/index.md new file mode 100644 index 00000000..d56289a0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/2/index.md @@ -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 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/2/question.ts b/src/content/questions/comp2804/midterm-winter-2019/2/question.ts new file mode 100644 index 00000000..448ae0fd --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/2/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider permutations of the set $\{a,b,c,d,e,f,g\}$ that do not contain $bge$ (in this order).
+ How many such permutations are there? +`; + +const label1 = String.raw`$7! - 6!$`; +const label2 = String.raw`$7! - 5!$`; +const label3 = String.raw`$7! - 4!$`; +const label4 = String.raw`$7! - 3!$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/3/index.md b/src/content/questions/comp2804/midterm-winter-2019/3/index.md new file mode 100644 index 00000000..2c43e2c9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/3/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/3 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/3/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/3/question.ts b/src/content/questions/comp2804/midterm-winter-2019/3/question.ts new file mode 100644 index 00000000..9392b21f --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/3/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider strings of length 15, where each character is a lowercase letter or an uppercase letter. + How many such strings contain at least one lowercase letter and at least one uppercase letter? +`; + +const label1 = String.raw`$52^{15} - 26^{15}$`; +const label2 = String.raw`$52^{15} - 2 \cdot 26^{15}$`; +const label3 = String.raw`$52^{15} - 3 \cdot 26^{15}$`; +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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/4/index.md b/src/content/questions/comp2804/midterm-winter-2019/4/index.md new file mode 100644 index 00000000..f50782e5 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/4/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/4 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/4/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/4/question.ts b/src/content/questions/comp2804/midterm-winter-2019/4/question.ts new file mode 100644 index 00000000..c7a982b1 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/4/question.ts @@ -0,0 +1,26 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 8$ be an even integer and let $k$ be an integer with $2 \leq k \leq n/2$. Consider + $k$-element subsets of the set $S = \{1,2,\dots,n\}$. How many such subsets contain at least two even + numbers? +`; + +const label1 = + "${n \\choose k} - {n/2 \\choose k - 1} - \\frac{n}{2} \\cdot {n/2 \\choose k}$"; +const label2 = + "${n \\choose k} - {n/2 \\choose k - 1} - \\frac{n}{2} \\cdot {n/2 \\choose k - 1}$"; +const label3 = + "${n \\choose k} - {n/2 \\choose k} - \\frac{n}{2} \\cdot {n/2 \\choose k}$"; +const label4 = + "${n \\choose k} - {n/2 \\choose k} - \\frac{n}{2} \\cdot {n/2 \\choose k - 1}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/5/index.md b/src/content/questions/comp2804/midterm-winter-2019/5/index.md new file mode 100644 index 00000000..f69261a9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/5/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/5 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/5/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/5/question.ts b/src/content/questions/comp2804/midterm-winter-2019/5/question.ts new file mode 100644 index 00000000..ef7bd41b --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/5/question.ts @@ -0,0 +1,32 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +In a group of 100 students, + + How many students like beer and cider? +`; + +const label1 = String.raw`8`; +const label2 = String.raw`9`; +const label3 = String.raw`10`; +const label4 = String.raw`11`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/6/index.md b/src/content/questions/comp2804/midterm-winter-2019/6/index.md new file mode 100644 index 00000000..ea30a3ed --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/6/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/6 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/6/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/6/question.ts b/src/content/questions/comp2804/midterm-winter-2019/6/question.ts new file mode 100644 index 00000000..68063a2d --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/6/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 1$ be an integer. A group of $n$ students write an exam. Each student receives a grade, + which is an element of the set $\{A, B, C, D, F\}$.
+ What is the minimum value for $n$, such that there must be at least four students who receive the same grade? +`; + +const label1 = String.raw`14`; +const label2 = String.raw`15`; +const label3 = String.raw`16`; +const label4 = String.raw`17`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/7/index.md b/src/content/questions/comp2804/midterm-winter-2019/7/index.md new file mode 100644 index 00000000..d2ee3ef4 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/7/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/7 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/7/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/7/question.ts b/src/content/questions/comp2804/midterm-winter-2019/7/question.ts new file mode 100644 index 00000000..b6079150 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/7/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider 17-element subsets of the set $\{1,2,3,\dots,45\}$.
+ How many such subsets have the property that the largest element in the subset is equal to 30? +`; + +const label1 = "${{29}\\choose{16}}$"; +const label2 = "${29 \\choose 17}$"; +const label3 = "${30 \\choose 16}$"; +const label4 = "${30 \\choose 17}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/8/index.md b/src/content/questions/comp2804/midterm-winter-2019/8/index.md new file mode 100644 index 00000000..4c0f82df --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/8/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/8 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/8/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/8/question.ts b/src/content/questions/comp2804/midterm-winter-2019/8/question.ts new file mode 100644 index 00000000..6b978ceb --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/8/question.ts @@ -0,0 +1,28 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 4$ be an integer. What does + $$ + 3 \cdot { n\choose 3} + 6n \cdot {n \choose 2} + n^3 + $$ + count? +`; + +const label1 = String.raw`The number of ways to choose an ordered triple +

+ (beer bottle, cider bottle, wine bottle) +

+ in a set consisting of $n$ beer bottles, $n$ cider bottles, and $n$ wine bottles.`; +const label2 = String.raw`The number of ways to choose a 3-element subset of a set consisting of $n$ beer bottles, $n$ cider bottles, and $n$ wine bottles.`; +const label3 = String.raw`The number of ways to choose 3 elements (with repetitions allowed) in a set consisting of $n$ beer bottles, $n$ cider bottles, and $n$ wine bottles.`; +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 }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-winter-2019/9/index.md b/src/content/questions/comp2804/midterm-winter-2019/9/index.md new file mode 100644 index 00000000..4c2bf83f --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/9/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-winter-2019/9 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-winter-2019/9/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-winter-2019/9/question.ts b/src/content/questions/comp2804/midterm-winter-2019/9/question.ts new file mode 100644 index 00000000..eedaf403 --- /dev/null +++ b/src/content/questions/comp2804/midterm-winter-2019/9/question.ts @@ -0,0 +1,33 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 4$ be an even integer and let $k$ be an integer with $1 \leq k \leq n/2$. Consider + strings consisting of $n$ characters, such that + + How many such strings are there? +`; + +const label1 = "${n/2 \\choose k} \\cdot 2^{n-k}$"; +const label2 = "${n/2 \\choose k} \\cdot 2^{n/2}$"; +const label3 = "${n \\choose k} cdot 2^{n-k}$"; +const label4 = "${n \\choose k} \\cdot 2^{n/2}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +};