Very Clear Explanation by Short Examples
Let's think in another way: \nIf we get N pigs and can test T times, what is the maximum number of buckets that we can successfully detect the poison among them
Let's think in another way: \n**If we get N pigs and can test T times, what is the maximum number of buckets that we can successfully detect the poison among them?**\n\n-----------\n\nHere we take T=1 (can only test once) and N=2 (2 pigs) as example:\n```\n    x -> not drink      o -> drink\n\nT=1  N=2:\n\n   buckets       1    2    3    4\n     pig 1       x    x    o    o\n     pig 2       x    o    x    o\n\n Result:   2 pigs and test 1 times -> 4 buckets\n```\n### Conclusion  T=1  N=n:\n#### n pigs and test 1 times can deal with how many buckets\n=  2^n    \n\n\n----------------\n\n\nWe take T=2 (can only test twice) and N=2 (2 pigs) as example:\n```\nT=2  N=2:\n\n   buckets       1    2    3    4    5    6    7    8    9  \n     pig 1       o    x    x    o    o    x    x    x    x    \n     pig 2       o    o    o    x    x    x    x    x    x\n                                                  \nResult:   2 pigs and test 2 times --> 9 buckets\n\nExplain:   \n  pig 1 & 2 died     ->  1 possible bucket\n  pig 1 died only    ->  2 possible buckets  -> 1 pig and 1 times can deal with 2 buckets(straight-forward)\n  pig 2 died only    ->  2 possible buckets  -> 1 pig and 1 times can deal with 2 buckets(straight-forward)\n  pig 1 & 2 survived ->  4 possible buckets  -> 2 pigs and 1 times can deal with 4 buckets(Previous case: T=1 N=2)\n```\n### Conclusion  T=2  N=n:\n#### n pigs and test 2 times can deal with how many buckets\n= C(n,n) * 2^0 + C(n,n-1) * 2^1 + ... + C(n,0) * 2^n \n= (1+2)^n \n= 3^n  \n\n**Explain:** \n#(all pigs died) + #(1 pigs survived) * can test 2 buckets(T=1 N=1)  + #(2 pigs survived) * can test 4 buckets(T=1 N=2) + ..... + #(n pigs survived) * can test 2^n buckets(T=1 N=n)\n\n ----------------\n\nNow, try to think about the case T=3 (can test 3 times) and N=n (n pigs)\n\n### Conclusion (T=3  N=n): \n#### n pigs and test 3 times can deal with how many buckets\n= C(n,n) * 3^0 + C(n,n-1) * 3^1 + ... + C(n,0) * 3^n \n= (1+3)^n \n= 4^n\n\n**Explain:** \n#(all pigs died) + #(1 pigs survived) * can test 3 buckets(T=2 N=1)  + #(2 pigs survived) * can test 9 buckets(T=2 N=2) + ..... + #(n pigs survived) * can test 3^n buckets(T=2 N=n)\n\n-----------------\n\n#### To sum it up, \nIf we get **N** pig and can test **T** times, the maximum number of buckets that we can successfully detect the poison among them is ----> **(1+T)^N**.\n\n\nTherefore, the answer to the question is:\n```\n MIN(n),   where (1+T)^n >= number of buckets    \n                   Note: T = minutesToTest/minutesToDie\n```
[]