Files
freeCodeCamp/guide/english/mathematics/rational-numbers/index.md
Alexander Molnar 2101c45386 Fixed error, cleaned up and added content (#34186)
Added more content, showing why the rationals are nice, and why they are interesting (and of use!) to study
2019-01-02 15:43:06 -05:00

3.6 KiB

title
title
Rational Numbers

Rational Numbers

A rational number is a real number that can be written as a fraction of two integers.

10/5 is a fraction, and is equal to 2. 8/3 is a fraction, and is equal to 2.66666.... Since the denominator of a fraction can be 1, every integer is a rational number. Note that as 2/1 = 4/2 = 6/3 = ..., each rational number can be represented by different fractions, but every rational number has a unique representation as an irreducible fraction.

The decimal representation of a rational number either terminates or is infinite with a pattern that repeats, e.g., 1/2 = 0.5 or 1/3 = 0.333.... Note that the decimal representation -- similar to a fractional representation -- is not necessarily unique, e.g., 0.999... = 1.

Not all real numbers are rational. A real number that is not rational is called irrational, such as sqrt(2), pi and e. While it is easy to see a real number is rational (either express it as a fraction of integers or compute the decimal representation until it repeats) it is usually a lot more difficult to show a number is not rational.

The rational numbers have many nice properties. For example,

  1. Addition of any two rational numbers a/b, c/d gives another rational number (ad + bc)/(bd);
  2. Multiplication of any two rational numbers a/b, c/d gives another rational number (ac)/(bd);
  3. Any rational number q has an additive inverse, -q;
  4. Any non-zero rational number q has a multiplicative inverse, 1/q;
  5. Between any two distinct rational numbers there exists another rational number (e.g., the mean of the two rationals).
  6. Between any two distinct rational numbers there exists an irrational number (e.g., for almost any pair of rationals, the square root of their product is irrational).
  7. Between any two distinct irrational numbers there exists a rational number (e.g., look at the decimal representations of both irrational numbers and pick a finite decimal between them).
  8. There are ''as many'' rational numbers as there are positive integers!

Properties 1-4 give way to the rational numbers being a particularly nice mathematical structure called a field. Properties 5-7 show that the rationals are a dense subset of the real numbers, making them quite useful for studying the set of all real numbers. Property 8 states the rational numbers are countable.

The study of algebraic structures over the rational numbers instead of the real numbers is a very rich area of investigation including Arithmetic Geometry, Arithmetic Dynamics, Cryptography, Galois Theory, Number Theory, and more. There are also multiple $1 million prizes for solving some of the deeper and most challenging problems involving the rational, so while they are well understood, there is still quite a lot unknown.