Full Marks

A-level Computer Science Year 13 · Topic 6

Theory of computation

The theory of computation at A2 level explores the limits and power of computing.

We will study computability and complexity, regular expressions, finite state machines and Mealy machines.

Then we use set theory, Backus Naur form and syntax diagrams, Turing machines, and big O notation to classify problems.

In this topic

  1. 6.1Computability and complexityFree below · 23 questions
  2. 6.2Regular expressions and formal languagesOpen in Full Marks · 20 questions
  3. 6.3Finite state machines with and without output (Mealy machines)Open in Full Marks · 22 questions
  4. 6.4Set theory and set notation (subsets, union, intersection, Cartesian product, countability)Open in Full Marks · 19 questions
  5. 6.5Backus-Naur form and syntax diagramsOpen in Full Marks · 21 questions
  6. 6.6Turing machines: transition rules and the universal Turing machineOpen in Full Marks · 27 questions
  7. 6.7Big O notation: time and space complexity, tractable and intractable problemsOpen in Full Marks · 24 questions

6.1 · Free notes

Computability and complexity

Diagram: Computability and complexity

Key points

In more detail

Practice

Computability and complexity: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. What is a Turing machine?

  1. A physical computer built in 1936
  2. A theoretical model with an infinite tape, read/write head and states
  3. A type of compiler
  4. A network protocol
Show answer

B: A theoretical model with an infinite tape, read/write head and states. It defines what is computable in principle.

2. What does the halting problem show?

  1. All problems are computable
  2. Some problems cannot be solved by any algorithm
  3. Programs always halt
  4. Recursion is impossible
Show answer

B: Some problems cannot be solved by any algorithm. No general algorithm can decide halting for every program.

3. What is an intractable problem?

  1. One with no solution at all
  2. One with no known polynomial-time solution
  3. One solved in constant time
  4. One that always halts
Show answer

B: One with no known polynomial-time solution. Heuristic approaches give good-enough answers.

4. What does a finite state machine consist of?

  1. An infinite tape
  2. States, inputs and transitions between states
  3. Only memory addresses
  4. A hash table
Show answer

B: States, inputs and transitions between states. It can be represented by a diagram or transition table.

5. Why do complexity classes matter in practice?

  1. They set the programming language
  2. They show how resource needs grow with input size, guiding algorithm choice
  3. They determine hardware prices
  4. They define syntax
Show answer

B: They show how resource needs grow with input size, guiding algorithm choice. An O(2ⁿ) algorithm becomes unusable on large inputs.

6. Which problem is known to be undecidable?

  1. Sorting a list
  2. The halting problem
  3. Binary search
  4. Matrix addition
Show answer

B: The halting problem. No general algorithm can solve it for all inputs.

7. What is a tractable problem?

  1. One with no solution
  2. One solvable in polynomial time
  3. One requiring exponential time
  4. One that never halts
Show answer

B: One solvable in polynomial time. Intractable problems grow too fast to solve exactly for large inputs.

8. What is a heuristic?

  1. An exact algorithm
  2. A rule of thumb giving a good-enough solution quickly
  3. A data structure
  4. A proof technique
Show answer

B: A rule of thumb giving a good-enough solution quickly. Used when exact solutions are impractical.

9. Which two things determine a Turing machine's next action?

  1. Current state and the symbol under the head
  2. The previous state and the next symbol
  3. Tape length and the number of states
  4. Only the symbol under the head
Show answer

A: Current state and the symbol under the head. Each transition rule maps (current state, symbol read) to a symbol to write, a head move and a new state.

10. An algorithm is O(2^n). The input grows from 10 to 20 items. Roughly how many times more steps are needed?

  1. 2 times
  2. About 20 times
  3. About 1000 times
  4. About 1 million times
Show answer

C: About 1000 times. 2^20 ÷ 2^10 = 2^10 = 1024, so about 1000 times more steps. Adding items multiplies the work rather than adding to it.

Keep going in Full Marks

Full Marks has 23 questions on Computability and complexity (13 more than here), set out in practice levels. You also get notes and 3D models for all 7 subtopics of Theory of computation, plus games, timed exams and past papers.

On your exam board

All A-level Computer Science Year 13 topics