I believe that the run code is incorrect for 4, 1, 2 (buckets, minutes to die, minutes to test respectively) and perhaps others as well.

Suppose that we are trying to find the bucket containing poison out of four with two "attempts". Obviously we will have to check at least three of the four buckets to determine which one has poison, so for at least one "attempt" we will have to check two buckets at once with the single pig. However, if the pig dies we have no way to figure out which bucket actually contained poison and which contained water.

I think the answer should be the smallest n such that pow(2,n)>(buckets-1)/(minutesToTest/minutesToDie).

In the case listed above the answer would be 2.

Am I missing anything?