Irrational Numbers: Definition, Examples, Proofs and Approximations

Updated 19 min read Beginner to intermediate Baca dalam Bahasa Indonesia

Numbers Proof Fundamentals Computing

Quick answer

An irrational number is a real number that cannot be written as a fraction of two integers; its decimal expansion is infinite and never periodic. The best-known examples are √2=1.41421…, π=3.14159… and e=2.71828…. A square root of a whole number is irrational unless the number is a perfect square, so √(16)=4 is rational and √(15) is not.

Key takeaways

  • A real number is either rational or irrational, never both; irrational means no integers p,q with q≠0 give \frac pq.
  • The k-th root of a positive integer is either an integer or irrational: it is an integer exactly when every exponent in the prime factorization is a multiple of k.
  • Rational plus irrational is irrational, and so is a non-zero rational times an irrational; the sum or product of two irrationals can be rational, as in √2·√2=2.
  • π and e are not only irrational but transcendental: they are not roots of any non-zero polynomial with integer coefficients, which is why a circle cannot be squared.
  • A number is irrational exactly when its continued fraction never stops; its convergents, such as (22)/(7) and (355)/(113) for π, approximate it ever better but never equal it.
  • Almost every real number is irrational, yet between any two rational numbers there is an irrational one, and between any two irrational numbers there is a rational one.

What is an irrational number?

An irrational number is a real number that is not rational: no two integers p and q≠0 make \frac pq equal to it. The real numbers split cleanly into the two families, as the article on real numbers explains, so a number is rational or irrational and never both.

Because every rational number has a decimal expansion that terminates or eventually repeats periodically, the same fact can be turned round: a real number is irrational exactly when its decimal expansion is infinite and never periodic. The digits go on for ever and no block of them ever repeats from some point on.

NumberValueWhy irrational
√21.41421356…2 is not a perfect square
√3, √5, √6, √71.7320…, 2.2360…, …not perfect squares
2^(1/3)1.25992…2 is not a perfect cube
π3.14159265…Lambert, 1761
e2.71828182…Euler, 1737
φ=(1+√5)/(2)1.61803398…√5 is irrational
\log_1020.30102999…no power of 2 is a power of 10

Three things are not irrational, although they are often mistaken for it. A root sign does not decide it: √(16)=4 and 27^(1/3)=3 are whole numbers. A long decimal does not decide it: \frac197 has a block of 96 repeating digits. And a decimal that goes on for ever is not enough: 0.333…=\frac13.

The word "irrational" comes from ratio, the same root as in rational numbers: an irrational number is one that is not a ratio of integers. It does not mean "unreasonable". Irrational numbers are exact, well-behaved numbers; it is only their decimal expansions that cannot be written down in full.

Try it: the decimal test

Which statement describes an irrational number?

  • Its decimal expansion terminates.
  • Its decimal expansion eventually repeats periodically.
  • Its decimal expansion is infinite and never periodic.
  • It is not a real number.

Why is √2 irrational?

√2 is irrational because assuming √2=\frac ab forces a number to have both an even and an odd count of factors of 2, which is impossible. It is the oldest proof by contradiction, and the version below uses the unique prime factorization of every integer.

Suppose √2=\frac ab with a and b positive integers. Squaring gives a^2=2b^2. Now count how many times the prime 2 divides each side. If 2 divides a exactly m times, then it divides a^2 exactly 2m times, an even number. If it divides b exactly n times, then it divides 2b^2 exactly 2n+1 times, an odd number. The two sides are the same integer, so they have the same factorization, and no number of factors of 2 is both even and odd. The assumption was false: no such a and b exist.

The more familiar version of the same proof, which cancels common factors until a and b are coprime and finds both even, is written out with an exercise in the real numbers article. The count of 2s is shorter, and it proves more:

  • Replace 2 by any integer n and the same argument works whenever some prime divides n an odd number of times. So √3, √5, √6, √(12) are all irrational.
  • Replace the square root by a k-th root and "even" by "a multiple of k": 2^(1/3) is irrational because 3 does not divide 1.

