In this experiment, the number of heads X is a binomial random variable:

The number of heads can range from 0 to 3, so the sample space for X is {0, 1, 2, 3}.
The associated probability of each outcome correspond to the binomial probability:

Then, we can calculate