Year 8 · Y8.2 Computational Thinking · Lesson 1

Stretch tasks The four techniques

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

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

Read the lesson: The four techniques

The four techniques: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. A satnav shows roads and junctions, but not the colour of the houses. Which technique is this?

    • Pattern recognition
    • Algorithmic thinking
    • Abstraction
    • Decomposition
  2. A games studio splits a new game into level design, music, character art and physics code. Which technique is this?

    • Algorithmic thinking
    • Decomposition
    • Abstraction
    • Pattern recognition
  3. You notice the cost of 3 pizzas, 5 drinks and 2 desserts is always quantity times price. Which technique is this?

    • Abstraction
    • Algorithmic thinking
    • Pattern recognition
    • Decomposition
  4. Abstraction means throwing away information that might be needed for any problem in the future.

    • True
    • False
  5. Put the four techniques in the order the lesson suggests using them.

    Number these 1 to 4.

    • Pattern recognition
    • Algorithmic thinking
    • Decomposition
    • Abstraction
  6. A fire drill map of the school needs which TWO details?

    Tick 2.

    • The colour of the walls
    • What is on the noticeboards
    • Where the plug sockets are
    • Where the exits are
    • The corridors between rooms
  7. The London Underground map shows stations in the right order but not the real distances between them. Why is that good abstraction?

    • The real distances are kept secret
    • It makes the map cheaper to print
    • The real distances change every day
    • Travellers only need the order of stations and where lines meet
  8. A bus passenger's app and the bus company's repair team need different details. Which one does ONLY the repair team need?

    • The times buses leave each stop
    • The route number on each bus
    • The names of the bus stops
    • The engine model and service history of each bus
  9. Which technique means breaking a problem into smaller problems? Type the word.

  10. Why is decomposition so useful for a team building an app?

    • It removes the need to test the app
    • It means only one person needs to understand the app
    • Different people can work on different parts at the same time
    • It makes the finished app use less memory
  11. Pattern recognition can save time, because one solution can be reused for many similar problems.

    • True
    • False
  12. A recipe lists its steps in exactly the order you must do them. Which technique does a recipe show?

    • Abstraction
    • Pattern recognition
    • Decomposition
    • Algorithmic thinking

Quiz Challenge, round 2: Quick Fire

  1. Explain what abstraction means, using a map as your example. [2 marks]

  2. A school wants an online system for parents' evening. Decompose the problem into three smaller problems. [3 marks]

  3. Give one reason why abstraction is useful when writing a program. [1 mark]

  4. Here are three problems: the area of a 3 by 4 rectangle, a 5 by 2 rectangle and a 7 by 6 rectangle. Describe the pattern, and how it helps. [2 marks]

Quiz Challenge, round 3: Big Think

  1. A student has to make a quiz game in Scratch. Explain how decomposition and abstraction would help them. [4 marks]

  2. A student says: planning with computational thinking wastes time, and it is quicker to start coding straight away. Discuss. [6 marks]

This or That: tick the right answer

  1. You split organising a school disco into music, food, tickets and decorations. Which technique is that?

    • Abstraction
    • Decomposition
  2. A weather app shows temperature, rain and wind, not every satellite reading. Which technique is that?

    • Abstraction
    • Decomposition
  3. Every level of your game starts the same way, so you write that code once and reuse it. Which technique?

    • Algorithmic thinking
    • Pattern recognition
  4. Writing out the steps for making a cup of tea, in the right order, is which technique?

    • Algorithmic thinking
    • Pattern recognition
  5. What is the real skill in abstraction?

    • Deciding what to leave out
    • Adding as much detail as possible
  6. Detail that is useless for one problem is useless for every problem. True or false?

    • True: it can always be thrown away
    • False: another problem may need it
  7. Which of these does decomposition do?

    • Removes the details you do not need
    • Splits a problem into smaller problems
  8. You need the areas of six different rectangles. What does pattern recognition suggest?

    • Use width x height for all six
    • Find a new method for each one

Memory Match: match each term to its meaning

TermMeaning
A Decomposition1 A sequence of steps that solves a problem
B Abstraction2 Spotting similarities so a solution can be reused
C Pattern recognition3 Working out the steps, in the right order
D Algorithmic thinking4 Breaking a problem into smaller problems
E Algorithm5 Solving problems in ways a computer could help with
F Computational thinking6 Removing detail that does not matter
Answers

