Skip to content

Commit

Permalink
Update questions to the new .xml format app/src/data/questions (#207)
Browse files Browse the repository at this point in the history
* Converted to new format

* Delete .idea directory
  • Loading branch information
mukasaj committed Oct 21, 2023
1 parent 9fc53ea commit 225ef34
Show file tree
Hide file tree
Showing 483 changed files with 8,548 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/exam-fall-2014.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": "exam-fall-2014",
"title": "Fall 2014 Exam",
"Author": "Michiel Smid",
"questions": [
"comp2804/exam-fall-2014/f14f01.xml",
"comp2804/exam-fall-2014/f14f02.xml",
"comp2804/exam-fall-2014/f14f03.xml",
"comp2804/exam-fall-2014/f14f04.xml",
"comp2804/exam-fall-2014/f14f05.xml",
"comp2804/exam-fall-2014/f14f06.xml",
"comp2804/exam-fall-2014/f14f07.xml",
"comp2804/exam-fall-2014/f14f08.xml",
"comp2804/exam-fall-2014/f14f09.xml",
"comp2804/exam-fall-2014/f14f10.xml",
"comp2804/exam-fall-2014/f14f11.xml",
"comp2804/exam-fall-2014/f14f12.xml",
"comp2804/exam-fall-2014/f14f13.xml",
"comp2804/exam-fall-2014/f14f14.xml",
"comp2804/exam-fall-2014/f14f15.xml",
"comp2804/exam-fall-2014/f14f16.xml",
"comp2804/exam-fall-2014/f14f17.xml",
"comp2804/exam-fall-2014/f14f18.xml",
"comp2804/exam-fall-2014/f14f19.xml",
"comp2804/exam-fall-2014/f14f20.xml",
"comp2804/exam-fall-2014/f14f21.xml",
"comp2804/exam-fall-2014/f14f22.xml",
"comp2804/exam-fall-2014/f14f23.xml",
"comp2804/exam-fall-2014/f14f24.xml",
"comp2804/exam-fall-2014/f14f25.xml"
]
}
12 changes: 12 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f01.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<multiple-choice>
<question>
<![CDATA[
A password consists of 13 characters, each character being one of the ten digits $0,1,2,\dots,9$. <br>
A password must contain exactly one odd digit. How many passwords are there?
]]>
</question>
<answer correct="false">$13 \cdot 5^{12}$</answer>
<answer correct="true">$13 \cdot 5^{13}$</answer>
<answer correct="false">$13 \cdot 9^{12}$</answer>
<answer correct="false">$13 \cdot 5 \cdot 9^{12}$</answer>
</multiple-choice>
13 changes: 13 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f02.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<multiple-choice>
<question>
<![CDATA[
A password consists of 13 characters, each character being one of the ten digits $0,1,2,\dots,9$. <br>
A password must contain at least one odd digit and at most two even digits. How many passwords are
there?
]]>
</question>
<answer correct="false">$5^{12} + 13 \cdot 5^{12} + {13 \choose 2}5^{12}$</answer>
<answer correct="false">$5^{13} + 13 \cdot 9^{12} + {13 \choose 2}9^{12}$</answer>
<answer correct="true">$5^{13} + 13 \cdot 5^{13} + {13 \choose 2}5^{13}$</answer>
<answer correct="false">$5 \cdot 9^{12} + 13 \cdot 5 \cdot 9^{12} + {13 \choose 2}5 \cdot 9^{12}$</answer>
</multiple-choice>
14 changes: 14 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f03.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<multiple-choice>
<question>
<![CDATA[
What is
$$
\sum_{k = 0}^{45} {45 \choose k}(-3)^{2k}.
$$
]]>
</question>
<answer correct="false">$(-2)^{45}$</answer>
<answer correct="false">$4^{45}$</answer>
<answer correct="false">$(-8)^{45}$</answer>
<answer correct="true">$10^{45}$</answer>
</multiple-choice>
11 changes: 11 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f04.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<multiple-choice>
<question>
<![CDATA[
How many bitstings of length 13 start with 010 or end with 11?
]]>
</question>
<answer correct="false">$2^{10} + 2^{11}$</answer>
<answer correct="true">$3 \cdot 2^{10} - 2^{8}$</answer>
<answer correct="false">$2^{13} - (2^{10} + 2^{11})$</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
12 changes: 12 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f05.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<multiple-choice>
<question>
<![CDATA[
Let $S_n$ be the number of bitstrings of length $n$ that do not contain the substring 11. Which of
the following is true?
]]>
</question>
<answer correct="true">$S_n = S_{n-1} + S_{n-2}\ \mathrm{for}\ n \geq 3.$</answer>
<answer correct="false">$S_n = S_{n-1} + S_{n-3}\ \mathrm{for}\ n \geq 3.$</answer>
<answer correct="false">$S_n = S_{n-1} + S_{n-2} + S_{n-3}\ \mathrm{for}\ n \geq 3.$</answer>
<answer correct="false">$S_n = 2 \cdot S_{n-1}\ \mathrm{for}\ n \geq 3.$</answer>
</multiple-choice>
23 changes: 23 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f06.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<multiple-choice>
<question>
<![CDATA[
In a group of 100 students,
<ul style="margin: 0.5rem 0;">
<li>
40 like 8:30am classes,
</li>
<li>
30 like the course COMP 2804,
</li>
<li>
50 do not like 8:30am classes and do not like the course COMP 2804.
</li>
</ul>
How many students in this group like 8:30am classes and like the course COMP 2804?
]]>
</question>
<answer correct="false">10</answer>
<answer correct="true">20</answer>
<answer correct="false">30</answer>
<answer correct="false">40</answer>
</multiple-choice>
13 changes: 13 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f07.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<multiple-choice>
<question>
<![CDATA[
Consider $m \geq 7$ blue balls $B_1,B_2,\dots,B_m$ and $n \geq 7$ red balls $R_1,R_2,\dots,R_n$.
We pick 7 balls of the same color and arrange them on a horizontal line. (The order on the line
matters.) How many arrangements are there?
]]>
</question>
<answer correct="true">$7!{m \choose 7} + 7!{n \choose 7}$</answer>
<answer correct="false">$m!{m \choose 7} + n!{n \choose 7}$</answer>
<answer correct="false">$7!{m + n \choose 7}$</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
11 changes: 11 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f08.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<multiple-choice>
<question>
<![CDATA[
The number of different strings that can be made by reordering the 10 letters of the word AAABBCCCCC is
]]>
</question>
<answer correct="false">$10!$</answer>
<answer correct="true">$\frac{10!}{2!3!5!}$</answer>
<answer correct="false">${10 \choose 3}{10 \choose 2}{10 \choose 5}$</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
12 changes: 12 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f09.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<multiple-choice>
<question>
<![CDATA[
How many solutions are there to the equation $x_1 + x_2 + x_3 = 13$, where $x_1 \geq 0$, $x_2 \geq 0$,
$x_3 \geq 0$ are integers?
]]>
</question>
<answer correct="false">${13 \choose 2}$</answer>
<answer correct="false">${14 \choose 2}$</answer>
<answer correct="true">${15 \choose 2}$</answer>
<answer correct="false">${16 \choose 2}$</answer>
</multiple-choice>
24 changes: 24 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f10.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<multiple-choice>
<question>
<![CDATA[
Consider the following recursive function:
<table style="margin: 1rem auto;">
<tbody>
<tr>
<td style="vertical-align: top;">$f(0) = $</td>
<td>$-17,$</td>
</tr>
<tr>
<td style="vertical-align: top;">$f(n) = $</td>
<td>$f(n - 1) + 8n - 2\; \ \text{for all}$ $\text{integers}\ n \geq 1.$</td>
</tr>
</tbody>
</table>
Which of the following is true?
]]>
</question>
<answer correct="false">for all $n \geq 0$: $f(n) = 3n^{2} - n - 17$</answer>
<answer correct="false">for all $n \geq 0$: $f(n) = 3n^{2} + n - 17$</answer>
<answer correct="false">for all $n \geq 0$: $f(n) = 4n^{2} - 2n - 17$</answer>
<answer correct="true">for all $n \geq 0$: $f(n) = 4n^{2} + 2n - 17$</answer>
</multiple-choice>
27 changes: 27 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f11.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<multiple-choice>
<question>
<![CDATA[
<div hidden>
$\newcommand{\Fib}{{\rm F \scriptsize IB}}$
</div>
Consider the recursive algorithm $\Fib$, which takes as input an
integer $n \geq 0$:
<p>
$\mathbf{Algorithm}\ \Fib(n)\mathrm{:}$ <br>
$\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$ <br>
$\mathbf{then}\ f = n$ <br>
$\mathbf{else}\ f = \Fib(n - 1) + \Fib(n - 2)$ <br>
$\mathbf{endif};$ <br>
$\mathbf{return}\ f$ <br>
</p>
If we run algorithm $\Fib(20)$, how many calls are there to $\Fib(16)$?
]]>
</question>
<answer correct="false">4</answer>
<answer correct="true">5</answer>
<answer correct="false">6</answer>
<answer correct="false">7</answer>
</multiple-choice>
12 changes: 12 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f12.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<multiple-choice>
<question>
<![CDATA[
A bowl contains 5 blue balls, 4 red balls, and 6 green balls. We choose 2 balls uniformly at random.
What is the probability that these 2 balls have the same color?
]]>
</question>
<answer correct="true">$\frac{{5 \choose 2} + {4 \choose 2} + {6 \choose 2}}{{15 \choose 2}}$</answer>
<answer correct="false">$\frac{{15 \choose 2}}{{5 \choose 2} + {4 \choose 2} + {6 \choose 2}}$</answer>
<answer correct="false">$\frac{{5 \choose 2}{4 \choose 2}{6 \choose 2}}{{15 \choose 2}}$</answer>
<answer correct="false">$\frac{{15 \choose 2}}{{5 \choose 2}{4 \choose 2}{6 \choose 2}}$</answer>
</multiple-choice>
12 changes: 12 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f13.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<multiple-choice>
<question>
<![CDATA[
Annie, Boris, and Charlie have random and independent birthdays. (We ignore leap years, so that a
year has 365 days.) What is the probability that Annie, Boris, and Charlie have the same birthday?
]]>
</question>
<answer correct="false">$\frac{1}{364 \cdot 365}$</answer>
<answer correct="true">$\frac{1}{365^2}$</answer>
<answer correct="false">$\frac{365}{364^{2}}$</answer>
<answer correct="false">$\frac{1}{365^{3}}$</answer>
</multiple-choice>
13 changes: 13 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f14.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<multiple-choice>
<question>
<![CDATA[
We flip a fair coin repeatedly and independently, resulting in a sequence of heads ($H$) and tails
($T$). We stop flipping the coin as soon as this sequence contains one $H$ or eight $T$s. What is
the probability that this sequence contains at most 7 $T$s?
]]>
</question>
<answer correct="false">$1 - (1/2)^{7}$</answer>
<answer correct="false">$\sum_{k=0}^{7} (1/2)^{k}$</answer>
<answer correct="true">$\sum_{k=0}^{7} (1/2)^{k+1}$</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
17 changes: 17 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f15.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<multiple-choice>
<question>
<![CDATA[
A bowl contains 5 blue balls and 4 red balls. We choose 2 balls uniformly at random. Define the
events
[defs]
A = "both balls are red",
B = "both balls have the same color".
[/defs]
What is the conditional probability $\Pr(A|B)$?
]]>
</question>
<answer correct="true">$\frac{{4 \choose 2}}{{5 \choose 2} + {4 \choose 2}}$</answer>
<answer correct="false">$\frac{{5 \choose 2} + {4 \choose 2}}{{4 \choose 2}}$</answer>
<answer correct="false">$\frac{{4 \choose 2}}{{9 \choose 2}}$</answer>
<answer correct="false">$\frac{{4 \choose 2}}{{5 \choose 2}{4 \choose 2}}$</answer>
</multiple-choice>
16 changes: 16 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f16.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<multiple-choice>
<question>
<![CDATA[
We choose an element $x$ uniformly at random from the set $\{1,2,3,\dots,10\}$. Define the events
[defs]
A = "$x$ is even",
B = "$x$ is divisible by 3".
[/defs]
What is the conditional probability $\Pr(A|B)$?
]]>
</question>
<answer correct="false">3/10</answer>
<answer correct="true">1/3</answer>
<answer correct="false">1/2</answer>
<answer correct="false">2/3</answer>
</multiple-choice>
18 changes: 18 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f17.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<multiple-choice>
<question>
<![CDATA[
We choose an element $x$ uniformly at random from the set $\{1,2,3,\dots,10\}$. Define the events
[defs]
A = "$x$ is even"
[/defs]
and
[defs]
B = "$1 \leq x \leq 5$".
[/defs]
Which of the following is true?
]]>
</question>
<answer correct="false">The events $A$ and $B$ are independent.</answer>
<answer correct="true">The events $A$ and $B$ are not independent.</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
18 changes: 18 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f18.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<multiple-choice>
<question>
<![CDATA[
We choose an element $x$ uniformly at random from the set $\{1,2,3,\dots,10\}$. Define the events
[defs]
A = "$x$ is even"
[/defs]
and
[defs]
B = "$1 \leq x \leq 6$".
[/defs]
Which of the following is true?
]]>
</question>
<answer correct="true">The events $A$ and $B$ are independent.</answer>
<answer correct="false">The events $A$ and $B$ are not independent.</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
20 changes: 20 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f19.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<multiple-choice>
<question>
<![CDATA[
When a couple has a child, this child is a boy with probability 1/2 and a girl with probability
1/2, independent of the gender of previous children. A couple stops having children as soon as
they have a child that has the same gender as their first child. Define the events
[defs]
A = "the second child is a boy"
[/defs]
and
[defs]
B = "the couple has at least three children and the third child is a boy".
[/defs]
Which of the following is true?
]]>
</question>
<answer correct="true">The events $A$ and $B$ are independent.</answer>
<answer correct="false">The events $A$ and $B$ are not independent.</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
13 changes: 13 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f20.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<multiple-choice>
<question>
<![CDATA[
Assume you answer the first question in this exam by choosing one of the four answers uniformly at random.
You answer the second question by choosing, again uniformly at random, one of the three answers you did not choose in
the first question. What is the probability that you answer the second question correctly?
]]>
</question>
<answer correct="false">$\frac{1}{3}$</answer>
<answer correct="true">$\frac{1}{4}$</answer>
<answer correct="false">$\frac{1}{4} \cdot \frac{1}{3} + \frac{3}{4} \cdot \frac{1}{4}$</answer>
<answer correct="false">None of the above.</answer>
</multiple-choice>
14 changes: 14 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f21.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<multiple-choice>
<question>
<![CDATA[
I flip two fair and independent coins. If the first coin comes up tails, you lose \$1 (i.e., you win -\$1).
If the second coin comes up heads, you win \$2. (Thus, if the first coin comes up tails and the second coin
comes up heads, you win \$1.) Define the random variable $X$ to be the amount of dollars that you win.
What is the expected value of $X$?
]]>
</question>
<answer correct="false">2</answer>
<answer correct="false">1</answer>
<answer correct="false">1/4</answer>
<answer correct="true">1/2</answer>
</multiple-choice>
18 changes: 18 additions & 0 deletions app/src/data/questions/comp2804/exam-fall-2014/f14f22.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<multiple-choice>
<question>
<![CDATA[
I flip a fair coin, independently, 6 times, resulting in a sequence of heads ($H$) and tails ($T$).
For each (consecutive) $HTH$ in this sequence, you win \$5.
Define the random variable $X$ to be the amount of dollars that you win. For example, if the
sequence is
$$
THTHTH,
$$
then $X = 10$. What is the expected value of $X$?
]]>
</question>
<answer correct="false">2/5</answer>
<answer correct="false">2</answer>
<answer correct="true">5/2</answer>
<answer correct="false">5</answer>
</multiple-choice>
Loading

0 comments on commit 225ef34

Please sign in to comment.