It is important before proceeding with the question to note down a few key facts. As can be seen by the question there are 40 sweets in total. With probability questions in general it can be easy to remember that "AND" is represented with a multiplication sign ("") and that "OR" can be represented by an addition sign ("+"). With the question it also states that the sweets are NOT REPLACED as they are taken out. So the total number of sweets would be reduced after the first sweet is picked. If the two sweets were to be the same colour the only outcomes could be either all yellow OR all black. So the probability of them being all yellow is (30/40)(29/39)= 29/52 and the probability of them being all black is (10/40)*(9/39)=3/52 . Thus the probability of the sweets being the same colour is 32/52.