Geometry says the same thing. The diagonal of a unit square (see the diagonals of a square) has length √2 by the Pythagorean theorem, and the square's side and diagonal are incommensurable: no unit of length, however small, fits a whole number of times into both. The Pythagoreans, who held that everything is a ratio of whole numbers, met this fact in the fifth century BCE, and Plato's Theaetetus says Theodorus of Cyrene showed the irrationality of the roots of 3, 5 and so on up to 17. Tradition names Hippasus as the Pythagorean who revealed it, although the stories are late and not reliable. Euclid's Elements, Book X, classifies the irrational lengths that compass and straightedge can make.

Try it: count the factors of 2

Find the exponents e and f of 2.

How can you tell whether a root is irrational?

The k-th root of a positive integer is either a whole number or irrational, and it is a whole number exactly when every exponent in the prime factorization of the integer is a multiple of k. There is no third case: a root of an integer is never a fraction that is not a whole number.

To decide, factorize and look at the exponents:

RootFactorizationExponents divisible by k?Verdict
√(49)7^2yes7, rational
√(72)2^3·3^2no: 36√2, irrational
54^(1/3)2·3^3no: 132^(1/3), irrational
81^(1/4)3^4yes3, rational
√(1 000 000)2^6·5^6yes1000, rational

Taking out every complete group of k equal primes also simplifies the radical: √(72)=√(2^2·2·3^2)=2·3·√2=6√2. The way this is done step by step is in the section on simplifying radicals, and the number left under the root is what stays irrational.

Two facts help. A fraction of integers works the same way, since √(\frac pq)=(√ p)/(√ q), so √(\frac49)=\frac23 is rational but √(\frac12)=(√2)/(2) is not. And a root of a number that is not an integer can still be rational (for example √(\frac94)=\frac32), so the rule above is about integers.

Try your own numbers, including large ones. The tool factorizes up to a trillion and prints 30 decimals.

Interactive: is this root rational?

Type a whole number and a root index and see its prime factors, whether the root is a whole number or irrational, the simplified radical and 30 decimals.

Try it: which root is rational?

Which of these roots is rational?

  • √(12)
  • 16^(1/3)
  • 81^(1/4)
  • √(50)

What happens when you add or multiply irrational numbers?

A rational number plus an irrational number is irrational, and so is a non-zero rational times an irrational; but the sum, difference, product or quotient of two irrational numbers can be rational or irrational. The irrational numbers are therefore not closed under any of the four operations.

OperationResultExample
rational + irrationalalways irrational1+√2
non-zero rational × irrationalalways irrational\frac12√3
irrational + irrationaleither√2+√3 is irrational; √2+(-√2)=0
irrational × irrationaleither√2·√3=√6 is irrational; √2·√2=2
irrational ÷ irrationaleither(√6)/(√2)=√3 is irrational; (√8)/(√2)=2

Why rational plus irrational is irrational. Suppose r+x=s with r and s rational and x irrational. Then x=s-r is a difference of rational numbers, which is rational: a contradiction. The same argument with division proves the product rule, since x=\frac sr would be rational.

Two irrational numbers can combine into a rational one. The pair 1+√2 and 1-√2 are conjugates, and their product is rational because the roots cancel, as in the difference of squares: (1+√2)(1-√2)=1-2=-1. This is the idea behind rationalizing a denominator.

Exact arithmetic with a+b√ m. Numbers of the form a+b√ m, with a and b rational and √ m irrational, can be added, subtracted, multiplied and divided exactly and the answer is again of that form. The number is rational exactly when b=0. The tool below does this arithmetic with exact fractions; try the examples, then your own.

A simple example of a power of irrationals being rational is \left(√2^√2\right)^√2. If √2^√2 is rational we have an irrational power of an irrational that is rational; if it is irrational, raising it to √2 gives √2^2=2. Either way such a pair exists, although this argument does not say which case holds. In fact √2^√2 is irrational and even transcendental.

Interactive: add and multiply numbers with a square root

