PINs generated until the first duplicate
A generator produces random -digit PINs, each uniform over codes, independently, one after another. It stops the moment it produces a PIN it has already produced.
On average, how many PINs does it generate before the first duplicate?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion Β· reading is open to everyone
π‘ Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussionβ¦
Learn the concepts
The theory behind this question.
Related questions
How many draws until a card repeats?Rolls of a hundred-sided die until a repeatPeople entering until two share a birthdayExpected number of shared-birthday pairsWhy twenty-three people give even odds
All questions β