Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 1277. How many days does the cat take to climb out of the hole?

Created by Bruce Raine

A 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

Problem Group

Solution Statistics

36 correct solutions 34 incorrect solutions
Last solution submitted on Apr 21, 2014

Problem Comments