Math New Drill : SNJ00-0806-L2 Number of directions turning three times

There is a road as shown in the figure below. 
Travels the shortest distance from A to B. 
How many ways of turning at a corner 3 times are there?



Answer
18 ways

Solution
There are two cases traveling in order of ① length - cross - length - cross like Fig.1 and ② cross - length - cross - length like Fig.2.



① Going through twice in total four streets in lengthwise direction.
There are three ways of three streets and one, two streets and two, one street and three.
There are three ways in crosswise direction as well.
There are 3 × 3 = nine ways.

As for ②, there are also nine ways in the same manner.

There are 9 + 9 = 18 ways in total.