Ali Baba: Probability is one of the simplest disciplines in theory & one of the most difficult to deal with practice. Simple in principle due to the following.
Code:
P(EventA) = Number of ways EventA can occur divided by the total number of pertinent events.
For example what about dice probabilities?
Code:
P(Snake Eyes) = 1/36 or .027 777 778
P(Seven) = 6/36 or .16666667
Now for the question asked:
I disagree with your estimate of 4 * 10[sup]-25[/sup], but note my caveat at the end of this post.
First
: The question is a bit ambiguous. I will assume that students are assigned to classes randomly. I will also assume that you want the probability of both of you being in exactly 5 classes, rather than both being in 5 or more classes.
BTW: Terms like random & randomly are somewhat ambiguous.
There are C(200,20) ways 200 people can be assigned to a class of 20 people.
There are C(200,18) ways a class can include two specific people (Id est
: You & your friend).
For a specific class, P(Both) = C(200,18) / C(200,20)
P(Both) = [200! / 182!*18!] / [200! / 180!*20!]
P(Both) = 200!*180!*20! / 200!*182!*18!
P(Both) = 20*19 / 182*181
P(Both) = .011 535 426
Call this P
P(Not Both) = .988 464 574
Call this Q
Now consider expanding (P + Q)[sup]8[/sup], which represents the probabilities of both being in no class together to both being in all eight classes together.
The term of interest is the one with P[sup]5[/sup] * Q[sup]3[/sup]
This term has a coefficient of C(8,5) = 56
Hence the answer is 56 *.011 535 426[sup]5[/sup] *.988 464 574[sup]3[/sup] = .000 000 011
My HP50G calculates (P + Q)[sup]8[/sup] as.
Code:
0[b]:[/b] .911 357 711
1[b]:[/b] .085 084 684
2[b]:[/b] .003 475 297
3[b]:[/b] .000 081 114
4[b]:[/b] .000 001 188
5[b]:[/b] .000 000 011
Others: zilch
In the above, the integer specifies the number of classes in which both are present & the decimal fraction specifies the probablity of that event.
I trust my HP50G more than my memory of how to make up the correct calculations for the 50G & my ability to make neither keying errors nor typo’s