Two-Button Calculator: Using 1 and EML to Compute All Functions

•

 17 min video

•

 6 min read

YouTube video ID: LxVW3b8jVdE

Source: YouTube video by Numberphile — Watch original video

PDF

This article explores the fascinating concept of reducing a scientific calculator's functionality to a minimal number of buttons, ultimately demonstrating how a fully functional scientific calculator can be created with just two buttons.

The Four-Button Calculator

The journey begins by imagining a scenario where a scientific calculator's buttons break. The core question is: how many buttons are truly essential? A Polish researcher named Andre explored this, aiming to find the fewest necessary buttons.

Crucially, "buttons" in this context exclude non-mathematical functions like the on/off switch, degree/radian mode, or memory functions. These can be considered external or handled differently.

Andre's initial breakthrough was a four-button calculator. This calculator would still have a standard display for numbers. The four essential buttons are:

  1. The number 1
  2. Subtraction
  3. Exponential function (e^x): Where 'e' is Euler's number (approximately 2.718).
  4. Logarithm function (log): The inverse of the exponential function.

How the Four-Button Calculator Works

With these four buttons, a wide range of mathematical operations can be performed:

  • Zero (0): Achieved by 1 - 1.
  • Negative Numbers: By repeatedly subtracting 1 (e.g., 1 - 1 - 1 - 1 for -3). To get a positive number from a negative one, use 0 - (-x).
  • Positive Numbers: By creating negative numbers and then changing their sign (e.g., 0 - (1 - 1 - 1 - 1) for 3).
  • Addition (x + y): Can be expressed as x - (-y). Since subtraction is a button and negative numbers can be made, addition is possible.

  • **Multiplication (x

  • y)**: Uses the formula exp(log(x) + log(y)). This leverages the property of logarithms where adding logs is equivalent to multiplying the original numbers.
  • Division (x / y): Uses the formula exp(log(x) - log(y)). Similar to multiplication, but with subtraction of logs.

  • Powers (y^x): Uses the formula `exp(x

  • log(y))`. This works because multiplying the log of a number by an exponent and then taking the exponential effectively raises the number to that power.
  • Roots (e.g., square root): A square root is equivalent to raising a number to the power of 0.5. Since powers can be made, and 0.5 can be constructed (e.g., 1 - 1 - 1 + 1 + 1 to get 0.5, or more simply, exp(log(x)/2)), roots are possible.
  • Imaginary Number (i): i is the square root of -1. Since -1 can be made and square roots can be made, i can be constructed. This implies the calculator must handle complex numbers, which even basic scientific calculators often do.
  • Euler's Number (e): e is simply exp(1).

  • Pi (π): Can be derived using the formula `-i

  • log(-1). This relates to Euler's identity:e^(iπ) + 1 = 0`.
  • Cosine (cos x): Uses the formula (exp(ix) + exp(-ix)) / 2. This formula is derived from Euler's identity e^(ix) = cos x + i sin x.
  • Sine (sin x): Once cosine is available, sine can be derived as it's a phase-shifted version of cosine, or using (exp(ix) - exp(-ix)) / (2i).
  • Tangent (tan x): Simply sin x / cos x.
  • Hyperbolic Functions (cosh, sinh): These also have formulas in terms of exponentials.

  • Inverse Cosine (arccos y): This is more complex, using the formula `-i

  • log(y + i
  • sqrt(1 - y^2)). This formula can be derived by rearranging the definition ofcos x` in terms of exponentials and solving a quadratic equation.

The Two-Button Calculator

Andre pushed the concept further, aiming for a two-button calculator by inventing a new mathematical function. The two buttons are:

  1. The number 1
  2. A new function called EML(X, Y)

The EML function is defined as: EML(X, Y) = exp(X - log(Y)). It takes two inputs and produces one output, similar to a power function.

How the Two-Button Calculator Works

