Obviously, one can go from city A to city B by any of the 4 routes, i.e., in 4 ways. After having gone to B by any of the different 4 routes, one can go to city C by any of the three routes.
Thus, corresponding to one route taken, from A to B, he has 3 choices from B to C. Therefore, corresponding to 4 routes, there are 12 choices in all.
Therefore, he can go from A to C via B, in 4 × 3 = 12 ways as depicted in the given tree diagram.
The possible routes taken are :
Total number of ways =12.
Thus, the examples discussed above illustrate the use of a general principle, called the product rule or the fundamental principle of counting, which is stated below.