Evaluations

Evaluation: 2018 Winter Midterm

Author: Michiel Smid

1 . Consider strings consisting of 12 characters, where each character is an element of the set $\{a,b,c,d,e\}$. The positions in such strings are numbered as $1,2,3,\dots,12$.
How many such strings have the property that
  • each even position contains an element of $\{a,b,c\}$, and
  • each odd position contains an element of $\{d,e\}$?
(a)
$6^3 \cdot 6^2$
(b)
$5^{12}$
(c)
$6^6$
(d)
None of the above.

2 . Consider strings consisting of 12 characters, where each character is an element of the set $\{a,b,c,d,e\}$. The positions in such strings are numbered as $1,2,3,\dots,12$.
How many such strings have the property that
  • each even position contains an element of $\{a, b, c\}$, or
  • each odd position contains an element of $\{d,e\}$?
(a)
$6^{3} \cdot 6^{5} + 6^{2} \cdot 6^{5}$
(b)
$3^{6} \cdot 5^{6} + 2^{5} \cdot 5^{6} - 2^{6} \cdot 3^{6}$
(c)
$3^{6} \cdot 5^{6} + 2^{6} \cdot 5^{6}$
(d)
$6^{3} \cdot 6^{5} + 6^{2} \cdot 6^{5} - 6^{2} \cdot 6^{3}$

3 . Consider strings consisting of 12 characters, where each character is an element of the set $\{a,b,c,d,e\}$. The positions in such strings are numbered as $1,2,3,\dots,12$.
How many such strings contain at least two $a$'s?
(a)
$5^{12} - 4^{12} - 12 \cdot 4^{11}$
(b)
$12^{5} - 12^{4} - 12 \cdot 12^{4}$
(c)
$5^{12} - 4^{12} - 12 \cdot 4^{12}$
(d)
$12^{5} - 12^{4} - 12 \cdot 11^{4}$

4 . Let $b \geq 1$ and $c \geq 1$ be integers. Elisa Kazan's neighborhood pub serves $b$ different types of beer and $c$ different types of cider. Elisa invites 6 friends to this pub and orders 7 drinks, one drink (beer or cider) for each friend, and one cider for herself. Different people may get the same type of beer or cider.
In how many ways can Elisa place these orders, such that exactly 4 people get a beer?
(a)
${6 \choose 4} \cdot b^{4} \cdot c^{3}$
(b)
${7 \choose 4} \cdot b^{4} \cdot c^{3}$
(c)
None of the above.
(d)
${6 \choose 4} \cdot b^{4} \cdot c^{2}$

5 . In a group of 100 people,
  • 60 do not like Donald Trump and do not like Kim Jong Un, and
  • 25 like Kim Jong Un.
How many people in this group like Donald Trump and do not like Kim Jong Un?
(a)
25
(b)
20
(c)
10
(d)
15

6 . In the city of ShortLastName, every person has a last name consisting of one uppercase letter, followed by two lowercase letters. No two letters in a last name can be equal. Thus, Lin is a valid last name, whereas Xax is not a valid last name.
What is the minimum size of the population of ShortLastName, such that there must be at least two people who have the same last name?
(a)
$1 + 24 \cdot 25 \cdot 26$
(b)
$1 + 26!$
(c)
$1 + \frac{24 \cdot 25 \cdot 26}{3!}$
(d)
$1 + 26^{3}$

7 . Let $n \geq 2$ be an even integer. What does $$ \sum_{k=0}^{\left. (n-2) \middle/ 2 \right.} {{n}\choose{2k+1}} $$ count?
(a)
The number of bitstrings of length $n$ having an odd number of 0's.
(b)
The number of bitstrings of length $n$.
(c)
The number of bitstrings of length $n$ in which the number of 0's plus the number of 1's is at most $\left. (n-1) \middle/ 2 \right.$.
(d)
The number of bitstrings of length $\left. (n-2) \middle/ 2 \right.$.

8 . Let $m \geq 34$ be an even integer, let $n \geq 1$ be an integer, and consider the two sets $$ A = \{1,2,\dots,m\} $$ and $$ B = \{m+1,m+2,\dots,m+n\}. $$ Let $k$ be an integer with $17 \leq k \leq n+17$.
Consider subsets $X$ of $A \cup B$, such that $|X| = k, |X \cap A| = 17$, and all elements of $X \cap A$ are even.
How many such subsets $X$ are there?
(a)
${m/2 \choose 17} \cdot {n \choose k-17}$
(b)
${m+n \choose 17} \cdot {n \choose k-17}$
(c)
${m \choose 17} \cdot {n \choose k-17}$
(d)
${m/2+n \choose 17} \cdot {n \choose k-17}$

9 . Consider the equation $$ x_1 + x_2 + x_3 + x_4 = 33, $$ where $x_1 \geq 0$, $x_2 \geq 0$, $x_3 \geq 0$, $x_4 \geq 0$ are integers. How many solutions does this equation have?
(a)
${36 \choose 3}$
(b)
${37 \choose 4}$
(c)
${37 \choose 3}$
(d)
${36 \choose 4}$

