Counting directions

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.


The answer is 400.

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.

1 solution

Eric Roberts
Mar 1, 2021

In order to arrive at point P P after 6 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 N,S,E,W represent the number of steps taken in directions North, South, East and West respectively:

\quad

N S = 0 Eq1 E W = 0 Eq2 N + S + E + W = 6 Eq3 \begin{aligned} N-S &= 0 \quad \text{Eq1} \\ \quad \quad \\ E-W &= 0 \quad \quad \text{Eq2} \\ \quad \quad \\ N + S + E + W &= 6 \quad \quad \text{Eq3} \\ \end{aligned}

\Rightarrow

N = S Eq1’ E = W Eq2’ Sub Eq1’ & Eq2’ Eq3 N + E = 3 Eq3’ \begin{aligned} N &= S \quad \quad \text{Eq1'} \\ \quad \\ E &= W \quad \quad \text{Eq2'} \\ \quad \\ & \quad \quad \text{Sub Eq1' \&} \, \text{Eq2'} \to \text{Eq3} \\ \quad \\ N + E &= 3 \quad \quad \text{Eq3'} \\ \end{aligned}

We need to find solutions to Eq3’ N \text{Eq3'} \in \mathbf{N}

\quad

There are 4 4 solutions:

\quad

N S E W 0 0 3 3 3 3 0 0 1 1 2 2 2 2 1 1 \begin{array}{c}&N \quad &S \quad &E \quad &W \\ &0 \quad &0 \quad &3 \quad &3 \\ &3 \quad &3 \quad &0 \quad &0 \\ &1 \quad &1 \quad &2 \quad &2 \\ &2 \quad &2 \quad &1 \quad &1 \end{array}

\quad

\quad

The number of paths N s ( N , S , E , W ) N_s( N,S,E,W ) are counted by arranging the number of steps for each a solution as a string of 6 6 letters. Examples of such a sequence of steps might be:

\quad

N , E , W , W , E , S N,E,W,W,E,S or S , S , E , N , N , W S,S,E,N,N,W etc...

\quad

The results of the possible orderings for the solution set are as follows:

N s ( 0 , 0 , 3 , 3 ) = ( 6 3 ) 3 E’s in 6 places ( 3 3 ) 3 W’s in 3 places = 20 N s ( 3 , 3 , 0 , 0 ) = ( 6 3 ) 3 N’s in 6 places ( 3 3 ) 3 S’s in 3 places = 20 N s ( 1 , 1 , 2 , 2 ) = ( 6 1 ) 1 N in 6 places ( 5 1 ) 1 S in 5 places ( 4 2 ) 2E’s in 4 places ( 2 2 ) 2 W’s in 2 places = 180 N s ( 2 , 2 , 1 , 1 ) = ( 6 2 ) 2 N’s in 6 places ( 4 2 ) 2 S’s in 4 places ( 2 1 ) 1 E in 2 places ( 1 1 ) 1 W in 1 place = 180 \begin{aligned} N_s ( 0,0,3,3) & = \overbrace{ { 6 \choose 3} }^{ \scriptsize \begin{array}{c}\text{3 E's} \\ \text{in} \\ \text{6 places} \end{array}} \cdot \overbrace{ { 3 \choose 3} }^{ \scriptsize \begin{array}{c}\text{3 W's} \\ \text{in} \\ \text{3 places} \end{array}} = 20 \\ \quad \\ N_s ( 3,3,0,0) &= \overbrace{ { 6 \choose 3} }^{ \scriptsize \begin{array}{c}\text{3 N's} \\ \text{in} \\ \text{6 places} \end{array}} \cdot \overbrace{ { 3 \choose 3} }^{ \scriptsize \begin{array}{c}\text{3 S's} \\ \text{in} \\ \text{3 places} \end{array}} = 20 \\ \quad \\ N_s ( 1,1,2,2) & = \overbrace{ { 6 \choose 1} }^{ \scriptsize \begin{array}{c}\text{1 N} \\ \text{in} \\ \text{6 places} \end{array} } \cdot \overbrace{ { 5 \choose 1} }^{\scriptsize \begin{array}{c}\text{ 1 S} \\ \text{in} \\ \text{5 places} \end{array} } \cdot \overbrace{ { 4 \choose 2} }^{ \scriptsize \begin{array}{c}\text{2E's} \\ \text{in} \\ \text{4 places} \end{array}} \cdot \overbrace{ { 2 \choose 2} }^{\scriptsize \begin{array}{c}\text{2 W's} \\ \text{in} \\ \text{2 places} \end{array}} = 180 \\ \quad \\ N_s ( 2,2,1,1) & = \overbrace{ { 6 \choose 2} }^{ \scriptsize \begin{array}{c}\text{2 N's} \\ \text{in} \\ \text{6 places} \end{array} } \cdot \overbrace{ { 4 \choose 2} }^{\scriptsize \begin{array}{c}\text{2 S's} \\ \text{in} \\ \text{4 places} \end{array} } \cdot \overbrace{ { 2 \choose 1} }^{ \scriptsize \begin{array}{c}\text{1 E} \\ \text{in} \\ \text{2 places} \end{array}} \cdot \overbrace{ { 1 \choose 1} }^{\scriptsize \begin{array}{c}\text{1 W} \\ \text{in} \\ \text{1 place} \end{array}} = 180 \end{aligned}

The number of paths from P P back to P P in exactly 6 6 steps is then:

2 ( 20 + 180 ) = 400 2 \cdot ( 20 + 180 ) = 400

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...