We have:
n= total of sweets
6= orange sweets
(6-n)=yellow sweets (We use 6-n beacuse we know that if 6 sweets are orange, the rest must be yellow, so yellow sweets= (total of sweets-orange sweets))
If the probability of geting two orange aweets is 1/3, then:
(6/n) x (5/(n-1))= 1/3
Here, 6 over n is the probability of getting an orange sweet, we use Laplace´s Law: (number of favourable cases)/(number of total cases), that would mean: number of orange sweets/ total number of sweets. So if we have already eaten an orange sweet, there are 5 orange sweets left and the total number of sweets is n-1, that is why the second fraction is 5/(n-1)
Then we get:
30/(n^2-n)= 1/3
We try to isolate the n (as it is an equation):
n^2 - n= 30x3
n^2 - n= 90
Therefore;
n^2 - n - 90=0