-3

I am aware of this question.

Question:

A ladder has n steps. One can climb the ladder using any combination of steps of 1 or steps of 2. How many possible ways are there for one to climb the ladder?

However, how will this number change if some of the stairs are broken?

PS: This is not homework.

beaker
  • 16,331
  • 3
  • 32
  • 49
Ashwani K
  • 7,880
  • 19
  • 63
  • 102
  • If 2 steps next to each other are broken, the solution is obviously 0. Otherwise, use the original solution and add a check to the solution of the original question (if 1 of the steps is broken, you can only step over it using +2). – atlaste Jul 05 '17 at 13:27

2 Answers2

1

I believe this constraint simplifies the problem.

If there are two or more consecutive broken steps, the answer is zero.

If there is a broken step, then the climber must land on the step previous to it. So without loss of generality you can remove that step and the one previous to it from the puzzle.

Then you perform the calculation on the, in general, shorter ladder as per the linked question.

(Alternatively view the broken step / one before it as subdividing the problem into separate ladders. Perform the calculation for each one separately and multiply the results.)

Bathsheba
  • 231,907
  • 34
  • 361
  • 483
0

If the number of steps is large, then it should be insignificant if some steps are broken.