The problem can be directly solved by information theory.

The information required for finding that bucket = -log2(1/1000)=9.97 big

The information of x pigs in one drink = x bit and the pigs can drink four times in one hour. x= ceil(-log2(1/1000) / 4) = 3