From your problem, we can represent the number of hamsters, guinea pigs, and giant cloud rats with the letters H, G, and R respectively. Therefore, the following equations are true:
2H = 3G
3R = 2G
N = R + G + H
Now we can solve for R and H in the upper equations with respect to G and substitute them into the lower equation:
H = 3/2G
R = 2/3G
N = 2/3G + G + 3/2G
Simplifying gives:
N = 19/6G
Since N must be a whole number, G has to be a multiple of 6 for this equation to make sense. Therefore, we will use 6 for G to find that N=19.
Checking your work will indicate that there are 6 Guinea Pigs, 9 Hamsters, and 4 Giant Cloud Rats, and this is indeed the smallest combination of the three with all else being true.