The probability that the first sweet Hannah eats is orange is 6/n, as there are n sweets and 6 of them are orange. If this is indeed orange, then there are now n-1 sweets left in the bag, of which 5 are orange. Therefore, the probability that the second sweet is orange is 5/(n-1). Two find the probability that two events both happen, you multiply the two probabilities, so we do (6/n)*(5/(n-1))=30/(n(n-1))=30/n2-n. We're told in the question that the probability both sweets are orange is 1/3, so we know that 1/3=30/n2-n. Multipyling both sides by 3 gives: 1=90/n2-n, then multipyling both sides by n2-n gives n2-n=90. Finally, we subtract 90 from both sides to give n2-n-90=0