Skip to topic
    ← Back to course topics

    Irrational numbers — AQA A-Level Computer Science

    An irrational number is a real number that cannot be written as a ratio of two integers, possessing an infinite and non-repeating expansion. In AQA A-Level Computer Science, understanding irrational numbers is essential for appreciating the fundamental limitations of representing continuous real-world quantities in finite binary systems.

    Irrational numbers explained

    An irrational number is a real number that cannot be written as a fraction p/q where p and q are integers and q is not zero.

    Read the full explanation

    Its decimal expansion is non-terminating and non-recurring, which is the practical way to recognise one. Familiarity with the concept means knowing this defining property and being able to contrast irrationals with rationals, which are the numbers that can be expressed as such a fraction. Common examples include √2, π and e, and students should be able to recognise a square root of a non-square integer as irrational. The concept sits within the real numbers, so the real numbers divide into rational and irrational numbers with no overlap. Being familiar with the concept also involves recognising that an irrational number cannot be exactly represented by a finite decimal, which is why calculators give only approximations.

    Your focus

    1. Be familiar with the concept of an irrational

    Which command word is this?

    Provide the concise definition or identify the specific number set without prolonged explanation or working.

    Irrational numbers exam tips

    Topic Overview

    The study of irrational numbers in AQA A-Level Computer Science sits within the number systems topic alongside natural (N), integer (Z), rational (Q), and real (R) numbers. An irrational number is defined as a real number that cannot be expressed as a quotient of two integers, possessing an infinite and non-periodic sequence of digits.

    Understanding irrational numbers provides foundational insight into why digital computers cannot achieve absolute precision for continuous mathematical concepts. Because computer memory is strictly finite, irrational constants such as pi or square roots must be approximated using fixed-point or floating-point encodings, introducing inevitable rounding and truncation errors.

    Key Concepts
    • →Formal definition: An irrational number is any real number that cannot be written in the form a/b, where a and b are integers and b != 0.
    • →Set hierarchy: Irrational numbers belong to the set of real numbers (R) but are strictly excluded from the set of rational numbers (Q).
    • →Infinite non-repeating representation: Unlike rational numbers, which either terminate or repeat periodically, irrational numbers never terminate or repeat in any integer base.
    • →Representation error: Because digital computers use finite bit-lengths, irrational numbers cannot be stored exactly in standard binary formats, necessitating approximations.
    Marking Points
    • States that an irrational number cannot be written as p/q with p and q integers and q non-zero
    • Identifies that the decimal expansion of an irrational number is non-terminating and non-recurring
    • Gives standard examples such as √2, π and e
    • Recognises that the set of irrational numbers and the set of rational numbers together form the real numbers without overlap
    • Explains that an irrational number has no exact finite decimal representation, so decimal approximations are used in practice
    Examiner Tips
    • 💡Use the definition of rational as the reference point: an irrational number is simply one that fails it
    • 💡Check a square root by asking whether the number inside is a perfect square before classifying it
    • 💡In multiple-choice questions, look for options that name a non-terminating, non-recurring decimal rather than a decimal with many digits
    • 💡Memorise the standard set notation symbols: N (natural), Z (integers), Q (rational), and R (real), and practice placing values correctly into Venn diagrams.
    • 💡When explaining why an irrational number causes issues in computer programs, always mention 'finite bit allocation' and 'rounding/truncation error'.
    Common Mistakes
    • Describes an irrational number as one with a decimal point; correct by stating the key feature is a non-terminating, non-recurring decimal
    • Assumes any square root is irrational; correct by noting √4 = 2 is rational because 4 is a perfect square
    • Confuses irrational with imaginary numbers; correct by stating irrationals are real numbers that cannot be written as a fraction of integers
    • Believing that any number with an infinite binary expansion is irrational. In reality, rational values like 1/10 or 1/3 have infinite recurring binary representations, but they remain strictly rational.
    • Assuming that increasing floating-point precision to 64-bit or 128-bit will eventually allow an irrational number to be stored completely accurately, forgetting that irrational numbers require infinite bits.
    • Confusing the set of real numbers R with irrational numbers. Real numbers encompass both rational and irrational numbers.
    Revision Plan
    1. 1Day 1: Learn formal mathematical definitions for N, Z, Q, and R, specifically practicing the algebraic definition of Q and non-Q.
    2. 2Day 2: Compare recurring rational numbers in binary with genuine irrational numbers to understand the distinction.
    3. 3Day 3: Practice AQA past paper questions on number set classification and error propagation.
    4. 4Day 4: Review floating-point limitations and explain why equality checks fail on approximated irrational numbers.
    Exam Question Types
    • 📋Set classification questions: Assigning given numbers (e.g. -4, 0, 2/3, sqrt(3), pi) to the correct sets N, Z, Q, or R.
    • 📋Short explain questions: Defining an irrational number using exact mathematical terminology.
    • 📋Applied limitation questions: Explaining the impact of approximating irrational numbers in simulation software or games development.
    Command Word Expectations (AQA)
    State

    Provide the concise definition or identify the specific number set without prolonged explanation or working.

    Explain

    Set out the mathematical or technical reasons clearly, connecting the properties of irrational numbers to binary representation limitations.

    Distinguish between

    Highlight the precise mathematical boundaries that separate two sets, explicitly contrasting their ability to be expressed as a quotient of integers.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Confusing rational numbers that recur in binary (such as 0.1 or 1/3) with true irrational numbers like pi or sqrt(2).
    ❌ Weak Answer (Loses Marks):An irrational number is a number that cannot be represented accurately in floating point binary, such as 0.2.
    Example improved answer:An irrational number is a real number that cannot be expressed as a fraction a/b, where a and b are integers and b is non-zero. While 0.2 cannot be represented exactly in binary floating point, it is rational because it equals 1/5; by contrast, sqrt(2) is irrational because its digits never terminate or repeat in any base.
    Examiner Tip: Always specify that irrational numbers cannot be expressed as a ratio of two integers. Do not rely solely on computing representation limits to define mathematical number sets.
    Pitfall: Omitting the non-zero condition for the denominator when defining rational versus irrational sets.
    ❌ Weak Answer (Loses Marks):Irrational numbers cannot be written as fractions of integers.
    Example improved answer:An irrational number cannot be expressed in the form a/b where a and b are integers and b does not equal zero.
    Examiner Tip: Memorise the rigorous mathematical definitions for number sets N, Z, Q, and R, including boundary constraints like b != 0.
    Step-by-Step Worked Solutions

    Question: A graphics engine requires precise coordinate calculations using the circle constant pi. Explain why pi is classified as an irrational number, and explain the consequences of storing pi within a standard 32-bit floating-point variable.

    1. 1.Step 1: State the definition of an irrational number in relation to pi. Pi cannot be expressed as a ratio of two integers (a/b where a, b in Z and b != 0) and has an infinite, non-repeating decimal expansion.
    2. 2.Step 2: Relate this property to finite computer architecture. A 32-bit floating-point variable (such as IEEE 754 single precision) allocates a fixed number of bits (23 bits) to the mantissa/significand, meaning it can only represent a finite subset of rational numbers.
    3. 3.Step 3: Detail the consequences of this representation limit. Storing pi requires truncation or rounding to the nearest representable binary value. Over repeated geometric transformations, these rounding errors compound, potentially leading to visual artifacts or drift in object coordinates.
    Final Answer: Pi is irrational because it cannot be expressed as a ratio of integers a/b (b != 0). Storing it in a 32-bit float forces truncation to a finite rational approximation, introducing rounding errors that accumulate during iterative calculations.

    Question: Place the following numbers into their most restrictive set within the hierarchy N, Z, Q, and R: -7, 3/4, sqrt(5), 12. Then state which of these numbers cannot be represented without rounding error in any standard binary fixed-point format.

    1. 1.Step 1: Classify each number into its most specific set. 12 is a natural number (N). -7 is an integer (Z). 3/4 is a rational number (Q). sqrt(5) cannot be expressed as a fraction of integers, so its most restrictive set is the real numbers (R) as an irrational number.
    2. 2.Step 2: Determine binary fixed-point representation limits. Any irrational number has an infinite, non-repeating binary representation and can never be represented completely accurately in finite bits.
    3. 3.Step 3: Identify whether any rational numbers also suffer rounding errors. 3/4 equals binary 0.11 exactly. However, sqrt(5) cannot be represented without rounding error in any fixed-point format of finite bit-width.
    Final Answer: Classifications: 12 in N; -7 in Z; 3/4 in Q; sqrt(5) in R (irrational). The number that cannot be represented without rounding error in any finite fixed-point format is sqrt(5).
    Active Recall Memory Test
    What is the formal definition of an irrational number?
    Key Fact: A real number that cannot be written in the form a/b where a and b are integers and b != 0.
    Which set contains all rational and irrational numbers?
    Key Fact: The set of real numbers (R).
    Why can an irrational number never be represented exactly in binary floating-point?
    Key Fact: Because it has an infinite, non-repeating expansion, whereas floating-point formats use a finite number of bits.
    Is the number 0.142857142857... (recurring) rational or irrational?
    Key Fact: Rational, because any repeating decimal can be expressed as a fraction of integers (in this case, 1/7).
    Frequently Asked Questions
    Is 1/3 an irrational number in computer science?
    No, 1/3 is a rational number because it is explicitly the ratio of two integers (1 and 3). Even though 1/3 produces an infinite recurring expansion in decimal (0.333...) and binary (0.0101...), recurring patterns are strictly rational. Irrational numbers must be non-repeating.
    How do computers calculate using pi if it cannot be stored accurately?
    Computers store an approximation of pi rounded to the limit of the chosen data type, such as 3.141592653589793 in standard IEEE 754 64-bit double precision. For applications requiring arbitrary precision, computer algebra systems use symbolic computation where pi is maintained as an abstract symbol rather than a numeric approximation.
    Why does comparing floating-point approximations of irrational numbers cause bugs?
    Because irrational numbers are truncated or rounded when converted to binary, minor differences in the order of mathematical operations can result in slightly different least-significant bits. Evaluating a strict equality check like 'x == pi' will usually evaluate to false; programmers must check whether values match within a small tolerance margin instead.
    What is the difference between the set Q and the set R?
    The set Q contains all rational numbers, which can be written as a quotient of integers a/b (b != 0). The set R is the set of all real numbers, which includes every rational number in Q as well as all irrational numbers like sqrt(2) and pi.