Combine two numbers of the form a + b√m exactly and see when the sum, product or quotient of irrational numbers turns out to be rational.

Try it: multiply conjugates

Evaluate the product.

What are π and e, and what does transcendental mean?

π and e are irrational and also transcendental, which means that neither is a root of any non-zero polynomial with integer coefficients. A number that is such a root is called algebraic. The number π is the ratio of the circumference of a circle to its diameter, as in the article on circles.

KindMeaningExamples
Rational\frac pq with integers; the root of qx-p=0\frac34, -7
Algebraic irrationalroot of an integer polynomial, but not rational√2 (of x^2-2), φ (of x^2-x-1), 1+√2 (of x^2-2x-1)
Transcendentalroot of no non-zero integer polynomialπ, e, Liouville's constant

Every rational number is algebraic, so the algebraic numbers contain the rationals and some irrationals; the transcendental numbers are all irrational. Sums, products and roots of algebraic numbers are algebraic again, which is why √2+√3 and √(1+√2) are algebraic.

The history, in order.

  • 1737: Euler proved that e is irrational (published 1744).
  • 1761: Lambert showed that π is irrational (published 1768).
  • 1844: Liouville gave the first numbers proved to be transcendental, such as 0.110001000000000000000001…, with a 1 in every place whose position is a factorial (1!,2!,3!,4!,…).
  • 1873: Hermite proved that e is transcendental.
  • 1874: Cantor showed that the algebraic numbers can be listed one after another, so almost every real number is transcendental.
  • 1882: Lindemann proved that π is transcendental.

Squaring the circle. The old problem asks for a square equal in area to a given circle using only compass and straightedge. Lengths that can be constructed are always algebraic. Lindemann's theorem makes π, and so √π, transcendental, and so the construction is impossible. The phrase "to square the circle" has meant "to attempt the impossible" ever since.

What is still not known. It is easy to prove that at least one of π+e and π e is irrational, but nobody knows which, or whether both are. Whether π+e is irrational at all is still an open question.

Try it: algebraic or transcendental?

Which of these numbers is algebraic?

  • π
  • e
  • 1+√2
  • π^2

How well can fractions approximate an irrational number?

Every irrational number can be approximated as closely as you like by fractions, and the best ones come from its continued fraction: x=a_0+(1)/(a_1+(1)/(a_2+…)). To build it, take the integer part a_0, invert what is left over, and repeat. A rational number gives a continued fraction that stops; an irrational number gives one that goes on for ever, which is another way to say that it is irrational.

The fractions you get by stopping early are the convergents (p_k)/(q_k), found by p_k=a_kp_k-1+p_k-2 and the same rule for q_k. For π=[3;7,15,1,292,…]:

kConvergentDecimalError
0\frac3131.4×10^-1
1(22)/(7)3.1428571.3×10^-3
2(333)/(106)3.1415098.3×10^-5
3(355)/(113)3.141592922.7×10^-7
4(103993)/(33102)3.141592653015.8×10^-10

(22)/(7) is the classroom approximation. (355)/(113) was found by Zu Chongzhi in the fifth century and is accurate to six decimals with a denominator of only three digits: the big partial quotient 292 that follows is why it is so good. For √2=[1;2,2,2,…] the convergents \frac32,\frac75,(17)/(12),(41)/(29) satisfy p^2-2q^2=±1. For e=[2;1,2,1,1,4,1,1,6,…] there is a pattern, and for π there is none that anyone knows.

The golden ratio is the hardest to approximate. φ=[1;1,1,1,…], and its convergents \frac11,\frac21,\frac32,\frac53,\frac85,(13)/(8),… are ratios of consecutive Fibonacci numbers. Every partial quotient is the smallest possible, so the fractions approach it more slowly than they approach any other number. It is the root of x^2-x-1=0, which the section on factoring shows has no whole-number factors.

Rational numbers cannot be reached. Dirichlet proved that for every irrational x there are infinitely many fractions with \left|x-\frac pq\right|<\frac1q^2. For a rational x there are only finitely many, so the error of a convergent is not just small: it is never zero. Choose a constant and the number of terms below.

