Originally Posted by
jcaron2
I would be interested.
OK, here is the method that I used:
Suppose there are n choir members, identified as A, B, C, …. and also n pieces of music identified as a, b, c, … The music sheets are shuffled into random order and then distributed to the members A, B, C, etc. The question is: when randomly distributing the music sheets what is the probability that at least one of the members gets their specific music sheet?
Let f(j,k) = the number or ways that j pieces of music can be distributed to j choir members with precisely k matches. For example (3,1) is the number of ways that 3 pieces of music can be distributed to 3 people with 1 match. The notation f(n,0) signifies the number of ways that n pieces of music can be distruibuted to n choir members with no matches ar all.
We start by considering f(n,0) for the first few values of n:
For n = I, f(1,0) = 0 because if there is only one choir member and one sheet of music he can't help but be given his own sheet.
For n=2, f(2,0) = 1 . The music can be distributed in only two possible ways: ab and ba. The first matches the choir members, the second does not.
For n=3, f(3,0) =2. There are 6 possible ways that the music can be distributed: abc, acb, bac, bca, cab, and cba. Two of these have no matches to the order of choir members. So f(3) = 2.
Now consider n = 4, and we will begin to generalize the method. First note that for n pieces of music there are n! Ways that the music can be distributed. Then consider that there are n+1 = 5 possible outcomes, which for n=4 are:
Case 1. Everybody gets matched to their music. There is precisely one sequence that accomplishes this, which for n =4 is: abcd. Hence f(4,4) = 1
Case 2. Three people get properly matched and one does not. This is an impossible outcome – you can't ever have just one person with a mismatch, since his own piece of music must have been given to someone else. Hence f(4,3) = 0.
Case 3. Two people are matched correctly, and two are not. The number of ways that the 2 people can be matched is C(4,2) = 4 x 3/2 = 6. For each of those possibilities the number of ways that the two mismatches can then be arranged is f(2,0) = 1; for example if A gets a and B gets b, then for C must get d and D must get c. So f(4,2) = 6 x 1 = 6.
Case 4. One person gets the right music and three do not. The number of ways this can occur is C(4,1) x f(3,0) = 4 x 2 = 8. Thus f(4,1) = 8.
Case 5. Zero people get the right music = f(4,0).
Now comes the trick. The sum of the above 5 possible outcomes must add up to 4! So:
4! = 1 + 0 + 6 + 8 + f(4,0), and hence:
f(4,0) = 4! – 1 – 0 – 6 – 8 = 9.
As check those 9 possibilities of no matches are: badc, bcda, bdac, cadb, cdab, cdba, dabc, dcab, dcba.
Thus we have calculated a value for f(4,0) using the oreviously determined values for f(2,0) and f(3,0). In this way we can build up a recursive technique for calculating f(n,0) based on the principle that for any value n>1:
n! = 1 + 0 + C(n,n-2)f(2,0) + C(n, n-3)f(3,0) + … + f(n,0) , or:
f(n,0) = n! – (1 + C(n,n-2)f(2,0) + C(n, n-3)f(3,0) + … + C(n,1)f(n-1,0))
The probability that there are no matches for a group of n is f(n,0) divided by n!:
P(no matches for population n) = f(n,0)/n! = 1 – (1+ (n,n-2)f(2,0) + C(n, n-3)f(3,0) + … + C(n,1)f(n-1,0))/n!
Finally, the probability that at least 1 choir member gets the correct music is 1 minus the above, or:
P(at least one match) = 1- P(no matches) = (1+ (n,n-2)f(2,0) + C(n, n-3)f(3,0) + … + C(n,1)f(n-1,0))/n!
I used Excel to build up a table for n = 1, 2, 3,. up to a value of n = 10, but beyond that the value is essentially equal to 1/e. Specifically I get:
N; P(at least one)
1; 1
2; 0.5
3; 0.6667
4; 0.625
5; 0.63333
6; 0.631944
7; 0.632143
8; 0.632118
9; 0.632121
10; 0.632121
For comparison, 1-1/e taken to 6 decimals is also 0.632121.
I hope this explanation is clear.