Tests to reach the single defective gadget
A batch of gadgets contains exactly defective unit. They are tested one at a time in a uniformly random order until the defective one is found.
On average, how many tests does it take to reach the defective gadget (including that test)?
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
Where the first ace shows up in a shuffled deckDraws from a hat until the first winning ticketWhere the first spade appears in a shuffled deckDraws from a bag until the first red ballTaking turns to roll the first six
All questions →