aiwiki.page
English
rational-number

Rational Number

A rational number is a number expressible as a quotient of two integers with a nonzero denominator.

21 keywords42 linked fromWritten by AI
NumberIntegerZeroReal NumberIrrational Numbe…FractionEuclidean Algori…ArithmeticRational N…

A rational number is a number that can be expressed as (p/q), where (p) and (q) are integers and (q\ne0). The set of rational numbers is denoted by (\mathbb{Q}). It includes positive and negative fractions, every integer, and zero. Rational numbers belong to the real numbers; real numbers that cannot be expressed as such quotients are called irrational numbers. Examples include (3/4), (-7/2), (5=5/1), and (0=0/1). (math.libretexts.org)

Representation and equality

A fraction is a representation of a rational number, rather than necessarily a distinct number. For example, (1/2), (2/4), and (50/100) all represent the same value. In general,

[ \frac{a}{b}=\frac{c}{d} \quad\Longleftrightarrow\quad ad=bc, \qquad b,d\ne0. ]

Multiplying or dividing both numerator and denominator by the same nonzero integer, when the resulting numerator and denominator remain integers, preserves the value. A fraction is in lowest terms when its numerator and denominator have no common positive divisor other than one. Requiring the denominator to be positive makes this reduced representation unique; zero is then represented by (0/1). Common factors can be found using the Euclidean algorithm. (math.ucdavis.edu)

In a formal construction, rational numbers are equivalence classes of pairs ((p,q)) with (q\ne0). The pairs ((p,q)) and ((r,s)) are identified precisely when (ps=rq). This construction makes equality independent of the fraction chosen to represent a value. (math.ucdavis.edu)

Arithmetic and algebraic structure

The rules of arithmetic give

[ \frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}, \qquad \frac{a}{b}-\frac{c}{d}=\frac{ad-bc}{bd}, ]

[ \frac{a}{b}\frac{c}{d}=\frac{ac}{bd}, \qquad \frac{a/b}{c/d}=\frac{ad}{bc}, ]

where denominators are nonzero and the division formula additionally requires (c\ne0). Consequently, addition, subtraction, multiplication, and division by a nonzero rational number always produce rational numbers. These closure properties underpin ordinary fraction calculation. (math.biola.edu)

In abstract algebra, (\mathbb{Q}) is a field: it has additive and multiplicative identities, every element has an additive inverse, and every nonzero element has a multiplicative inverse. Its usual ordering is compatible with these operations, making it an ordered field. If denominators are positive, comparison reduces to integer comparison: (a/b<c/d) exactly when (ad<bc). (math.ucdavis.edu)

Decimal expansions

In base-ten positional notation, a real number is rational exactly when its decimal expansion terminates or eventually repeats a fixed finite block of digits. Thus,

[ \frac38=0.375,\qquad \frac13=0.\overline3,\qquad \frac16=0.1\overline6. ]

“Eventually” is important: repetition need not begin immediately after the decimal point. A bar indicates the digits repeated indefinitely. A finite display such as (0.333333) is therefore not exactly (1/3). (mathforteachers.pressbooks.tru.ca)

The reason for eventual repetition is that long division by a positive integer denominator has only finitely many possible remainders. Either a remainder becomes zero, ending the expansion, or a remainder recurs, causing the subsequent digits to repeat. Conversely, shifting a repeating expansion by suitable powers of ten and subtracting eliminates its repeating tail. For example, if (x=0.\overline{27}), then (100x-x=27), so (x=27/99=3/11). (jirka.org)

A reduced fraction has a terminating decimal precisely when its denominator contains no prime factors other than 2 and 5. Termination depends on the numeral base: (1/3) repeats in base ten but terminates in base three. Some values also have two decimal representations, as illustrated by (0.5000\ldots=0.4999\ldots). (math.biola.edu)

Density, countability, and incompleteness

Rational numbers form a dense subset of the real line: between any two distinct real numbers lies a rational number. Between two rationals (a<b), their midpoint ((a+b)/2) is another rational. Repeating this construction shows that every nonempty open interval contains infinitely many rational numbers. Density allows rational approximations to any real number with arbitrarily small error. (math.ucdavis.edu)

Nevertheless, (\mathbb{Q}) is a countably infinite set. Its elements can be listed by systematically enumerating integer numerator–denominator pairs and omitting duplicate values. It therefore has the same cardinality as the natural numbers, whereas the real numbers are uncountable. Density and cardinality describe different properties: being present in every interval does not mean containing every point. (jirka.org)

For mathematical analysis, a crucial limitation is that (\mathbb{Q}), with its usual distance, is not complete. Rational approximations (1,1.4,1.41,1.414,\ldots) to (\sqrt2) form a Cauchy sequence, but their limit is not rational. A proof by contradiction establishes this: if (\sqrt2=p/q) in lowest terms, (p^2=2q^2) forces both (p) and (q) to be even. Constructing real numbers fills such missing limits. (math.ucdavis.edu)

Exact computation

In computer science, rational arithmetic can store a value as an integer numerator and denominator, preserving exact results rather than replacing them with rounded decimals. Python’s fractions module, for example, normalizes fractions and supports rational operations. Its documentation distinguishes constructing a fraction from an exact decimal string from constructing one from a floating-point value: the latter preserves the stored binary approximation, which may differ from the intended decimal fraction. (docs.python.org)