AQA 8525 GCSE Computer Science · 3.1 Fundamentals of Algorithms

Stretch tasks Computational Thinking

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

This or That

Pixel the cat asks 8 questions. Each has two answers: pick the right one.

  • Two answers to every question
  • A fish treat for every right answer
  • Streaks win Pixel shades, then a party hat

About 4 minutes

Task 3

Memory Match

Flip the cards two at a time to match each term card to its meaning card.

  • 12 cards: each term has a meaning
  • One peek at every card
  • Combo points for pairs found in a row

6 pairs, about 4 minutes

Task 4

Sort It

Sort each statement into the right box, like the tick-box tables in the exam.

  • 10 cards to sort into 2 boxes
  • Drag a card, tap a box or press its number
  • Combo points for cards sorted in a row

10 cards, about 4 minutes

The games need JavaScript. Every question is below, with the answers at the end.

Read the lesson: Computational Thinking

Computational Thinking: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. How does AQA define an algorithm?

    • A program written in Python
    • A diagram of a computer system
    • A sequence of steps that can be followed to complete a task
    • A set of instructions only a computer can follow
  2. An algorithm must involve a computer.

    • True
    • False
  3. What is the relationship between an algorithm and a program?

    • A program is an implementation of an algorithm
    • An algorithm is an implementation of a program
    • They are exactly the same thing
    • A program is a diagram of an algorithm
  4. What is abstraction?

    • Testing each part separately
    • Removing unnecessary detail so only what is needed remains
    • Breaking a problem into sub-problems
    • Writing an algorithm in Python
  5. A bus fare program stores a passenger's age but not their hair colour. Which skill is that?

    • Decomposition
    • Iteration
    • Selection
    • Abstraction
  6. Which TWO are benefits of decomposition?

    Tick 2.

    • It removes the need for testing
    • The program needs no subroutines
    • The CPU runs faster
    • Work can be split between programmers
    • Errors are easier to find
  7. The same algorithm can be written in Python, in C#, or as a flowchart.

    • True
    • False
  8. What name is given to breaking a problem into smaller sub-problems?

  9. Which detail does a bus fare calculation need?

    • The colour of the bus
    • The zones travelled
    • The passenger's shoe size
    • The passenger's favourite band
  10. Which TWO are benefits of abstraction?

    Tick 2.

    • The program is simpler to write
    • It uses less memory
    • It adds more detail
    • It needs more data
    • It makes the program harder to change
  11. Why design the algorithm before writing the code?

    • Computers cannot run code without one
    • It makes the code shorter
    • Python requires it
    • You can check it works before writing any code
  12. Each sub-problem of a decomposed problem often becomes...

    • A subroutine
    • A variable
    • A comment
    • A file

Quiz Challenge, round 2: Quick Fire

  1. Define the term algorithm, and explain how an algorithm differs from a program. [2 marks]

  2. Explain why decomposing a problem helps a team of programmers. [2 marks]

  3. Give an example of abstraction in a bus fare program, and say why it helps. [2 marks]

  4. State two benefits of abstraction. [2 marks]

Quiz Challenge, round 3: Big Think

  1. A cinema wants a program to sell tickets online. Explain how decomposition and abstraction could be used to design it. [6 marks]

  2. Explain the difference between an algorithm and a program, and why programmers design the algorithm first. [4 marks]

This or That: tick the right answer

  1. Is a cake recipe an algorithm?

    • No: it does not use a computer
    • Yes: it is a sequence of steps
  2. When planning a solution, which should come first?

    • The algorithm
    • The program
  3. A tube map straightens every line. What is that?

    • Abstraction
    • Decomposition
  4. Which phrase earns the definition mark for an algorithm?

    • A sequence of steps
    • Instructions for a computer
  5. Splitting a quiz game into loading, asking and scoring is...

    • Abstraction
    • Decomposition
  6. An answer says abstraction just removes detail. What is missing?

    • Which detail, and why it does not matter
    • The name of the programmer
  7. Which makes errors easier to find?

    • Decomposing into small routines
    • Writing one long program
  8. The same fare model works for another city. What does that show abstraction gives?

    • A more general solution
    • A more detailed solution

Memory Match: match each term to its meaning

TermMeaning
A Algorithm1 Removing unnecessary detail
B Program2 Breaking a problem into sub-problems
C Decomposition3 A sequence of steps to complete a task
D Abstraction4 Having only one possible meaning
E Unambiguous5 A smaller, self-contained task
F Sub-problem6 An algorithm in a programming language

Sort It: tick one box in each row

Abstraction or decomposition?

StatementAbstractionDecomposition
A fare program that ignores hair colour
A model that works for any city because it ignores local detail
Leaving out detail that would make a map harder to use
A tube map with invented distances
Keeping only the information needed to solve the problem
Breaking a problem into parts that can be tested on their own
Turning each part of a problem into a subroutine
Splitting a quiz game into eight smaller tasks
Giving each programmer a different part to write
Turning one huge job into a list of twenty-minute jobs
Answers

