levo

Theory of Computation

  • 16 subtopics
  • 33 things to know
  • Paper 1

What Theory of Computation covers

Abstraction and decomposition, finite state machines, regular expressions, Backus-Naur Form, Big-O complexity, tractability, the Halting problem and Turing machines. Examined on Paper 1.

Where it is assessed

Paper 1

The on-screen programming exam, 2 hours 30 minutes and 40% of the A-level.

Check the AQA specification ↗

The 16 subtopics

Each one has its own page.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Numbers

Why is it worth rewriting a logic problem using single letters and Boolean operators before trying to solve it?

Process

Define the term algorithm.

Numbers

Why can testing never prove that a program is correct, and what does that mean for the argument you make?

Key term

Give a worked example of representational abstraction and say exactly what was removed and what was kept.

Process

Distinguish representational abstraction from abstraction by generalisation.

Key term

How is information hiding related to abstraction?

Key term

What is procedural abstraction?

Key term

Why is a function easier to reason about than a procedure?

Evaluation

Why does data abstraction let a stack's representation be changed safely?

Process

Give a worked example of a real problem being reduced to one that is already solved.

Evaluation

State three benefits of decomposing a problem before writing any code.

Key term

Give three examples of compound data objects built from previously defined types.

Process

Why is creating algorithms the first step in automating a model?

Key term

Describe how a state transition diagram is drawn, so that someone could reconstruct one on paper.

Key term

Describe a Mealy machine that outputs a 1 each time it has just read two 1s in a row, and 0 otherwise.

Key term

Is {Ø} the same as Ø?

Key term

Is the set of real numbers countable? Explain the significance of the answer.

Key term

Give the formal definition of the set difference A \ B.

Key term

Write a regular expression that matches both 'color' and 'colour' and nothing else, and explain the metacharacter you used.

Key term

Describe the relationship between regular expressions and finite state machines.

Key term

Using the rule <unsigned integer> ::= <digit> | <digit><unsigned integer>, check whether 407 is a valid unsigned integer, showing each step.

Key term

Describe how a syntax diagram is drawn and how you use it to check a string.

Evaluation

Why is the size of the problem the key issue when comparing algorithms?

Key term

Distinguish clearly between the domain and the co-domain of a function.

Process

What is the crucial difference between y = 2x² and y = 2ˣ?

Key term

What does constant time mean, and give two examples?

Process

Derive the complexity of this algorithm. count ← 0 WHILE n > 1 n ← n DIV 2 count ← count + 1 ENDWHILE.

Process

Why does a faster computer not solve the problem of intractability?

Key term

Why are heuristic methods often used when tackling intractable problems?

Process

Distinguish a non-computable problem from an intractable one.

Process

A student says 'the Halting problem just means the test would take too long'. Correct them.

Process

How does a transition function relate to a state transition diagram?

Key term

What happens if a Turing machine is in a state and reads a symbol for which the transition function has no rule?

Take Theory of Computation further

The same content, four other ways.

Commonly confused

Pairs that lose marks when they are blurred together.

  • Terminal symbol vs Non-terminal symbol

    Terminal symbol: a grammar symbol that can appear in the finished string. Non-terminal symbol: a grammar symbol replaced by production rules.

  • Finite state automaton vs Mealy machine

    Finite state automaton: a state machine that only accepts or rejects input. Mealy machine: a state machine producing output on transitions.

  • Polynomial time vs Exponential time

    Polynomial time: growth bounded by a fixed power of input size. Exponential time: growth multiplying by a fixed factor when input size increases.

Questions from this topic

Each one with the model answer underneath.

  1. 1

    A door lock must open only when at least two of its three sensors A, B and C are triggered. Develop a Boolean expression for the OPEN signal and explain how you arrived at it.

    Model answer

    OPEN = (A AND B) OR (A AND C) OR (B AND C). Work through the cases: 'at least two of three' is satisfied by exactly the three possible pairs, so write one AND term for each pair and OR the terms together. The all-three case needs no extra term because if A, B and C are all triggered then (A AND B) is already true, which makes the whole OR true.

  2. 2

    How would you check that door-lock expression is correct, and why is trying one set of inputs not enough?

    Model answer

    Build a truth table with a row for every combination of inputs. Three inputs give 2³ = 8 rows. Evaluate the expression in each row and compare the result with what the problem demands: it must be 0 for the four rows 000, 100, 010 and 001 (fewer than two sensors triggered) and 1 for the four rows 110, 101, 011 and 111. One test is not enough because a mistake in a single AND term still leaves most rows correct; only checking every case, or giving a logical argument that covers every case, shows the solution is right.

  3. 3

    An alarm should sound when the window sensor W reports open AND the system is armed R, but never while the engineer's override O is on. Give the Boolean expression and say what happens when W = 1, R = 1 and O = 1.

    Model answer

    ALARM = W AND R AND NOT O. With W = 1, R = 1 and O = 1, NOT O = 0, so the three-way AND evaluates to 0 and the alarm stays silent. The override wins, which is exactly what the problem asked for. Note that 'but never while' in the English statement becomes AND NOT, not OR NOT.

  4. 4

    A student claims that NOT (A AND B) is the same as (NOT A) AND (NOT B). Show that this is wrong.

    Model answer

    Take A = 1 and B = 0. NOT (A AND B) = NOT 0 = 1, but (NOT A) AND (NOT B) = 0 AND 1 = 0. The two sides differ, so the claim is false. A single counter-example is enough to disprove a claim that two expressions are equivalent. The correct equivalent is NOT (A AND B) = (NOT A) OR (NOT B).

  5. 5

    Solve this logic problem and justify your answer: 'If a file is compressed then it is not encrypted. This file is encrypted.'

    Model answer

    The file is not compressed. If it were compressed, the first statement would force it to be unencrypted, which contradicts the fact that it is encrypted. Ruling out the only alternative leaves 'not compressed' as the conclusion.

  6. 6

    Why is it worth rewriting a logic problem using single letters and Boolean operators before trying to solve it?

    Model answer

    Ordinary English is ambiguous about logic. 'Or' may mean one or the other or both, or it may mean exactly one; 'unless' can mean AND NOT; 'and' in a list can hide an implied OR. Replacing each condition with a named variable and writing the requirement with AND, OR and NOT fixes one meaning, makes the number of input combinations obvious (n conditions give 2ⁿ cases to check), and lets you test the solution mechanically with a truth table instead of by re-reading the prose.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Theory of Computation revision questions

What does Theory of Computation cover in AQA A-Level Computer Science?
16 subtopics: logic problems and algorithm constructs, pseudo-code, hand-tracing and program correctness, representational abstraction, generalisation and information hiding, procedural and functional abstraction, data abstraction and problem reduction, decomposition and composition, automation and finite state machines, sets and set notation, subsets and set operations, regular expressions and regular languages, backus-naur form and syntax diagrams, comparing algorithms and functions, order of complexity and big-o notation, limits of computation, tractability and heuristics, computable problems and the halting problem and turing machines. Each one has its own page with questions and model answers.
How is Theory of Computation organised?
By the AQA 7517 specification, subtopic by subtopic, so it matches the order you are taught it in.

Every question in Theory of Computation, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.