Search⌘ K
AI Features

Solution: Poor Pigs

Explore how to determine the minimum number of pigs needed to find a poisonous bucket within given time constraints. Understand the problem's rounds and outcomes, learn to apply logarithmic calculations, and grasp how exponential growth in distinguishable outcomes helps solve the challenge efficiently.

Statement

You have buckets buckets of liquid, exactly one of which is poisonous. Your goal is to identify the poisonous bucket by feeding liquid to some number of pigs and observing whether they survive or die. You have a total of minutesToTest minutes to determine which bucket contains the poison.

The experiment proceeds in rounds according to the following rules:

  • Select any number ...