Placing n numbered balls in n numbered cells

In summary, the conversation is about trying to find the probability of obtaining exactly k matches when randomly placing n balls in n cells without any cell receiving more than one ball. The total number of configurations is n! and the number of ways to obtain k matches is given by the formula (1/k!)\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}. This can also be represented in terms of derangements, which is a permutation where none of the elements appear in their original position. However, it is not necessary to use derangements to solve the problem and a combinatorial reasoning can also be used.
  • #1
Karlx
75
0
Hi everybody.
I keep on reading Rohatgi's book "An introduction to Probability and Statistics".
Just now I am working in the following problem:
We have n cells numbered 1 to n and n balls numbered 1 to n.
We place at random the n balls in the n cells, with no cell receiving more than one ball.
I'm trying to find the probability to obtain exactly k matches, k=0,1,2,...,n.

Clearly, P(exactly n matches) = 1/n! and P(exactly (n-1) matches) = 0.
But I'm not able to find a general expression for P(exactly k matches).

Could anybody give me a hint.
Thanks.
 
Physics news on Phys.org
  • #2
Hint: the (n-k) non-matches form a Derangement.
 
  • #3
hint:
how many total configurations do you have?
how many configurations satisfy your claim?
 
  • #4
Thanks bpet and outlined.

I have n! total configurations.
I don't know how to calculate how many of them satisfy the condition of "exactly k matches".

Bpet, what is a derangement ?
OK, I found out what is a derangement. Good hint. I will work it out. Thanks.
 
Last edited:
  • #5
The probability you seek is the number of ways to have exactly k matches, divided by the total number of ways to distribute the balls. The latter is clearly n! To find the former, start by finding the number of ways that k slots, specified in advance (e.g. the slots numbered 1-k), can have matching balls while the other ones don't. Then...I probably shouldn't give you more information than that.
 
  • #6
it will be (nCk)/n!
 
  • #7
A derangement is a permutation of the elements of a set such that none of the elements appear in their original position.
For a set of n elements, the number of possible derangements is

[tex]
!n = n! \sum_{i=0}^n \frac{(-1)^i}{i!}
[/tex]

where !n is called the subfactorial of n.

With this information, is not difficult to see that the probability to obtain exactly k matches is
[tex]
P(k)= (\stackrel{n}{k})\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}
[/tex]

Just a remark: There is no need of knowing about derangements to solve the problem. It is possible (I did it) to solve it only using a combinatorial reasoning. Then, the derangements arise as an "intermediate result", not in the form of !n written above, but in a recursive expression.

Thanks for your help.
 
Last edited:
  • #8
Krish@physics said:
it will be (nCk)/n!

I doubt this is correct
 
  • #9
yes it is
 
  • #10
Karlx said:
A derangement is a permutation of the elements of a set such that none of the elements appear in their original position.
For a set of n elements, the number of possible derangements is

[tex]
!n = n! \sum_{i=0}^n \frac{(-1)^i}{i!}
[/tex]

where !n is called the subfactorial of n.

With this information, is not difficult to see that the probability to obtain exactly k matches is
[tex]
P(k)= (\stackrel{n}{k})\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}
[/tex]

Just a remark: There is no need of knowing about derangements to solve the problem. It is possible (I did it) to solve it only using a combinatorial reasoning. Then, the derangements arise as an "intermediate result", not in the form of !n written above, but in a recursive expression.

Thanks for your help.


Sorry, there was a mistake in the expression for P(k).
The correct form is

[tex]
P(k)= (1/k!)\sum_{i=0}^{n-k}\frac{(-1)^i}{i!}
[/tex]
 

Similar threads

Back
Top