# Assignment #2: Probability / Scheduling

```University of Toronto at Scarborough
CSCA67—Discrete Mathematics for Computer Scientists, Fall 2014
Assignment #2: Probability / Scheduling
Due: November 4, 2014 at 11:59 p.m.
Warning: Your electronic submission on MarkUs affirms that this assignment is your own work and no
one else’s, and is in accordance with the University of Toronto Code of Behaviour on Academic Matters,
the Code of Student Conduct, and the guidelines for avoiding plagiarism in CSCA67.
This assignment is due by 11:59 p.m. November 4. If you haven’t finished by then, you may hand in your
assignment late with a penalty as specified in the course information sheet.
[10]
1. The Monty Hall Problem (MHP) was discussed in the Week 5 Tutorial. This classic problem involves
determining the probability of selecting a car hidden behind one of three doors, where the other two
doors each hide a goat. (If you missed the tutorial, click either of the previous links for a description
of the problem.) In this question, we investigate an extension of the MHP.
(a) Let’s play the game with four doors, three goats, and one car. After your initial selection, Monty
entices you by opening a second door which reveals a goat and then asks you if you want to
switch your initial choice with one of the remaining two unopened doors. Should you switch?
Justify your answer by calculating the probability of winning the car if (1) you do not switch,
and (2) you switch.
(b) Consider the same scenario as in (a), but this time Monty entices you by opening a second and
third door, each of which reveals a goat. Should you switch? Again, justify your answer by
calculating the probability of winning the car if (1) you do not switch, and (2) you switch.
(c) Generalize (a) for n doors, n − 1 goats, and one car. After your initial selection, Monty entices
you by opening a second door which reveals a goat. Is there a “threshold” value for n after
(d) Generalize (b) for n doors, n − 1 goats, and one car. After your initial selection, Monty entices
you by opening n − 2 additional doors, each of which reveals a goat. Is there a “threshold” value
for n after which you should or should not switch? Justify your answer.
[10]
2. Consider the Birthday Problem discussed in lecture and the Week 5 Tutorial. In this problem we
calculate the probability that, in a group of n people, at least two have the same birthday.
Let E be the event that at least two people share a birthday. In lecture we argued that it is much
more efficient to calculate P (E) as 1 − P (E), where E is the complement event that everyone has a
distinct birthday. We then gave the formula for computing P (E). However, we never actually showed
precisely why calculating P (E) directly is not efficient.
Page 1 of 2 pages.
See the Week 5 Tutorial notes for a hint on how to calculate P (E) directly.
(a) For n = 3, compute P (E) and show that it is indeed the same as 1 − P (E).
(b) Repeat for n = 4. Comment on the complexity of computing P (E) directly as n increases.
[10]
3. A triangular box contains five differently coloured balls: red (R), green (G), blue (B), white (W ),
and yellow (Y ).
(a) Define an appropriate sample space to study the outcome of an experiment where a selection of
three balls is made from the five differently coloured balls.
(b) In this experiment, and using your sample space in (a), what is the probability that: (1) the
selection includes Y , (2) the selection excludes Y , (3) the selection includes both B and G, and
(4) the selection includes either B or G.
[5]
4. Repeat #3 using selection. In other words, you must not directly refer to the sample space in #3 (a).
[15]
5. A developer has n properties that she wishes to renovate and then sell at a profit. The developer
only has enough construction workers to work on one property per month. Each of the n properties
would cost the same amount \$100K (\$100,000) to renovate if they were worked on today, however
with each passing month, the cost increases due to inflation and wage increases. Depending on the
type of renovation involved, this cost increase is different. The cost to renovate property i increases
by a factor of ci each month. This means that if the developer waits t months to renovate property i,
the cost will be \$100K·cti . You may assume that for any two properties i and j, ci 6= cj . This means
that the cost of each property grows at a different rate.
(a) Suppose that there are three properties, so one property will be renovated this month at a cost
of \$100K, one will be renovated one month later and the other two months later. If c1 = 1.2,
c2 = 1.1 and c3 = 1.3, show that renovating these three properties in different orders results in
different costs to the developer.
(b) Now suppose the developer has n properties to renovate. Give an algorithm that the developer
can use to minimize her total cost. Make sure you define useful notation so that you can easily
(c) Prove that your algorithm from (b) is optimal. Your argument must be a proof by contradiction.
[total: 50 marks]
Page 2 of 2 pages.
```