Counting Paths using combinations and permutations

combinationscombinatoricspermutations

Suppose I am given a grid of 2×2 , with A as starting point and B as the destination. We are allowed to move either vertically up by 1 step or towards right by 1 step. Through visual inspection, it is easy to find 6 ways to reach from A to B

enter image description here

But I am facing a difficulty in doing it by Permutations/Combinations

My thought:

I figured out that we need two right turns (R1 , R2) and two up steps (U1, U2)
where R1 = first right turn , R2 = second right turn
U1 = first up movement , U2 = second up movement

Now each possible way will have some combination of these steps, I am not sure how to go forward from here

After referring to the solution it mentioned the ways to be 4!/(2! * 2!) OR 4c2 * 2c2

so I started making cases for 4c2 * 2c2

  1. R1 R2 U1 U2
  2. R1 U1 R2 U2
  3. R1 U2 R2 U1
  4. R2 U1 R1 U2
  5. R2 U2 R1 U1
  6. U1 U2 R1 R2

So aren't cases 2,3,4,5 same thing only ? and how will the case 3 for example be possible R1 U2 , how can we get U2 before than U1 ?

Best Answer

We need to take a total of 2 vertically up steps and 2 steps towards right (i.e., we have 2 different types of steps), that we can take in any order: we can do it in $\dfrac{(2+2)!}{2!2!}=6$ ways.

Generalizing, let's denote a single up step by a red object and right step by a blue object. Then number of ways to construct a path of total m+n length which contains m up and n right steps is exactly same as number of ways to sort / permute m red and n blue objects, which is $\dfrac{(m+n)!}{m!n!}$. Here, we have $m=n=2$.