There are 5 floating stones on a river. A man wants to cross the river. He can move either 1 or 2 steps at a time. Find the number of ways in which he can cross the river?
Explanation: The man needs to take 6 steps to cross the river. He can do this in the following ways:
- Crossing the river by 6 unit steps = 1 way.
- Crossing the river by 4 unit steps and 1 double step = 5C1 = 5C4 = 5 ways.
- Crossing the river by 2 unit steps and 2 double steps = 4C2 = 6 ways.
- Crossing the river by 3 double steps = 1 way.
Hence, the required number of ways = 1 + 5 + 6 + 1 = 13.
Quiz of this Question
Please comment below if you find anything wrong in the above post
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.