# Finding the number of ways of crossing a river

There are $X$ stones in the river.The stones are placed in such a way that a person can jump from one stone to the next one, or skip one and jump to the one after that. Find the number of ways in which one can jump across the stones from one river bank to another.

Note: We are always standing at the farther stone from the bank

For example:

• If there is one stone, we can jump directly to the bank of the river i.e. only 1 way.
• If there are 2 stones, we can jump from 1st to 2nd and then 2nd to bank or we can jump from 1st to bank skipping one stone(as mentioned in the question).
• Similarly for 3 stones no. of ways are 3.
• Similarly for 5 stones no. of ways are 8.

Is there any general technique to calculate the number of ways of crossing the river with $X$ stones?

If you number the stones starting at the target bank: From $stone_{n}$ you can initially jump to either $stone_{n-1}$ or $stone_{n-2}$. This makes the number of ways from $stone_{n}$ to the target bank equal to $stone_{n-1} + stone_{n-2}$.