MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply TodayA cat accidentally falls down a hole with sloping but rough sides. It can climb out of the hole of height h metres, but for every m metres it jumps, it falls back n metres where m is always bigger than n. It can only do one jump attempt per day and it is assumed that there is a small water source available to sustain it along the way.:) That said, how many days does it require to escape the hole?

NB: the cat must be clear of the hole or above it to escape so reaching exactly level with the hole opening it will still fall back down n metres.

HINT: once the cat is clear of the hole with its last jump it will not fall back into the hole.

EX: >> h = 20; m = 5; n = 3;

>> catdays(20,5,3)

ans = 9

40 correct solutions
41 incorrect solutions

Last solution submitted on Oct 09, 2014

2 players like this problem

4 Comments