# Probability theory question

1. Dec 22, 2014

### Astudious

1. The problem statement, all variables and given/known data
Alice attends a small college in which each class meets only once a week. She is
deciding between 30 non-overlapping classes. There are 6 classes to choose from
for each day of the week, Monday through Friday. Trusting in the benevolence
of randomness, Alice decides to register for 7 randomly selected classes out of
the 30, with all choices equally likely. What is the probability that she will have
classes every day, Monday through Friday?

2. Relevant equations
Seems like basic probability theory

3. The attempt at a solution
I'm confused here, because my thinking was that I should be able to say she can choose any course for the five days of the week (65 ways of doing this), and then any two of the remaining 25 courses (C(25,2) ways of doing this), so the total probability is 65*C(25,2) / C(30,7). But this is wrong (the answer is above 1).
I considered also that if, after she has picked one course on each day of the week (65), she can then pick another, she has 25 options, and then 24 more after that (since those are how many courses are available at each stage, and she can pick anything since she has fulfilled the every-day-class criterion). But this gives 65*25*24 / C(30,7) which is also wrong (above 1).

Why are these methods wrong?

2. Dec 22, 2014

### Ray Vickson

Since there are 5 slots and 6 chosen courses, the event E = {at least one course each day} must have one day with two courses and four days with one course each.

The first course is chosen at random. What is the probability that the second chosen course is on the same day as the first? What is the probability it is on a different day? What is the probability the third chosen course is on the same day as one of the first two (if possible)? What is the probability it is on a different day from the first two?

Keep going like that. The main issue is to keep track of the "overlaps".

I think the main problem with your method is that she does not choose "days", but courses. When she chooses a course, its day is pre-determined and so is not under her control.

3. Dec 22, 2014

### haruspex

For a start, you get to count the same selection more than once (hence the > 1 result). E.g. if the 5 one-per-day selections you start with are A, B, C, D, E, respectively and your last two are F and G, which happen to be on Wednesday and Thursday, you get the same set of 7 starting with A, B, F, G, E, then picking C and D.
Are you familiar with the principle of inclusion and exclusion? Consider how many ways there are of picking the 7 from a specific four days (or subset thereof).

4. Dec 23, 2014

### Astudious

I'm not sure I understand this. I do see the way of solving this problem by brainstorming, but not why the two methods in the OP are wrong?

It's similar, I feel, to the conundrum in this link: http://mathforum.org/library/drmath/view/62620.html. I would think the answer to the question there should be (2 * C(4,1) * C(51,4)) / C(52,5) - you pick an ace, out of the 4, and then any 4 cards (to total 5) out of the remainder (51), and there are two ways to arrange the two cards you have, so multiply by 2. What's wrong with the logic?

5. Dec 23, 2014

### haruspex

Dr Math's explanation of Matti's error at that link is wrong. Matti's error is the same as yours in this thread. As I posted above, you are counting some possibilities twice over.
In the poker hand example, Matti is counting hands with two Aces twice. E.g. suppose the hand is DA, CA, HK, HQ, HJ. Matti counts DA, plus the other four cards, then counts CA plus the other four cards. Hands with three Aces Matti counts three times, etc.

6. Dec 23, 2014

### Ray Vickson

First: sorry, my previous response was for choosing 6 courses, not 7. But my final objection stands: you need to choose courses, not days.

Let's look at the case of choosing 6 courses (which I will do now in another way); the case of choosing 7 course is a bit more involved, as it needs consideration of more cases, but I will leave that up to you to pursue.

So (for 6 courses) let p(i,j,k,l,m) = probability of choosing i courses on day 1, j courses on day 2, ..., m courses on day 5. You want
$$\text{answer} = p(2,1,1,1,1) + p(1,2,1,1,1)+p(1,1,2,1,1)+p(1,1,1,2,1) + p(1,1,1,1,2)$$
Now each of these terms is a simple (multi-class) hypergeometric probability: if we have $N$ items, $N_1$ of type 1, $N_2$ of type 2, ..., $N_r$ of type r, then the probability $p(k_1,k_2, \ldots, k_r)$ of choosing $k_1$ items of type 1, $k_2$ items of type 2, ..., $k_r$ items of type r in a sample of $n$ items selected without replacement (and with $k_1 + k_2 + \cdots + k_r = n$ is
$$p(k_1, k_2, \ldots, k_r) = \frac{C(N_1,k_1)\, C(N_2, k_2)\, \cdots \,C(N_r,k_r)}{C(N,n)}$$
Here, $N = N_1 + N_2 + \cdots + N_r$. See, eg., http://en.wikipedia.org/wiki/Hypergeometric_distribution (esp., last section) or
http://www.epixanalytics.com/modela...distributions/Multivariate_Hypergeometric.htm

So, we have $p(2,1,1,1,1) = C(6,2) C(6,1)^4/C(30,6) = 432/13195 \doteq 0.03274$. You can quite easily see that all the other terms in the answer are equal to the first one, so
$$\text{answer} = 5\, p(2,1,1,1,1) = C(5,1) \, p(2,1,1,1,1) = 432/2639 \doteq 0.16370$$

Can you see how to extend this to the case of choosing 7 courses?

BTW: you should always check your answers. Had you done so you would have seen that your first answer gave a value of $\text{ans. 1} = 432/377 \doteq 1.146$, while your second one was $\text{ans. 2} = 1512/377 \doteq 4.011$.

I think "haruspex" has already explained to you where your errors lie, so I am restricting myself to giving a positive answer (what to do), rather than a negative one (what you did wrong).

Last edited: Dec 23, 2014