Round 1: Quiz Blitz

  1. A sequence of steps that can be followed to complete a task Learn that wording: mark schemes accept a sequence of steps, not instructions for a computer.
  2. False A recipe, or the steps for changing a tyre, is an algorithm too.
  3. A program is an implementation of an algorithm The algorithm is the method. The program is that method in a language a machine can run.
  4. Removing unnecessary detail so only what is needed remains The tube map throws away real distances because passengers do not need them.
  5. Abstraction Hair colour does not affect the fare, so the detail is removed.
  6. Work can be split between programmers; Errors are easier to find Smaller sub-problems can also be solved, tested and reused on their own.
  7. True Each is a different implementation or representation of the same method.
  8. decomposition Each sub-problem is easier to solve than the whole.
  9. The zones travelled Age, zones and whether they hold a pass decide the fare. Everything else is discarded.
  10. The program is simpler to write; It uses less memory Less to represent means simpler, faster code that is easier to maintain.
  11. You can check it works before writing any code Tracing a plan takes minutes. Debugging an unplanned program takes an afternoon.
  12. A subroutine That is why decomposition and structured programming are the same idea in different clothes.

Round 2: Quick Fire

    • An algorithm is a sequence of steps to complete a task
    • A program is an implementation of it in a programming language
    Model answer

    An algorithm is a sequence of steps that can be followed to complete a task. A program is an implementation of an algorithm, written in a programming language so a computer can run it.

    • Each sub-problem is simpler, so it can be solved and tested separately
    • The work can be split between programmers at the same time
    Model answer

    Each sub-problem is simpler than the whole, so it can be solved and tested separately, and the sub-problems can be shared between the programmers so they work at the same time.

    • Names a detail that is removed, such as hair colour
    • It makes the program simpler, faster or use less memory
    Model answer

    The program ignores each passenger's hair colour and name, keeping only their age, zones and pass. That makes the program simpler to write, and it uses less memory.

    • The program is simpler to write
    • It runs faster and uses less memory
    • It is easier to understand and maintain
    • The solution is more general
    Model answer

    The program is simpler to write, and it uses less memory because less data is stored.

Round 3: Big Think

    • Decomposition breaks the problem into smaller sub-problems
    • Sensible sub-problems, such as choosing seats and taking payment
    • Each becomes a subroutine that can be written and tested separately
    • Abstraction removes unnecessary detail
    • It keeps what matters, such as films, times, seats and prices
    • It removes what does not, such as what customers look like
    • So the program is simpler and uses less memory
    Model answer

    Decomposition breaks the problem into smaller sub-problems: showing the films and times, choosing seats, taking payment and emailing a confirmation. Each sub-problem becomes a subroutine that can be written and tested separately, and the work can be shared between programmers. Abstraction removes unnecessary detail: the program needs each film, its showing times, the seat numbers and the prices, but not what the customers look like or the colour of the cinema carpet. That makes the program simpler to write, and it uses less memory.

    • An algorithm is a sequence of steps to complete a task
    • It need not involve a computer, like a recipe
    • A program is an implementation in a programming language
    • Designing first means it can be checked, by tracing, before any code is written
    • Which saves debugging time
    Model answer

    An algorithm is a sequence of steps that can be followed to complete a task, and it need not involve a computer at all: a recipe is an algorithm. A program is an implementation of an algorithm in a programming language. Designing the algorithm first means it can be checked by tracing it on paper before any code is written, which saves hours of debugging later.

This or That

  1. Yes: it is a sequence of steps An algorithm is a sequence of steps to complete a task. No computer is needed.
  2. The algorithm Design and check the method, then implement it as a program.
  3. Abstraction Passengers only need the order of stations, so the true shapes are thrown away.
  4. A sequence of steps Mark schemes accept a sequence of steps, and are far less generous with vaguer phrases.
  5. Decomposition Breaking the problem into smaller sub-problems is decomposition.
  6. Which detail, and why it does not matter Name a specific detail that has gone and say why it is not needed.
  7. Decomposing into small routines A fault then shows up inside one small routine instead of somewhere in a thousand lines.
  8. A more general solution Built only on the essentials, a solution fits many situations.

Memory Match

  • A 3 Algorithm: A sequence of steps to complete a task
  • B 6 Program: An algorithm in a programming language
  • C 2 Decomposition: Breaking a problem into sub-problems
  • D 1 Abstraction: Removing unnecessary detail
  • E 4 Unambiguous: Having only one possible meaning
  • F 5 Sub-problem: A smaller, self-contained task

Sort It

  1. Abstraction A fare program that ignores hair colour Detail that does not affect the fare is removed.
  2. Abstraction A model that works for any city because it ignores local detail Abstraction makes a solution more general.
  3. Abstraction Leaving out detail that would make a map harder to use Removing detail is abstraction.
  4. Abstraction A tube map with invented distances Real distances are thrown away because passengers do not need them.
  5. Abstraction Keeping only the information needed to solve the problem That is the definition of abstraction.
  6. Decomposition Breaking a problem into parts that can be tested on their own Separate parts can be tested separately.
  7. Decomposition Turning each part of a problem into a subroutine Each sub-problem maps onto a subroutine.
  8. Decomposition Splitting a quiz game into eight smaller tasks Breaking a problem up is decomposition.
  9. Decomposition Giving each programmer a different part to write Decomposition lets work be shared out.
  10. Decomposition Turning one huge job into a list of twenty-minute jobs Smaller sub-problems are easier to solve.