Interactive: rational approximations of π, e, √2 and φ

Pick a constant and see the fractions from its continued fraction, such as 22/7 and 355/113 for π, with their decimals and errors.

Try it: the golden ratio

The convergents of φ run \frac11,\frac21,\frac32,\frac53,\frac85,(13)/(8). Find the next numerator.

Can the digits of an irrational number follow a pattern?

Yes: the digits of an irrational number can follow a pattern, as long as the pattern never becomes periodic. What matters is not whether you can see a pattern but whether a block of digits repeats from some point on.

  • 0.101001000100001…, with one more 0 each time, has an obvious pattern and is irrational: no block can repeat, because the runs of zeros keep getting longer.
  • Champernowne's number 0.123456789101112131415…, which writes the integers one after another, is irrational, and in 1933 Champernowne proved that every finite string of digits appears in it equally often.
  • Liouville's constant, with 1s at the factorial places, is irrational for the same reason as the first example.

The opposite also holds. A decimal with no visible pattern can be rational: \frac197=0.(010309278350515463917525773195876288659793814432989690721649484536082474226804123711340206185567 repeating) repeats only after 96 digits. Looking at a few hundred digits proves nothing in either direction. Irrationality is established by a proof about the number, never by its digits, which are only ever finitely many.

Normal numbers. A real number is normal in base 10 if every string of k digits appears with frequency 10^-k. Almost every real number is normal, but for the famous constants nobody has proved it: π, e and √2 look normal in the billions of digits computed, and that is all anyone can say. The digits can be produced on demand (the digits of pi have been computed to trillions of places), but there is no rule that predicts the millionth digit without computing the digits before it, at least none that is known.

For the repeating side of the story, see how fractions turn into decimals, and why \frac197 must repeat within 96 steps.

Try it: which are irrational?

Choose all the irrational numbers.

  • 0.2020020002… (one more 0 each time)
  • 0.(203 repeating)
  • 0.5
  • 0.123456789101112… (the integers in order)

How many irrational numbers are there?

There are far more irrational numbers than rational ones: the rationals can be listed one after another, the irrationals cannot, so almost every real number is irrational. Cantor proved in 1874 that the real numbers are uncountable, and since the rationals are countable, the rest, the irrationals, must be uncountable. If you could pick a real number at random, the probability that it is rational would be 0.

Yet the two kinds are tightly mixed. Between any two different real numbers there is both a rational and an irrational number, which is the density described in the article on the number line.

  • An irrational between two rationals a<b: the number a+(b-a)/(√2) lies between them, because \frac1√2≈0.707 is between 0 and 1, and it is irrational because it is a rational plus a non-zero rational times an irrational.
  • A rational between two irrationals x<y: choose n with 10^-n<y-x and cut y off after n decimals. The result is a terminating decimal, so it is rational, it is less than y by less than 10^-n, so it is greater than x, and it is not equal to y because y is irrational.

So there is no "next" irrational number after √2, and no "next" rational one either, even though the irrationals are by far the larger set. Pictures of the number line cannot show this: any dot you draw stands for a rational with a short decimal, and the irrational points are in between.

Try it: an irrational in between

Which of these lies between 1 and 2 and is irrational?

  • \frac32
  • √2
  • 1.41421356
  • √4

How do you work with irrational numbers in Python and JavaScript?

A computer cannot store an irrational number: a floating-point number (a float) is always a fraction whose denominator is a power of 2, so math.pi is only a rational approximation of π. What you can do is keep the number exact as a formula, compute as many digits as you need, or find a good fraction. The real numbers article explains the rounding behind this.

