A person X standing at a point P on a flat plane starts walking. At each step, he walks exactly 1 foot in one of the directions North, South, East or West. Suppose that after 6 steps X comes to the original position P. Then the number of distinct paths that X can take is.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
In order to arrive at point P after 6 steps, the net movement in any direction North, South and East, West must be zero. We can derive the following system of equations:
Let N , S , E , W represent the number of steps taken in directions North, South, East and West respectively:
N − S E − W N + S + E + W = 0 Eq1 = 0 Eq2 = 6 Eq3
⇒
N E N + E = S Eq1’ = W Eq2’ Sub Eq1’ & Eq2’ → Eq3 = 3 Eq3’
We need to find solutions to Eq3’ ∈ N
There are 4 solutions:
N 0 3 1 2 S 0 3 1 2 E 3 0 2 1 W 3 0 2 1
The number of paths N s ( N , S , E , W ) are counted by arranging the number of steps for each a solution as a string of 6 letters. Examples of such a sequence of steps might be:
N , E , W , W , E , S or S , S , E , N , N , W etc...
The results of the possible orderings for the solution set are as follows:
N s ( 0 , 0 , 3 , 3 ) N s ( 3 , 3 , 0 , 0 ) N s ( 1 , 1 , 2 , 2 ) N s ( 2 , 2 , 1 , 1 ) = ( 3 6 ) 3 E’s in 6 places ⋅ ( 3 3 ) 3 W’s in 3 places = 2 0 = ( 3 6 ) 3 N’s in 6 places ⋅ ( 3 3 ) 3 S’s in 3 places = 2 0 = ( 1 6 ) 1 N in 6 places ⋅ ( 1 5 ) 1 S in 5 places ⋅ ( 2 4 ) 2E’s in 4 places ⋅ ( 2 2 ) 2 W’s in 2 places = 1 8 0 = ( 2 6 ) 2 N’s in 6 places ⋅ ( 2 4 ) 2 S’s in 4 places ⋅ ( 1 2 ) 1 E in 2 places ⋅ ( 1 1 ) 1 W in 1 place = 1 8 0
The number of paths from P back to P in exactly 6 steps is then:
2 ⋅ ( 2 0 + 1 8 0 ) = 4 0 0