Skip to content
The Chat Archive
gemini-2.5-flash· Google LMArena Human Preference 140K

which is the oldest algorithm in the world?

  1. User

    which is the oldest algorithm in the world?

  2. Assistant

    Pinpointing the single oldest algorithm is tricky, as the definition of "algorithm" can be quite broad (a set of well-defined steps to solve a problem). Many ancient cultures used step-by-step procedures for various tasks without necessarily calling them "algorithms."

    However, when we talk about mathematical algorithms recorded in writing, some of the oldest and most clearly identifiable ones come from:

    1. Babylonian Mathematics (circa 1800-1600 BCE):

      • Various clay tablets describe systematic procedures for solving mathematical problems, including:
        • Approximating square roots: The tablet YBC 7289 (around 1800-1600 BCE) clearly shows an iterative method to approximate the square root of 2. This is a very sophisticated algorithmic process.
        • Solving quadratic equations and systems of linear equations using prescribed steps.
      • These predated formal Greek mathematics by well over a thousand years.
    2. Egyptian Mathematics (circa 1650 BCE):

      • The Rhind Papyrus (around 1650 BCE, copied from an older text) contains procedures for multiplication, division, and working with fractions. These methods are systematic and step-by-step, thus algorithmic.

    While the Babylonian methods for things like square root approximation and solving equations are arguably the oldest known written mathematical algorithms that fit a modern definition of iterative or multi-step computation, the algorithm that is most famous and widely recognized as one of the oldest in a formalized, abstract sense is:

    • Euclid's Algorithm (circa 300 BCE):
      • Described in Euclid's Elements (Book VII and X).
      • It's a highly efficient method for computing the greatest common divisor (GCD) of two numbers.
      • Although it's not the absolute oldest, it's significant because it was presented in a very general and abstract way, making it a cornerstone of algorithmic thinking.

    In summary:

    • For pure antiquity and written record: Babylonian methods for solving equations and approximating roots are likely the oldest, dating back to around 1800-1600 BCE.
    • For formal, abstract presentation and enduring fame: Euclid's Algorithm (circa 300 BCE) is often cited as the oldest non-trivial algorithm still in common use today and taught in computer science.

    So, while Euclid's is the most famous and influential ancient algorithm, the Babylonian methods are demonstrably older.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.