There is a train with 'N' cabins, a monkey is present in one of the cabins initially (which is unknown). Your goal is to catch the monkey, given you can open a cabin every minute and monkey would jump to either the immediate left or right cabin in that time. What is the strategy you use to catch the monkey surely?
N=1 => Trivial case
N=2,3 =>
Open the first cabin twice in case of N=2 and middle cabin twice when N=3. We can surely catch him in at most 2 trials.
First non-trivial case is when N=4 where monkey can just move between any two cabins and hence opening any cabin repeatedly doesn't guarantee that we can catch him, is it possible to find a strategy that works for all N?