AQA 7517, section 4.5.1.3
A rational number is a number that can be written as a fraction (a ratio of two integers):
The set of rational numbers is written .
The integers are rational numbers
Since a number such as 7 can be written as , every integer is a rational number. So the sets are nested:
Examples
| Number | As a fraction | Rational? |
|---|---|---|
| 0.75 | Yes | |
| Yes | ||
| 0.333... (recurring) | Yes | |
| 1.5 | Yes | |
| no exact fraction | No |
Decimal form
When a rational number is written as a decimal, it either:
- terminates (stops), such as ; or
- recurs (repeats a pattern forever), such as and
A number whose decimal never ends and never repeats is not rational (see 4.5.1.4).
In computing
Computers store numbers with a fixed number of bits, so only some rational numbers can be stored exactly. In binary, a fraction terminates only if its denominator is a power of 2, such as , or . A fraction such as is a rational number, but in binary it recurs forever, so it can only be approximated (see 4.5.4.5).
from fractions import Fraction
print(Fraction(3, 4)) # 3/4
print(Fraction(1, 10) + Fraction(2, 10)) # 3/10: exact
print(0.1 + 0.2) # 0.30000000000000004: approximate
Worked example
Task: write 0.125 as a fraction, and decide whether is rational.
, which is a ratio of two integers, so it is rational. is also a ratio of two integers, so it is rational. It's often used as an approximation for , but is not equal to .
Exam tip: the defining idea is that a rational number can be written as a fraction of two integers. Integers count as rational, because .
Check yourself
Is the integer 5 a rational number?
Yes, because it can be written as .
What does the decimal form of a rational number look like?
It either stops (terminates) or repeats a pattern forever.
Is 0.2 a rational number? Write it as a fraction
Yes. .