Python
>>> import math
>>> math.pi
3.141592653589793
>>> math.sqrt(2) ** 2                       # rounding, not a bug
2.0000000000000004
>>> math.pi.as_integer_ratio()              # a float is always a fraction
(884279719003555, 281474976710656)
>>> from fractions import Fraction
>>> Fraction(math.pi).limit_denominator(1000)   # a good fraction: 355/113
Fraction(355, 113)
>>> from decimal import Decimal, getcontext
>>> getcontext().prec = 50                  # 50 significant digits
>>> Decimal(2).sqrt()
Decimal('1.4142135623730950488016887242096980785696718753769')
>>> math.isqrt(2 * 10**40)                  # exact digits of the square root of 2
141421356237309504880
>>> import sympy                            # keep it exact as a formula
>>> sympy.sqrt(8)
2*sqrt(2)
>>> sympy.sqrt(2) ** 2
2
JavaScript
Math.PI                       // 3.141592653589793
Math.SQRT2                    // 1.4142135623730951
Math.sqrt(2) ** 2             // 2.0000000000000004
Math.sqrt(2) * Math.sqrt(8)   // 4.000000000000001, although the exact value is 4
Math.abs(Math.sqrt(2) ** 2 - 2) < 1e-12   // true: compare with a tolerance
C++
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

const double PI = acos(-1.0);

int main() {
  printf("%.15f\n", PI);                                  // 3.141592653589793
  printf("%.16f\n", sqrt(2) * sqrt(2));                   // rounding, not a bug
  printf("%.15f\n", sqrt(2) * sqrt(8));                   // 4.000000000000001, although the exact value is 4
  printf("%d\n", fabs(sqrt(2) * sqrt(2) - 2) < 1e-12);    // compare with a tolerance

  int bestP = 0, bestQ = 1;                               // the best fraction p/q for pi with q <= 1000
  for (int q = 1; q <= 1000; q++) {
    int p = (int)floor(PI * q + 0.5);
    if (fabs(PI - (double)p / q) < fabs(PI - (double)bestP / bestQ)) { bestP = p; bestQ = q; }
  }
  cout << bestP << "/" << bestQ << endl;                  // 355/113
  printf("%.10f %.10f\n", 22.0 / 7 - PI, (double)bestP / bestQ - PI);   // the errors of 22/7 and 355/113
  return 0;
}

/* output:
3.141592653589793
2.0000000000000004
4.000000000000001
1
355/113
0.0012644893 0.0000002668
*/

The pitfalls, in order of how often they bite:

PitfallWhat happensWhat to do
== on results of rootsMath.sqrt(2) ** 2 == 2 is falsecompare with a tolerance, math.isclose in Python
Believing the digits shownmath.pi stops after about 16 digitsuse decimal or a library for more
Testing irrationality numericallyevery float is rational, so a program can only guessprove it, or factor the integer under the root
22 / 7 as π3.142857… differs from π in the third decimaluse math.pi, or 355/113 if you need a fraction
sqrt of a perfect squaremath.sqrt(16) gives 4.0, a floatuse math.isqrt when you want a whole number
Mixing exact and float valuessympy.sqrt(2) * 1.0 turns exact into approximatekeep symbols exact until the end

Use Decimal or sympy for exactness, floats for speed, and never use a float to decide whether a number is irrational.

What are the common mistakes about irrational numbers?

The most common mistakes about irrational numbers are the nine below, each with the correct statement and a number that shows why.

MistakeCorrect
❌ π=(22)/(7)(22)/(7)=3.142857… is an approximation; π=3.14159… is not a fraction at all.
❌ π=3.143.14 is π rounded to two decimals, a rational number.
❌ Every square root is irrational√(16)=4 and √(\frac14)=\frac12 are rational.
❌ The sum of two irrationals is irrational√2+(-√2)=0.
❌ The product of two irrationals is irrational√2·√2=2.
❌ A decimal with no visible pattern is irrational\frac197 repeats only after 96 digits.
❌ A decimal with a visible pattern is rational0.101001000… has a pattern and is irrational.
❌ 0.(9 repeating) is irrational because it never ends0.(9 repeating)=1 exactly.
❌ The calculator shows π, so π terminatesA calculator shows the first 10 to 16 digits of a number whose digits never end.

Practice: test your understanding

These questions mix everything above. A wrong answer costs nothing here: read the hint and try again.

True or false?

