Evaluations

Evaluation: 2016 Fall Final

Author: Michiel Smid

1 . Consider a set A having size 7 and a set B having size 9. How many functions f:AB are there?
(a)
79
(b)
97
(c)
7!
(d)
9!

2 . Consider a set A having size 7 and a set B having size 9. How many one-to-one functions f:AB are there?
(a)
9!3
(b)
7!3
(c)
9!2
(d)
7!2

3 . How many bitstrings of length 55 start with 000 or end with 1010?
(a)
255248
(b)
None of the above.
(c)
251+252
(d)
251+252248

4 . What does 2n1n(n2) count?
(a)
The number of bitstrings of length n that have at least two 1's.
(b)
The number of subsets of a set of size n that have size at least two.
(c)
The number of bitstrings of length n that have at most two 1's.
(d)
The number of subsets of a set of size n that have size at least three.

5 . In a group of 100 students,
  • 25 drink cider,
  • 50 drink beer,
  • 33 do not drink cider and do not drink beer.
How many people in this group drink both cider and beer?
(a)
10
(b)
9
(c)
8
(d)
11

6 . Consider strings of characters, each character being a or b, that contain at least one occurrence of aa. Let Sn be the number of such strings having length n. Which of the following is true for n4?
(a)
Sn=Sn1+2Sn2
(b)
Sn=Sn1+Sn2+2n3
(c)
Sn=Sn1+Sn2+Sn3
(d)
Sn=Sn1+Sn2+2n2

7 . Consider strings of characters, each character being a or b, that contain exactly two a's and these two a's are not next to each other. Let Sn be the number of such strings having length n. Which of the following is true for n4?
(a)
Sn=(n2)
(b)
Sn=(n2)n1
(c)
Sn=(n2)n+1
(d)
Sn=(n2)n

8 . Consider the following recursive function:
  • f(0) = 1,
  • f(n) = 5nf(n1) for all integers n1.
Which of the following is true for all n0?
(a)
f(n)=5nn!
(b)
f(n)=5n+1n!
(c)
f(n)=5n!
(d)
f(n)=5n(n+1)!

9 . Consider the recursive algorithm HELLO, which takes as input an integer n0: If we run algorithm HELLO(7), how many times is the word "hello" printed?
(a)
6
(b)
4
(c)
5
(d)
7

10 . Consider strings of characters, each character being a, b, c, d, or e, in which no two consecutive characters are equal. Let Sn be the number of such strings having length n. Which of the following is true for n1?
(a)
Sn=5n5(n1)4n2
(b)
Sn=54n2
(c)
Sn=54n1
(d)
Sn=5n5(n1)4n1

11 . How many solutions are there to the equation x1+x2+x3+x4+x5=28, where x10, x20, x30, x40, and x50 are integers?
(a)
(334)
(b)
(335)
(c)
(324)
(d)
(325)

12 . You roll a fair red die and a fair blue die, independently of each other. Let r be the result of the red die and let b be the result of the blue die. Define the events
  • A = "r+b=6",
  • B = "b=4".
What is Pr(B|A)?
(a)
1/3
(b)
1/5
(c)
1/4
(d)
1/6

13 . Let V be a set consisting of 12 even integers and 8 odd integers. We choose a uniformly random subset W of V having size 7. Define the event
  • A = "exactly 4 of the elements of W are even".
What is Pr(A)?
(a)
(124)+(83)(207)
(b)
(124)(83)(207)
(c)
(204)(163)(207)
(d)
(203)(174)(207)

14 . We flip a fair coin three times; these flips are independent of each other. These three coin flips give us a sequence of length three, where each symbol is H or T. Define the events (recall that 0 is even):
  • A = "the number of H in the sequence is even",
  • B = "the sequence contains at least two consecutive H's".
Which of the following is true?
(a)
The events A and B are not independent.
(b)
The events A and B are independent.
(c)
None of the above.

15 . We flip a fair coin three times; these flips are independent of each other. These three coin flips give us a sequence of length three, where each symbol is H or T. Define the events
  • A = "the sequence contains at most one T",
  • B = "the symbols in the sequence are not all equal".
Which of the following is true?
(a)
The events A and B are independent.
(b)
None of the above.
(c)
The events A and B are not independent.

16 . Let n2 be the number of students who are writing this exam. Each of these students has a uniformly random birthday, which is independent of the birthdays of the other students. We ignore leap years; thus, the year has 365 days. Define the event
  • A = "at least two students have their birthday on December 14".
What is Pr(A)?
(a)
1(n2)(1365)2(364365)n2
(b)
(n2)(1365)2(364365)n2
(c)
1(364365)nn1365(364365)n1
(d)
k=2n(nk)(1365)k

17 . Let X={1,2,,100}. We choose a uniformly random subset Y of X having size 17. Define the event
  • A = "4Y or 7Y".
What is Pr(A)?
(a)
2(9916)(10017)
(b)
2(9916)(9815)(10017)
(c)
1(1002)(9815)(10017)
(d)
1(9815)(10017)

18 . Consider a uniformly random permutation of the set {1,2,,77}. Define the event
  • A = "in the permutation, both 8 and 4 are to the left of 3".
What is Pr(A)?
(a)
None of the above.
(b)
1/2
(c)
1/3
(d)
1/4

19 . Let n2 be an integer and let a1a2an be a uniformly random permutation of the set {1,2,,n}. Let X be the random variable with the value
  • X = the number of indices i with 1in1 and ai<ai+1.
For example, if n=6 and the permutation is 3, 5, 4, 1, 6, 2, then X=2.
What is the expected value E(X) of X?
Hint: Use indicator random variables.
(a)
n12
(b)
n2
(c)
n14
(d)
n4

20 . Let n2 be an integer and consider a group P1,P2,,Pn of n people. Each of these people has a uniformly random birthday, which is independent of the birthdays of the other people. We ignore leap years; thus, the year has 365 days.
Define the random variable X to be the number of unordered pairs {Pi,Pj} of people that have the same birthday.
What is the expected value E(X) of X?
Hint: Use indicator random variables.
(a)
(1365)2n2
(b)
1365n2
(c)
(1365)2(n2)
(d)
1365(n2)

21 . Consider a coin that comes up heads with probability 1/7 and comes up tails with probability 6/7. You flip this coin once. If it comes up heads, you win $5. If it comes up tails, you win $2.
What is the expected value E(X) of X?
(a)
7/17
(b)
17/7
(c)
7/2
(d)
32/7

22 . You flip a fair coin 7 times; these coin flips are independent of each other. Define the random variables
  • X = the number of heads in these 7 coin flips,
and
  • Y = the number of tails in these 7 coin flips.
Which of the following is true?
(a)
The random variables X and Y are not independent.
(b)
The random variables X and Y are independent.
(c)
None of the above.

23 . Consider the set S={1,2,3,...,10}. You choose a uniformly random element z in S. Define the random variables X={0 if z is even,1 if z is odd and Y={0 if z{1,2},1 if z{3,4,5,6},2 if z{7,8,9,10}. Which of the following is true?
(a)
The random variables X and Y are not independent.
(b)
The random variables X and Y are independent.
(c)
None of the above.

24 . You repeatedly and independently roll a fair die until the result of the roll is divisible by 3. Define the random variable X to be the number of times you roll the die. For example, if the results of the rolls are 4, 5, 1, 4, 3, then X=5.
What is the expected value E(X) of X?
(a)
4
(b)
5
(c)
3
(d)
2

25 . What is Elisa Kazan's favorite drink?
(a)
Poutine
(b)
Cider
(c)
Beer
(d)
Hot chocolate