There is a chance of you picking out a green candy. Since there are a <em>total </em>of 8 candies, your denominator is 8. Out of 8, there are 3 green candies.
And out of 160 candies, you have an unknown amount of green candies that you need to find. (x)