Decide whether each statement is True or False.

  • √(16) is irrational.
  • √2+1 is irrational.
  • The product of two irrational numbers is always irrational.
  • 0.1010010001… (one more 0 each time) is irrational.
  • (22)/(7) is exactly equal to π.

Select all that apply

Choose all the irrational numbers.

  • √7
  • √(49)
  • 9^(1/3)
  • 0.(12 repeating)
  • √2·√8

A conjugate product

Evaluate the product.

Simplify a cube root

Find a.

The best fraction

Which fraction is closest to π?

  • (22)/(7)
  • (333)/(106)
  • (355)/(113)
  • \frac31

About π

Which statement about π is true?

  • π=(22)/(7).
  • The digits of π eventually repeat periodically.
  • π is transcendental.
  • π is a root of x^2-10=0.

Summary: irrational numbers at a glance

  • Definition: a real number that is not a fraction of integers; its decimal expansion is infinite and never periodic. Rational and irrational never overlap.
  • Roots: the k-th root of an integer is an integer or irrational; it is an integer exactly when every prime exponent is a multiple of k.
  • √2: a^2=2b^2 gives an even and an odd count of factors of 2.
  • Arithmetic: rational plus irrational is irrational; non-zero rational times irrational is irrational; two irrationals can give a rational, as in (1+√2)(1-√2)=-1.
  • π and e: irrational (Lambert, Euler) and transcendental (Lindemann, Hermite), so the circle cannot be squared.
  • Approximation: a continued fraction that never stops; (22)/(7) and (355)/(113) are convergents of π; φ is the hardest to approximate.
  • Digits: a pattern is fine if it never becomes periodic; a digit table can never prove irrationality.
  • Size: almost every real number is irrational, yet each interval contains both kinds.
  • Code: a float is always a fraction; keep roots exact with sympy or compute digits with Decimal.

Glossary: key terms

Irrational number
A real number that cannot be written as a fraction of two integers; its decimal expansion is infinite and never periodic.
Rational number
A number that can be written as a fraction of two integers with a non-zero denominator; its decimal expansion terminates or eventually repeats periodically.
Decimal expansion
The full list of digits of a number after the decimal point, however long.
Perfect square
A whole number that is the square of a whole number, such as 16 or 49; the square root of any other positive integer is irrational.
Proof by contradiction
A proof that assumes the opposite of the claim and derives something impossible, as in the proof that the square root of 2 is irrational.
Incommensurable
Two lengths with no common unit that fits a whole number of times into both, such as the side and the diagonal of a square.
Conjugate
For a plus b times the square root of m, the number a minus b times the square root of m; their product is rational.
Algebraic number
A number that is a root of a non-zero polynomial with integer coefficients, such as the square root of 2, which is a root of x squared minus 2.
Transcendental number
A real number that is not algebraic, such as pi and e; every transcendental number is irrational.
Continued fraction
An expression of a number as an integer plus one over an integer plus one over another integer, and so on; it stops exactly when the number is rational.
Convergent
A fraction obtained by stopping a continued fraction early, such as 22 over 7 and 355 over 113 for pi; it is the best approximation for its denominator size.
Golden ratio
The number 1 plus the square root of 5, all over 2, about 1.618, which is a root of x squared minus x minus 1 and the hardest number to approximate by fractions.
Normal number
A number in whose decimal expansion every string of k digits appears with frequency one in 10 to the power k.
Uncountable set
An infinite set whose members cannot be listed one after another, such as the real numbers and the irrational numbers.

Frequently asked questions

What is an irrational number?

An irrational number is a real number that cannot be written as a fraction of two integers. Its decimal expansion is infinite and never periodic, as in the square root of 2, pi and e. Every real number is either rational or irrational.

What are some examples of irrational numbers?

The square root of 2, the square root of 3, the cube root of 2, pi, e and the golden ratio are irrational. Square roots of whole numbers that are not perfect squares are always irrational, while the square root of 16 is 4, which is rational.

Why is the square root of 2 irrational?