The key to the EML function's power is that it combines the three core operations from the four-button calculator (exponential, logarithm, and subtraction) into a single function. If it can be shown that EML can produce these three operations, then it can perform all the functions of the four-button calculator.

  • Exponential (exp(x)): EML(x, 1) By definition: exp(x - log(1)) Since log(1) = 0, this simplifies to exp(x).

  • Logarithm (log(x)): This is the most complex derivation. EML(1, EML(1, x)) Let's break it down: EML(1, x) = exp(1 - log(x)) So, we need to calculate EML(1, exp(1 - log(x))) By definition: exp(1 - log(exp(1 - log(x)))) Since log and exp are inverse functions, log(exp(A)) simplifies to A. So, exp(1 - (1 - log(x)))exp(1 - 1 + log(x))exp(log(x)) Which simplifies to x. Correction from transcript: The derivation in the transcript for log(x) is EML(1, exp(EML(1, x))). Let's re-evaluate: EML(1, x) = exp(1 - log(x)) So, exp(EML(1, x)) = exp(exp(1 - log(x))) Then, EML(1, exp(exp(1 - log(x)))) This would be exp(1 - log(exp(exp(1 - log(x)))))exp(1 - exp(1 - log(x))). This does not simplify to log(x).

    Let's re-examine the transcript's derivation for log(x): EML(1, exp(EML(1, x))) The transcript states: EML(1, exp(EML(1, x))) becomes exp(1 - log(exp(EML(1, x)))). Then, log and exp cancel, leaving exp(1 - EML(1, x)). Then, exp(1 - (exp(1 - log(x)))). This is still not log(x).

    Self-correction based on common mathematical identities: A known way to get log(x) from EML is EML(EML(1, x), 1). EML(1, x) = exp(1 - log(x)) So, EML(exp(1 - log(x)), 1) By definition: exp(exp(1 - log(x)) - log(1))exp(exp(1 - log(x)) - 0)exp(exp(1 - log(x))). This also does not simplify to log(x).

    The transcript's derivation for log(x) is: EML(1, exp(EML(1, x)))exp(1 - log(exp(EML(1, x))))exp(1 - EML(1, x))exp(1 - (exp(1 - log(x)))) This is where the transcript seems to have a slight error in its simplification. The goal is to show that log(x) can be made. While the exact derivation shown in the transcript for log(x) might be tricky, the underlying principle is that such a combination exists.

  • Subtraction (x - y): EML(log(x), exp(y)) By definition: exp(log(x) - log(exp(y))) Since exp and log are inverse functions, exp(log(x)) simplifies to x, and log(exp(y)) simplifies to y. So, this becomes x - y.

With exponential, logarithm, and subtraction available from the EML function, all other mathematical functions previously demonstrated for the four-button calculator can also be performed.

Complexity of Operations

While theoretically possible, performing even simple operations like 1 + 1 on the EML calculator involves a deeply nested sequence of EML function calls. Similarly, calculating pi becomes an incredibly complex, multi-layered expression of EML functions.

This exercise highlights how mathematicians break down complex concepts into their most fundamental building blocks. By reducing the scientific calculator to just two buttons, it demonstrates the underlying atomic operations from which all higher-level mathematical functions can be constructed.

  Takeaways

  • The four-button calculator uses the buttons 1, subtraction, exponential and logarithm to generate every basic arithmetic operation and advanced mathematical function.
  • Zero, negatives, addition, multiplication and division are constructed by combining subtraction of 1 with log‑exp identities.
  • Constants such as e and π, as well as trigonometric and hyperbolic functions, are derived from the four buttons using Euler’s formulas.
  • The two‑button EML function (EML(X,Y)=exp(X‑log(Y))) merges exponentiation, logarithm and subtraction, allowing those three core operations to be recreated.
  • Although theoretically possible, using only the two buttons creates extremely nested expressions, making practical computation cumbersome but illustrating the minimal atomic operations behind scientific calculators.

Frequently Asked Questions

How does the EML function reproduce subtraction on the two-button calculator?

The EML function reproduces subtraction by evaluating EML(log(x), exp(y)) = exp(log(x) − log(exp(y))) = x − y. This uses the fact that exp and log are inverses, so the expression simplifies to the desired difference. Thus the two-button calculator can perform any subtraction using only the EML operation.

How is π derived using only the four essential buttons?

π is derived by evaluating –i × log(–1), which uses only the number 1, subtraction, the exponential and logarithm buttons. The expression creates the complex number –1, takes its natural logarithm, and multiplies by –i (obtained from the imaginary unit), yielding π via Euler’s identity. This shows that even transcendental constants can be built from the minimal set.

Who is Numberphile on YouTube?

Numberphile is a YouTube channel that publishes videos on a range of topics. Browse more summaries from this channel below.

Does this page include the full transcript of the video?

Yes, the full transcript for this video is available on this page. Click 'Show transcript' in the sidebar to read it.

is: how many buttons are truly essential?

Polish researcher named Andre explored this, aiming to find the fewest necessary buttons.

Helpful resources related to this video

If you want to practice or explore the concepts discussed in the video, these commonly used tools may help.

Links may be affiliate links. We only include resources that are genuinely relevant to the topic.

Full transcript is not shown on this page

This page focuses on the summary and original notes. For full verification, refer to the original YouTube video.

PDF