Exercise · Volume 1 · 1.2.10-10
Exercise 1.2.10-10
not stated yet in Lean solution written
| Rating | M20 |
|---|---|
| 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 when each key is chosen at random from values.
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
Condition on the number of distinct values.
Hint 2
Use Exercises 1.2.10-7 and 1.2.10-9.
Solution
Show the solution
Let be the number of distinct values among the . By Exercise 1.2.10-9, . By Exercise 1.2.10-7, given the distribution of is . (Given and the pattern of equal keys, the relative order of the distinct values is uniformly random, so the conditional law does not depend on which values appear.) So
because . The sum runs over .
Check
For and the formula gives , , and . A brute-force count over all lists agrees. The values add to .
Remarks
The mean of for this model has no simple closed form. It can be computed as .
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.