Sample space is the total number of possible outcomes. The general formula for this is r^n, where r is the number of outcomes per trial, while n is the number of trials.
For the first question, the equation would be 2² because 2 coins are tossed so n=2. Then, r=2 because there are two possible outcomes, namely, the head and the tail. So, the answer for letter a is 4.
For the second question, we will add to the answer in letter a with 2³, because this time, 3 coins are tossed. Thus, the total sample space is 4 + 2³ = 12.