New Math Drill (Level2) : SNJ00-0806-L2 Moving on straight or circle road

There is a road such as in the figure below.



How many ways to go from A point to O point with obeying the following rules of advance are there?

(Rule 1) You may return to the intersection where you passed once, but you may not pass the road twice.

(Rule 2) You may not advance on the straight road towards the direction which you back away from O point.








Answer
729 ways

Solution
As shown in the figure below, three circles are assumed to be X circle, Y circle, and Z circle respectively. 




Firstly think about a way to go to Y from X. 

When using P road, there are one way of advancing without going along X. 


After going around, there are two ways of clockwise and counterclockwise to go through P.

Thus, there are three ways in total to use P road.

When Q road, R road, and S road are used, there are two ways respectively.

Thus, there are 3+2 × 3 = nine ways to go to Y from X.

There are also nine ways to go to Z from Y considering in the same way.
There are nine ways to go to O from Z as well. 



Therefore, there are 9 × 9 × 9 = 729 ways in total.