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]
 

Related to Placing n numbered balls in n numbered cells

1. How many ways can n numbered balls be placed in n numbered cells?

There are n! (n factorial) ways to place n numbered balls in n numbered cells. This can be calculated by multiplying all the numbers from 1 to n together.

2. Can a numbered ball be placed in more than one cell?

No, each numbered ball can only be placed in one cell. This is known as the "one-to-one" principle.

3. Does the order of placement matter?

Yes, the order of placement does matter. For example, placing ball 1 in cell 1 and then ball 2 in cell 2 is considered a different arrangement than placing ball 2 in cell 1 and then ball 1 in cell 2.

4. What happens if there are more balls than cells?

If there are more balls than cells, then not all of the balls can be placed in a cell. This is known as the "pigeonhole principle".

5. Is there a limit to the number of balls and cells that can be used?

No, there is no limit to the number of balls and cells that can be used. However, as the numbers get larger, the number of possible arrangements increases significantly.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
0
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
Replies
0
Views
512
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
904
  • Precalculus Mathematics Homework Help
Replies
10
Views
1K
Back
Top