Elementary events associated to random experiment of tossing three coins are
HHH, HHT, HTH, THH, HTT, THT, TTH, TTT
∴ total number of elementary events = 8.
The event "Getting all heads" is said to occur, if the elementary event HHH occurs i.e. HHH is an outcome.
∴ Favourable number of elementary events = 1
Hence, required probability = 18