i did not understand the permutation and combination approach quite well.Can anyone explain me?
Rat and Elephant Ways
@dare_devil_007
P&C solution is basically based upon two formula of P&C.
- If we want to arrange n distinct items, then no of ways = (n)!
- If we want to arrange n items among which m are identical, then no of ways = (n)!/(m)!
So here, we want to make overall (m-1) for moving down and (n-1) for moving right steps to reach the destination, but every down move or right move is identical among themself so just divide (m-1+n-1)! by (m-1)! and (n-1)!
why is it m-1 and n-1 while we are making m and n moves?
@dare_devil_007 suppose you are (0,0) and need to reach (2,2) so you need (2-0) steps right which is m-1 and (2-0) steps down which is n-1
where n and m are 3 but index are 0-based.
I hope it is clear now.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.