Skip to topic
    ← Back to course topics

    Mathematics — AQA A-Level Computer Science

    Test yourself on Mathematics with AQA A-Level practice questions.

    Start free

    7 days Premium · Then free forever · No card, no charge

    Mathematics explained

    This subtopic covers the fundamental mathematical concepts of number and algebra as applied to computer science, including number systems (binary, hexadecimal), arithmetic operations, and algebraic manipulation.

    Read the full explanation

    Students will learn to perform conversions between number bases, understand the representation of integers and real numbers in binary, and apply algebraic techniques to solve problems in computing contexts.

    Your focus

    1. Convert between binary, decimal, and hexadecimal number systems
    2. Perform binary arithmetic including addition, subtraction, and multiplication
    3. Explain the representation of signed integers using two's complement
    Show all 8 objectives
    1. Describe the representation of real numbers in floating-point form
    2. Simplify algebraic expressions using laws of indices and logarithms
    3. Apply algebraic methods to solve equations relevant to computer science
    4. Evaluate Boolean expressions using truth tables
    5. Simplify Boolean expressions using Boolean algebra laws

    Mathematics exam tips

    Quick Revision Summary (Key Takeaway)

    Mathematics in AQA A-Level Computer Science covers the mathematical foundations required for computational thinking, including Boolean algebra, number systems, graph theory, and algorithms. This topic is essential for understanding how computers process data and solve problems, and it underpins many exam questions on data representation, logic gates, and algorithm efficiency.

    Topic Overview

    Mathematics in Computer Science is a core component of the AQA A-Level specification, designed to give you the mathematical toolkit needed to understand computational processes. This includes number systems (binary, hexadecimal, and two's complement), Boolean algebra and logic gates, graph theory, and algorithms such as Dijkstra's shortest path. These topics are not just abstract maths; they directly relate to how data is stored, how processors make decisions, and how networks find efficient routes.

    Why does this matter? In the exam, you will be asked to perform calculations, simplify expressions, and trace algorithms. Beyond the exam, these mathematical foundations are essential for university-level computer science and industry roles in areas like data science, cryptography, and software engineering. Understanding the maths behind the code helps you write more efficient algorithms and debug complex systems.

    This topic builds on GCSE mathematics and introduces new concepts like Boolean identities and graph traversal. It connects with other parts of the A-Level, such as data representation, computer architecture, and computational thinking. Mastering these skills will boost your confidence in problem-solving and give you a competitive edge in your exams.

    Key Concepts
    • →Number systems: binary, denary, hexadecimal, and conversions between them, including binary addition and two's complement for negative numbers.
    • →Boolean algebra: logic gates (AND, OR, NOT, NAND, NOR, XOR), truth tables, and simplification using Boolean laws (commutative, associative, distributive, absorption, De Morgan's).
    • →Graph theory: vertices, edges, weighted graphs, adjacency matrices/lists, and graph traversal algorithms (Dijkstra's, A*).
    • →Algorithm efficiency: Big O notation, time and space complexity, and comparing algorithms.
    • →Vectors and matrices: basic operations and their use in computer graphics and transformations.
    Marking Points
    • Award credit for correct conversion of numbers between bases with clear working
    • Award credit for accurate binary arithmetic with correct handling of carries and overflows
    • Award credit for correct representation of negative numbers using two's complement
    • Award credit for correct normalization in floating-point representation
    • Award credit for correct simplification of algebraic expressions using appropriate laws
    • Award credit for correct construction and interpretation of truth tables
    • Award credit for correct application of Boolean algebra laws to simplify expressions
    Examiner Tips
    • 💡Practice conversions between bases regularly to build speed and accuracy
    • 💡Always show your working for arithmetic and algebraic manipulations to gain method marks
    • 💡Memorize key binary equivalents (e.g., powers of 2) to speed up conversions
    • 💡Understand the underlying principles of two's complement and floating-point representation
    • 💡Use truth tables systematically to avoid missing rows
    • 💡Review Boolean algebra laws and practice simplification problems
    • 💡Always show your working for calculations and algorithm traces. Even if the final answer is wrong, you can gain method marks.
    • 💡Learn the Boolean laws by heart and practice applying them to simplify expressions. State the law used at each step.
    • 💡For graph questions, draw a clear diagram if one isn't given, and use a table to track distances in Dijkstra's algorithm.
    Common Mistakes
    • Confusing binary and decimal place values when converting
    • Forgetting to handle overflow in binary addition
    • Misapplying two's complement for negative numbers
    • Incorrectly normalizing floating-point numbers
    • Misinterpreting the order of operations in algebra
    • Making errors in truth table construction due to missing combinations
    • Misconception: In binary addition, 1+1=2, so you write 2. Correction: In binary, 1+1=10 (0 carry 1). Always carry to the next column.
    • Misconception: De Morgan's law is (A AND B)' = A' AND B'. Correction: It is (A AND B)' = A' OR B'. The AND becomes OR and the NOTs distribute.
    • Misconception: Dijkstra's algorithm works with negative weights. Correction: Dijkstra's fails with negative weights; use Bellman-Ford instead.
    Revision Plan
    1. 1Week 1: Focus on number systems. Practice conversions between binary, denary, and hexadecimal daily. Learn two's complement and binary addition.
    2. 2Week 2: Study Boolean algebra. Memorise the laws and practice simplifying expressions. Create truth tables for logic gates.
    3. 3Week 3: Introduce graph theory. Learn Dijkstra's algorithm and trace it on sample graphs. Practice adjacency matrices.
    4. 4Week 4: Revise algorithm efficiency and Big O notation. Apply to sorting and searching algorithms.
    5. 5Week 5: Attempt past paper questions on these topics. Time yourself and review mark schemes to understand command words.
    Exam Question Types
    • 📋Conversion questions: You may be asked to convert between number bases or perform binary arithmetic. Show all steps.
    • 📋Boolean simplification: Simplify a given expression using Boolean laws. State each law used.
    • 📋Logic gate diagrams: Draw a logic circuit for a given Boolean expression or write the expression for a circuit.
    • 📋Dijkstra's algorithm: Trace the algorithm on a graph and state the shortest path. Use a table to show distances.
    Command Word Expectations (AQA)
    Calculate

    You must perform a calculation and give the final answer, often with units. Show working to gain method marks.

    Simplify

    Reduce a Boolean expression to its simplest form using Boolean laws. State each law used.

    Trace

    Follow an algorithm step by step, showing the state of variables or data structures at each stage.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Students often confuse the order of precedence in Boolean algebra, leading to incorrect simplification of expressions.
    ❌ Weak Answer (Loses Marks):Simplify A + A·B to A·B because I just removed the A.
    Example improved answer:Using the absorption law, A + A·B = A. This is because A + A·B = A·(1 + B) = A·1 = A. The term A·B is redundant as A already covers all cases where A is true.
    Examiner Tip: Always apply Boolean laws systematically. Write down each step and state the law used (e.g., absorption, distributive) to show your working and avoid losing method marks.
    Pitfall: In graph theory, students misapply Dijkstra's algorithm by not updating distances correctly when a shorter path is found.
    ❌ Weak Answer (Loses Marks):I found the shortest path by picking the smallest edge each time.
    Example improved answer:Dijkstra's algorithm requires maintaining a table of tentative distances. Start with the source node distance 0 and all others infinity. Repeatedly select the unvisited node with the smallest tentative distance, update the distances of its neighbours if a shorter path is found, and mark the node as visited. Continue until the destination is reached or all nodes are visited.
    Examiner Tip: Practice tracing Dijkstra's algorithm on small graphs. Always update the distance table fully and cross out old values when a shorter path is found. Show the final table in your answer.
    Step-by-Step Worked Solutions

    Question: Convert the decimal number 156 to binary, octal, and hexadecimal. Show your working.

    1. 1.Step 1: Convert 156 to binary by repeated division by 2: 156 ÷ 2 = 78 remainder 0, 78 ÷ 2 = 39 remainder 0, 39 ÷ 2 = 19 remainder 1, 19 ÷ 2 = 9 remainder 1, 9 ÷ 2 = 4 remainder 1, 4 ÷ 2 = 2 remainder 0, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1. Read remainders bottom-up: 10011100.
    2. 2.Step 2: Convert binary to octal by grouping into 3 bits from right: 10 011 100 → 2 3 4, so octal is 234.
    3. 3.Step 3: Convert binary to hexadecimal by grouping into 4 bits from right: 1001 1100 → 9 C, so hexadecimal is 9C.
    Final Answer: 156 in binary is 10011100, in octal is 234, and in hexadecimal is 9C.

    Question: A graph has vertices A, B, C, D, E and edges with weights: AB=4, AC=2, BD=5, CD=1, CE=6, DE=3. Use Dijkstra's algorithm to find the shortest path from A to E. Show your working.

    1. 1.Step 1: Initialise distances: A=0, others=∞. Mark A as current.
    2. 2.Step 2: Update neighbours of A: B=4, C=2. Select C (smallest unvisited).
    3. 3.Step 3: Update neighbours of C: D=2+1=3, E=2+6=8. Select D (distance 3).
    4. 4.Step 4: Update neighbours of D: B=3+5=8 (not better than 4), E=3+3=6 (better than 8, so update E to 6). Select B (distance 4).
    5. 5.Step 5: Update neighbours of B: none better. Select E (distance 6). Shortest path is A-C-D-E with total weight 6.
    Final Answer: The shortest path from A to E is A → C → D → E with total weight 6.
    Active Recall Memory Test
    What is the two's complement representation of -5 in 8 bits?
    Key Fact: Start with 5 in binary: 00000101. Invert: 11111010. Add 1: 11111011. So -5 is 11111011.
    State De Morgan's laws.
    Key Fact: NOT (A AND B) = (NOT A) OR (NOT B) and NOT (A OR B) = (NOT A) AND (NOT B).
    What is the time complexity of Dijkstra's algorithm with a simple array?
    Key Fact: O(V^2) where V is the number of vertices, but with a priority queue it is O((V+E) log V).
    Convert the binary number 101101 to hexadecimal.
    Key Fact: Group into nibbles: 0010 1101 = 2D.
    Frequently Asked Questions
    How do I convert a decimal number to binary quickly?
    The fastest method is repeated division by 2, noting remainders. For example, 156 ÷ 2 = 78 remainder 0, 78 ÷ 2 = 39 remainder 0, 39 ÷ 2 = 19 remainder 1, and so on. Read the remainders from bottom to top to get the binary number. Alternatively, you can use the subtraction method with powers of 2, but division is more reliable for large numbers.
    What is the difference between a logic gate and a Boolean expression?
    A logic gate is a physical or conceptual electronic component that performs a Boolean operation on one or more inputs to produce an output. A Boolean expression is a mathematical representation of that operation using variables and operators like AND, OR, and NOT. For example, an AND gate corresponds to the expression A·B. In exams, you may be asked to convert between the two.
    Why is Dijkstra's algorithm important in computer science?
    Dijkstra's algorithm finds the shortest path between nodes in a graph, which is essential in networking (e.g., routing protocols), GPS navigation, and many other applications. It is a classic example of a greedy algorithm and is a key topic in A-Level Computer Science because it demonstrates how to solve real-world problems efficiently.
    How do I simplify Boolean expressions without making mistakes?
    Practice using Boolean laws step by step. Write down each law you apply, such as the distributive law or De Morgan's law. Also, create truth tables to verify your simplified expression matches the original. This helps you catch errors and understand the logic.
    What is Big O notation and why do I need to know it?
    Big O notation describes the efficiency of an algorithm in terms of time or space as the input size grows. It is crucial for comparing algorithms and choosing the best one for a task. In exams, you may be asked to state the complexity of a given algorithm or compare two algorithms. Understanding Big O helps you write efficient code and is a fundamental concept in computer science.
    Can I use a calculator in the AQA A-Level Computer Science exam?
    Yes, you are allowed to use a scientific calculator in the exam. However, you should still show your working for calculations, as marks are awarded for method. Calculators are useful for arithmetic but not for Boolean algebra or algorithm tracing.