If the square root of 2 equaled a over b, then a squared would equal 2 times b squared. The prime 2 would then divide the left side an even number of times and the right side an odd number of times, which is impossible for the same integer.

Is pi irrational?

Yes. Lambert proved in 1761 that pi is irrational, and Lindemann proved in 1882 that it is even transcendental. So pi is not equal to 22 over 7 or to 3.14, which are only approximations, and its digits never become periodic.

Is the square root of 16 irrational?

No. The square root of 16 is exactly 4, a whole number, so it is rational. A square root of a whole number is irrational only when the number is not a perfect square. Perfect squares such as 1, 4, 9, 16 and 25 have whole number roots.

Can the sum of two irrational numbers be rational?

Yes. The square root of 2 plus minus the square root of 2 is 0, and 1 plus the square root of 2 added to 1 minus the square root of 2 is 2. Both sums are rational. The product of two irrational numbers can be rational too.

Is a rational number plus an irrational number always irrational?

Yes. If a rational number r plus an irrational number x gave a rational number s, then x would equal s minus r, a difference of rationals, which is rational. That contradicts x being irrational, so the sum must be irrational.

How do you tell whether a root is irrational?

Factorize the whole number under the root into primes. The k-th root is a whole number exactly when every exponent is a multiple of k, and otherwise it is irrational. For 72, which is 2 cubed times 3 squared, the exponent 3 is odd, so the square root is irrational.

What is the difference between algebraic and transcendental numbers?

An algebraic number is a root of a non-zero polynomial with integer coefficients, such as the square root of 2, a root of x squared minus 2. A transcendental number is not a root of any such polynomial. Pi and e are transcendental, and so are almost all real numbers.

Why can the circle not be squared?

Squaring the circle needs a length of square root of pi using only compass and straightedge. Constructible lengths are always algebraic, but Lindemann proved in 1882 that pi is transcendental. So the construction is impossible, however cleverly you try.

Are all non-terminating decimals irrational?

No. A decimal that never terminates but eventually repeats periodically is rational, such as 0.333 and so on, which is one third. Only a decimal expansion that is infinite and never periodic is irrational. Even 0.999 and so on repeating is exactly 1.

How many irrational numbers are there?

Infinitely many, and far more than rational numbers. The rational numbers can be listed one after another, but Cantor proved in 1874 that the real numbers cannot, so the irrational numbers are uncountable and almost every real number is irrational.

How are irrational numbers stored in a computer?

They are not stored exactly. A floating-point number is always a fraction with a power of 2 as denominator, so a float such as math.pi is only a nearby rational number. For exact work use a symbolic library such as sympy, or compute as many digits as needed with decimal.

What is the golden ratio?

The golden ratio is 1 plus the square root of 5, all over 2, about 1.618. It is irrational, it solves x squared minus x minus 1 equals 0, and the ratios of consecutive Fibonacci numbers approach it, more slowly than they approach any other number.

References

  1. James Stewart, Lothar Redlin and Saleem Watson (2016). Precalculus: Mathematics for Calculus (7th ed.). Cengage Learning.
  2. Euclid. Elements, Book X (incommensurable magnitudes). c. 300 BCE.
  3. Ivan Niven (1956). Irrational Numbers (Carus Mathematical Monographs 11). Mathematical Association of America.
  4. G. H. Hardy and E. M. Wright (1938). An Introduction to the Theory of Numbers, chapter 4 (irrational numbers). Oxford University Press.
  5. Johann Heinrich Lambert (1768). Mémoire sur quelques propriétés remarquables des quantités transcendantes circulaires et logarithmiques. Mémoires de l’Académie royale des sciences de Berlin.
  6. Ferdinand Lindemann (1882). Über die Zahl π. Mathematische Annalen 20, 213–225.
  7. Georg Cantor (1874). Über eine Eigenschaft des Inbegriffes aller reellen algebraischen Zahlen. Journal für die reine und angewandte Mathematik 77, 258–262.
  8. Python Software Foundation. The Python Standard Library: math, mathematical functions. docs.python.org. https://docs.python.org/3/library/math.html.