Skip to content

Retrospective of Frog and the Stairs

The frog and the stairs is largely based on the Frobenius coin1 or the classically known Chicken Nugget Theorem.

Example Walkthrough

Example: Let's say the staircase has \( N = 11 \) steps, and the frog can jump either \( k = 3 \) steps or \( m = 5 \) steps at a time. Can the frog reach exactly 11 steps?

Solution Approach:

  1. Find if 11 can be expressed as a non-negative integer combination of 3 and 5: We need to determine if there exist non-negative integers \( a \) and \( b \) such that:
\[ 11 = a \cdot 3 + b \cdot 5 \]
  1. Check combinations: We can test different values of \( a \) and solve for \( b \):
    • For \( a = 0 \), \( 11 = 0 \cdot 3 + b \cdot 5 \)\( 11 = b \cdot 5 \)\( b = \frac{11}{5} \) (not an integer)
    • For \( a = 1 \), \( 11 = 1 \cdot 3 + b \cdot 5 \)\( 11 - 3 = b \cdot 5 \)\( 8 = b \cdot 5 \)\( b = \frac{8}{5} \) (not an integer)
    • For \( a = 2 \), \( 11 = 2 \cdot 3 + b \cdot 5 \)\( 11 - 6 = b \cdot 5 \)\( 5 = b \cdot 5 \)\( b = 1 \) (an integer)

We find a solution with \( a = 2 \) and \( b = 1 \):

\[ 11 = 2 \cdot 3 + 1 \cdot 5 \]

So, the frog can reach exactly 11 steps using 2 jumps of 3 steps and 1 jump of 5 steps.

Verification: To verify, we check:

\[ 2 \cdot 3 + 1 \cdot 5 = 6 + 5 = 11 \]

Thus, the frog can indeed reach exactly 11 steps.

Application of Number Theory

The frog and the stairs puzzle is a classic example of a problem in number theory and combinatorial mathematics. It involves understanding the principles of linear combinations and the greatest common divisor (GCD). Here's a detailed discourse on the topic:

Problem Definition

In the frog and the stairs puzzle, you are given:

  • A staircase with \( N \) steps.
  • A frog that can jump either \( k \) steps or \( m \) steps at a time.

The goal is to determine whether the frog can reach exactly \( N \) steps using any combination of \( k \) and \( m \) jumps.

Mathematical Formulation

The problem can be expressed as finding non-negative integers \( a \) and \( b \) such that:

\[ N = a \cdot k + b \cdot m \]

where \( a \) and \( b \) represent the number of jumps of \( k \) and \( m \) steps, respectively.

Number Theory Background

  1. Linear Combinations: The equation \( N = a \cdot k + b \cdot m \) is a linear Diophantine equation in two variables. The solutions to this equation involve finding integer values of \( a \) and \( b \) that satisfy it.

  2. Greatest Common Divisor (GCD): A key insight is that a solution exists if and only if the GCD of \( k \) and \( m \) divides \( N \). In other words, the equation \( N = a \cdot k + b \cdot m \) has non-negative integer solutions if and only if:

\[ \text{GCD}(k, m) \mid N \]

This is derived from the theory of linear Diophantine equations, which states that the GCD of \( k \) and \( m \) is the smallest positive integer that can be expressed as a linear combination of \( k \) and \( m \).

Frobenius Number: For two relatively prime integers \( k \) and \( m \), the largest number that cannot be expressed as \( a \cdot k + b \cdot m \) (with \( a \) and \( b \) being non-negative integers) is given by \( k \cdot m - k - m \). This is known as the Frobenius number. If \( k \) and \( m \) are not relatively prime, the concept is generalized but the exact number of non-representable values becomes more complex.

Example

Consider \( N = 11 \), \( k = 3 \), and \( m = 5 \):

  1. Check GCD:
\[ \text{GCD}(3, 5) = 1 \]

Since 1 divides 11, a solution is possible.

  1. Find Solution: We look for non-negative integer solutions to:
\[ 11 = a \cdot 3 + b \cdot 5 \]

Testing values, we find:

\[ 11 = 2 \cdot 3 + 1 \cdot 5 \]

Thus, \( a = 2 \) and \( b = 1 \) is a solution.

General Approach

  1. Verify GCD Condition: First, check if \( \text{GCD}(k, m) \) divides \( N \). If it doesn’t, there’s no solution.

  2. Find Non-negative Solutions: Use methods such as the Extended Euclidean Algorithm to find specific values for \( a \) and \( b \) if the GCD condition is met.

Applications and Variations

  • Generalization: The problem can be generalized to more than two step sizes or different kinds of constraints, but the fundamental approach remains similar.
  • Practical Applications: This type of problem has practical implications in scheduling, resource allocation, and various optimization problems where divisible resources or steps are involved.

The frog and the stairs puzzle not only illustrates fundamental concepts in number theory but also serves as a model for more complex combinatorial and optimization problems.


  1. "Coin problem," Wikipedia, https://en.wikipedia.org/wiki/Coin_problem. Circa 16 Sept. 2024.