Math problem, Java AC code with brief explanations, 11/09/2016
This is a Math problem.\nThe table below shows how it works, n denotes the pig, and s is associated with each status of the pig. \nfor each pig, there is t+1 st
This is a Math problem.\nThe table below shows how it works, n denotes the pig, and s is associated with each status of the pig. \nfor each pig, there is t+1 status, which is death in 1st, 2nd, 3rd, 4th time slot and live eventually. \nTherefore the question is asking for how many pigs can denote 1000 in 5-nary number system.\n=======Table=======\nn1 n2 n3 n4 n5 \ns1  1   0   0   1   0\ns2  0   0   0   0   1   \ns3  0   1   0   0   0\ns4  0   0   0   0   0\ns5  0   0   1   0   0\n\nIn this case, the number is 13012 in 5-nary number system. \n* Here is my Java AC code\n```\npublic int poorPigs(int buckets, int minutesToDie, int minutesToTest) {\n        int status = minutesToTest/minutesToDie + 1;\n        int num_of_pig = 0;\n        while(Math.pow(status, num_of_pig) < buckets) {num_of_pig++;}\n        return num_of_pig;\n    }\n```
[]