An operation consists of two steps, of which the first can be made in n1 ways. If the first step is made in the ith way, the second step can be made in n2i ways.
(a) Use a tree diagram to find a formula for the total number of ways in which the total operation can be made.
(b) A student can study 0, 1, 2, or 3 hours for a history test on any given day. Use the formula obtained in part (a) to verify that there are 13 ways in which the student can study at most 4 hours for the test on two consecutive days.