Round 1: Quiz Blitz

  1. Abstraction Abstraction removes detail that does not matter for the problem. A driver needs the roads, not the paint.
  2. Decomposition Breaking one huge problem into smaller ones that separate people can solve is decomposition.
  3. Pattern recognition Spotting that several problems share the same structure means one method can solve them all.
  4. False Abstraction leaves out detail that does not matter for this problem. The same detail may be essential for a different one.
  5. Decomposition → Abstraction → Pattern recognition → Algorithmic thinking Break the problem down, strip away what does not matter, look for patterns to reuse, then write the steps.
  6. Where the exits are; The corridors between rooms In a fire drill people need to know how to get out. Everything else is detail the map can leave out.
  7. Travellers only need the order of stations and where lines meet Passengers change trains and count stops; they never walk the tunnels. The map keeps exactly what they need.
  8. The engine model and service history of each bus Abstraction depends on the purpose. Detail that is clutter for a passenger is essential for a mechanic.
  9. decomposition Decomposition turns one big problem into several smaller ones that are each easy to solve.
  10. Different people can work on different parts at the same time Small, separate parts can be shared out, built in parallel and tested one at a time.
  11. True Solve it once, reuse it everywhere: that is why programmers write functions.
  12. Algorithmic thinking An algorithm is a set of steps in the right order. A recipe is an algorithm for food.

Round 2: Quick Fire

    • Removing or hiding detail that is not needed
    • An example: a map keeps the roads but leaves out details such as buildings or colours
    Model answer

    Abstraction means removing detail that is not needed for the problem, so you can focus on what matters. A road map keeps the roads and junctions but leaves out details such as the colour of the buildings, the trees and the parked cars.

    • Show the times each teacher is free
    • Let parents choose and book a time
    • Stop two parents booking the same time
    • Send a confirmation or a reminder
    • Log parents in, or identify the parent and child
    • Give each teacher a list of their appointments
    Model answer

    The system could be decomposed into: showing the times each teacher is free; letting parents choose and book a time; checking that two parents cannot book the same slot; and sending each parent a confirmation email and a reminder.

    • It makes the problem simpler, so it is easier and quicker to solve
    Model answer

    It makes the problem simpler, so you can focus on what matters and write less code.

    • Each one multiplies the width by the height
    • So one method can be written once and reused for all of them
    Model answer

    In every case the area is the width multiplied by the height. That means one method can be written once and reused for every rectangle, instead of solving each one separately.

Round 3: Big Think

    • Decomposition: split the game into smaller parts
    • Gives a sensible example of a part: questions, scoring, a timer or a menu
    • Each part is easier to build and test on its own
    • Abstraction: leave out detail the quiz does not need
    • Gives an example of what to keep or leave out, such as keeping the questions and answers but not fancy graphics
    • The result is simpler and quicker to build
    Model answer

    Decomposition would let the student split the quiz into smaller parts, such as the questions, the scoring, a timer and a start menu. Each part is easier to build and test on its own, one at a time. Abstraction would help them focus on what the quiz really needs, which is each question, its possible answers and the correct answer, and leave out unnecessary detail such as fancy backdrops and animations at first. Together the two make the game simpler and quicker to build.

    • For very small or simple programs, starting straight away can be quick
    • You can learn by experimenting and trying ideas
    • Decomposition makes a big problem manageable
    • Mistakes in the logic are cheaper to fix in a plan than in code
    • Pattern recognition lets you reuse a solution
    • Abstraction stops you wasting time on unimportant detail
    • A plan can be shared, so others can understand it and give feedback
    • A reasoned conclusion
    Model answer

    For a very small or simple program the student has a point, because writing a few lines straight away can be quick, and experimenting is a good way to learn. However, for anything bigger they are wrong. Decomposition breaks a big problem into smaller parts so it becomes manageable, and abstraction keeps you focused instead of wasting time on unimportant detail. Pattern recognition lets you spot where one solution can be reused, for example as a function. Planning also catches mistakes in the logic, which are far cheaper to fix in a plan than after hundreds of lines of code, and a plan can be shared so that other people understand it and give feedback. Overall, I disagree: a few minutes of planning usually saves much more time than it costs.

This or That

  1. Decomposition Breaking one big problem into smaller ones that you can actually do is decomposition.
  2. Abstraction Abstraction removes the detail that does not matter and keeps what the user needs.
  3. Pattern recognition Spotting what several problems have in common lets you reuse one solution.
  4. Algorithmic thinking Algorithmic thinking means working out the steps needed, in the right order.
  5. Deciding what to leave out Abstraction keeps what matters for this problem and removes everything else.
  6. False: another problem may need it A fire drill map does not need the plug sockets, but an electrician's plan of the same school does.
  7. Splits a problem into smaller problems Decomposition breaks a problem into parts. Removing unneeded detail is abstraction.
  8. Use width x height for all six All six follow the same pattern, so one method can be reused six times.

Memory Match

  • A 4 Decomposition: Breaking a problem into smaller problems
  • B 6 Abstraction: Removing detail that does not matter
  • C 2 Pattern recognition: Spotting similarities so a solution can be reused
  • D 3 Algorithmic thinking: Working out the steps, in the right order
  • E 1 Algorithm: A sequence of steps that solves a problem
  • F 5 Computational thinking: Solving problems in ways a computer could help with