10 . As you all know, Nick has been dreaming to be like Spiderman. Spiderman can climb up the outside of a building; if he is at a particular floor, then, in one step, Spiderman can move up several floors.
Since having finished marking assignment 2, Nick has been working hard to improve his Spiderman-skills: In one step, Nick can move up either two floors or three floors. (Nick lost his ability to move up one floor in one step.)
Let $n \geq 2$ be an integer and consider a building with $n$ floors, numbered $1,2,\dots,n$. (The first floor has number 1; this is not the ground floor.) Nick is standing in front of this building, at the ground level.
Let $N_n$ be the number of different ways in which Nick can climb to the $n$-th floor. Which of the following is true for any $n \geq 5$?
(a)
$N_n = N_{n-1} + N_{n-2}$
(b)
$N_n = N_{n-2} + N_{n-3}$
(c)
$N_n = N_{n-1} + N_{n-2} + N_{n-3}$
(d)
$N_n = N_{n-1} + N_{n-3}$

11 . 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 55 that have 0 at position 9, and 1 at position 40? (The positions are numbered $1,2,\dots,55$.)
(a)
$f_9 \cdot f_{31} \cdot f_{17}$
(b)
$f_8 \cdot f_{30} \cdot f_{16}$
(c)
$f_{10} \cdot f_{32} \cdot f_{18}$
(d)
$f_7 \cdot f_{29} \cdot f_{15}$

12 . The functions $f: \mathbb{N} \rightarrow \mathbb{N}$ and $g: \mathbb{N} \rightarrow \mathbb{N}$ are recursively defined as follows: $$ \begin{alignat}{2} f(0) &= 0, \\ f(n) &= 2 + f(n - 1)\ \; &\mathrm{if}\ n \geq 1, \\ g(0) &= 1, \\ g(n) &= 7 \cdot g(n - 1)\ \; &\mathrm{if}\ n \geq 1. \end{alignat} $$ For any integer $n \geq 0$, what is $g(f(n))$?
(a)
$7^{n}$
(b)
$(2n)^{7}$
(c)
$n^{7}$
(d)
$7^{2n}$

13 . Consider strings of characters, where each character is an element of the set $\{a,b,c\}$. Such a string is called ccc-free, if it does not contain ccc.
For any integer $n \geq 4$, let $B_n$ be the number of ccc-free bitstrings of length $n$. Which of the following is true?
(a)
$B_n = 2 \cdot B_{n-1} + 2 \cdot B_{n-2} + 2 \cdot B_{n-3}$
(b)
$B_n = B_{n-1} + B_{n-2} + 2 \cdot B_{n-3}$
(c)
$B_n = 2 \cdot B_{n-1} + 2 \cdot B_{n-2} + B_{n-3}$
(d)
$B_n = B_{n-1} + B_{n-2} + B_{n-3}$

14 . Consider the recursive algorithm $\IFeelLikeSinging$, which takes as input an integer $n \geq 0$:

$\mathbf{Algorithm}\ \IFeelLikeSinging(n)\mathrm{:}$
$\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
$\mathbf{then}\ \mathrm{sing}\ {\it O\ Canada}$
$\mathbf{else}\ \mathbf{if}\ n\ \text{is odd}$
$\elsesp \mathbf{then}\ \IFeelLikeSinging(n + 1)$
$\elsesp \mathbf{else}\ \IFeelLikeSinging(\frac{n}{2});$
$\elsesp \elsesp \IFeelLikeSinging(\frac{n}{2} - 1)$
$\elsesp \mathbf{endif};$
$\mathbf{endif}$

If you run algorithm $\IFeelLikeSinging(9)$, how many times do you sing O Canada?
(a)
9
(b)
8
(c)
6
(d)
7

15 . You are given a fair die and roll it 12 times. Define the event
  • A = "there are exactly two 6's in the sequence of 12 rolls".
What is $\Pr(A)$?
(a)
${12 \choose 2} \cdot \left. 5^{12} \middle/ 6^{12} \right.$
(b)
${12 \choose 2} \cdot \left. 5^{10} \middle/ 6^{12} \right.$
(c)
$12^{2} \cdot \left. 5^{10} \middle/ 6^{12} \right.$
(d)
$12^{2} \cdot \left. 5^{12} \middle/ 6^{12} \right.$

16 . In the fall term of 2015, Nick took COMP 2804. Nick was always sitting in the back of the classroom and spent most of his time eating bananas.
Nick buys 25 bananas at Alexa's Banana Emporium (ABE) and 30 bananas at Shelly's Fruit Market (SFM). Nick chooses, uniformly at random, a 15-element subset of these bananas. Define the event
  • A = "the subset chosen by Nick contains exactly 7 bananas from ABE".
What is $\Pr(A)$?
(a)
$\frac{{25 \choose 8} \cdot {30 \choose 7}}{55 \choose 15}$
(b)
$\frac{{25 \choose 7} \cdot {30 \choose 8}}{55 \choose 15}$
(c)
$\frac{{25 \choose 7} + {30 \choose 8}}{55 \choose 15}$
(d)
$\frac{{25 \choose 8} + {30 \choose 7}}{55 \choose 15}$