A rational number is a number that can be expressed as a fraction where
and
are integers and
. A rational number
is said to have numerator
and denominator
. A real number
that is not rational is called an irrational number.
The real line consists of the union
of the rational and irrational numbers. The
set of rational numbers is of measure zero on the
real line, so it is "small" compared to the
irrationals and the continuum.
The set of all rational numbers is referred to as the "rationals," and forms a field that is denoted . Here, the symbol
derives from the German word Quotient, which can be
translated as "ratio," and first appeared in Bourbaki's Algèbre
(reprinted as Bourbaki 1998, p. 671).
Any rational number is trivially also an algebraic number.
Examples of rational numbers include , 0, 1, 1/2, 22/7, 12345/67, and so on. Farey
sequences provide a way of systematically enumerating all rational numbers.
The set of rational numbers is denoted Rationals in the Wolfram Language, and a number
can be tested to see if it is rational
using the command Element[x, Rationals].
The elementary algebraic operations for combining rational numbers are exactly the same as for combining fractions.
It is always possible to find another rational number between any two distinct rational numbers. The rational numbers form a dense set in the real line, while also being a countable set.
For ,
, and
any different rational numbers, then
is the square of the rational number
(Honsberger 1991).
If a reduced fraction is chosen with equal probability
from those with
,
then the probability that its denominator
is even tends to 1/3 as
(Salamin and Gosper 1972). This specifies a limiting
sampling procedure; there is no uniform distribution
on all rational numbers.
It is conjectured that if there exists a real number for which both
and
are integers, then
is rational. This result would follow from the four
exponentials conjecture (Finch 2003).