Exercise · Volume 1 · 1.2.10-9
Exercise 1.2.10-9
not stated yet in Lean solution written
| Rating | M25 |
|---|---|
| Markers | M (mathematical) |
| Kind | K3, find a value: compute a number, a set or a closed form from the written solution |
| Section | Section 1.2.10 of Volume 1. Companion chapter: Analysis of an algorithm |
The task
Find the probability that exactly distinct values occur among keys taken at random from values, with Stirling numbers.
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Choose the values that occur, then count the surjections from the positions onto them with Section 1.2.6.
Hint 2
Or find a recurrence in .
Solution
Show the solution
Let be the probability. A list with exactly distinct values determines the set of its values, in ways. For a fixed set of values the lists that use all of them are the partitions of the positions into nonempty classes, of them, times the assignments of the values to the classes. So the number of lists is , and
A check by a recurrence: the th key is either new or old. So . Insert the formula and use : the right side is , as required.
Check
For and the values for are , which add to . A brute-force count of all lists gives the same.
Remarks
For the formula reduces to Exercise 1.2.10-8. See also the counting of occupancy problems in Section 1.2.6.
This solution is drafted, and a person has not reviewed it yet. The source.
In Lean
not stated yet The exercise is not stated in Lean yet.
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.