Mini Minds Hub · Free printable

The Midnight Alarm Code: Free Printable Worksheet for Year 9

  • ForYear 9
  • StageKey Stage 3
  • CostFree
  • FormatPrintable PDF

The Midnight Alarm Code is a logic case file for Year 9 (ages 13 to 14). Pupils complete a truth table for an alarm and a light, then use it as evidence to catch the suspect whose story cannot be true. It suits pupils who have already met AND, OR and NOT. Page 2 gives the grown-up the notes, help, a stretch idea and the answers.

Before pupils start, model the first row on the board or on scrap paper. Work out D OR W and write it beside the row. Then apply M or NOT M to that result. The usual slip is skipping that middle step and guessing the whole row at once. Ask pupils to say each step aloud.

What is on the sheet

Children meet a case file built around a truth table. The columns are D, W, M, Alarm and Light. Some cells are blank, so pupils fill in the missing values by combining AND, OR and NOT. There are numbered questions with space to answer and lines for writing. Once the table is complete, pupils use it as evidence to decide whether a suspect's story could be true, and explain their decision in words.

  • D
  • W
  • M
  • Alarm
  • Light

Worked example: one row of a different rule

A buzzer follows this rule: (X AND Y) OR (NOT Z). In one row, X is false, Y is true and Z is false. Is the buzzer on?

This example uses different letters and a different rule from the sheet. It shows two ways to work one row.

Method 1: brackets first
  1. Work out X AND Y. X is false and Y is true, so AND gives false.
  2. Work out NOT Z. Z is false, so NOT Z is true.
  3. Join the two results: false OR true. OR is true when at least one side is true, so the answer is true.
Method 2: helper columns
  1. Draw two extra columns in the table. Label one X AND Y and the other NOT Z.
  2. Fill in each helper column for the row: false and true.
  3. Read across to the final column and apply OR to the two helper values.
True, so the buzzer is on

How the case file works

Read the rule

Before filling anything in, look at how the columns connect. Notice which columns are inputs and which are results.

Fill the blank cells

Work one row at a time. Use a small helper column if it helps, and write the middle step down.

Use the table as evidence

A finished table is a record of what can and cannot happen. A story is checked against it, row by row.

Explain the verdict

Pupils write a reason that points to the table. A good answer says which values the story needs and why the table does not allow them.

Why truth tables matter in computing

A truth table lists every possible combination of inputs and shows the output for each one. It leaves nothing to chance. That makes it a reliable way to check a rule. Computers make decisions in the same way. Every condition in a program, and every simple circuit, comes down to true or false values joined by AND, OR and NOT.

The National Curriculum for England expects pupils in Key Stage 3 computing to understand simple Boolean logic and some of its uses in circuits and programming. A detective case suits this well. A suspect's story makes claims, and the table is the evidence. Pupils learn to prove something with a method, not just a hunch.

Logic facts

  • A truth table shows every possible combination of inputs and the result for each one.
  • Boolean logic is named after George Boole, an English mathematician.
  • Computers store information using two states, often written as 1 and 0.
  • Simple circuits called logic gates carry out AND, OR and NOT.
  • Programmers use the same ideas when they write conditions in code.

Skills and curriculum link

  • Completing truth tables
  • Combining AND, OR and NOT
  • Logical reasoning
  • Explaining with evidence
  • Checking claims against data

Logic rules to remember

  • ANDThe result is true only when both sides are true.
  • ORThe result is true when at least one side is true. It is also true when both are.
  • NOTThis flips a value. True becomes false and false becomes true.
  • BracketsWork out what is inside brackets first, then combine the results.

Key words

  • Truth tableA table that shows every combination of inputs and the output for each one.
  • InputA value that goes into a rule or a circuit.
  • OutputThe result a rule or circuit gives back.
  • ANDA rule that is true only when both inputs are true.
  • ORA rule that is true when at least one input is true.
  • NOTA rule that flips true to false and false to true.

How to use it

  1. Print both pages. Page 1 is for the pupil. Keep page 2 for the grown-up.
  2. Use the sheet after teaching AND, OR and NOT. Read the case file together and name each column.
  3. Work through the first row together. Say each step aloud before writing the value.
  4. Let pupils fill the rest of the blank cells, then use the finished table to judge the suspects' stories.
  5. Check against the answers on page 2. Ask pupils to explain their verdict using the table as evidence.

Help, stretch and game ideas

If it feels too hard

Let pupils work out D OR W for each row first and write it in the margin. Then apply M or NOT M to that result. Doing one step at a time stops the whole rule feeling tangled. Cover the other columns if the table looks crowded.

To stretch confident children

Ask pupils to write a new rule using NOT that rings the alarm only when the door is shut. Then ask them to build a small truth table for it. Finally, they test their rule on a partner's example to see if it holds.

Make it a game

Pupils invent their own suspect story for a partner to test against the table. The partner decides whether the story could be true and must point to the rows that prove it. Swap roles and see who can write the trickiest story.

Mistakes to watch for

Watch forA pupil treats OR as meaning only one side can be true.

Try thisRemind them OR is true when at least one side is true. Practise with a row where both sides are true.

Watch forA pupil forgets to flip the value when NOT is used.

Try thisWrite the flipped value on its own line before combining it. Say it aloud: NOT true is false.

Watch forA pupil accepts a story without checking the table.

Try thisAsk which row the story needs. Then ask them to find that row and read across.

Talk about it

  • Which column did you fill in first, and why?
  • How did you work out a row where two inputs were true?
  • What does NOT do to a value?
  • Which row convinced you that a story could not be true?
  • Could two different stories both be true? How can you tell?
  • Where might a real alarm or light use a rule like this?

Take it off the page

Human logic gates

Pupils stand up to act out AND, OR and NOT. Each pupil holds a true or false card, and the group decides who stays standing.

Rules for home

Write a rule for a daily routine using AND, OR and NOT. Then list the situations when it is true.

Write a mystery

Draft a short detective story with a clue that depends on a logic rule. A partner decides whether the story holds up.

Who it is for

Parents

Sit with your child for the first row, then let them lead. Ask them to explain each step in their own words. If they get stuck, ask them to work out D OR W first and write it down.

Teachers

Use it as a starter or homework after teaching AND, OR and NOT. It works as an early finisher task too. Page 2 gives support and stretch ideas for mixed groups, and the written explanation shows who can reason as well as calculate.

Home educators

Home educators can pair this with a simple lesson on binary or on how computers make decisions. The sheet needs only paper and a pencil. Reuse it later for revision or for younger siblings who want to try the logic.

Where this fits

Before this sheet, pupils meet true and false values, simple conditions in programs and the idea that computers work with two states. They also practise reading tables carefully.

After it, pupils can move on to logic gates, drawing circuit diagrams and writing programs with combined conditions. Those ideas build towards computer science at Key Stage 4.

Questions parents and teachers ask

What age is The Midnight Alarm Code for?

It is written for Year 9 (ages 13 to 14), in Key Stage 3. It suits pupils who have already been introduced to AND, OR and NOT and want practice using them with a table.

What will pupils practise?

Pupils practise completing truth tables and combining AND, OR and NOT. They then use the finished table to explain whether a suspect's story could be true, so they give a reason, not just a verdict.

What if it feels too hard?

Let pupils work out D OR W for each row first, then apply M or NOT M. Writing the middle result down makes each step smaller. Working the first row together also helps.

Where are the answers?

The answers are on page 2, which is for the grown-up. Page 2 also has notes on how to use the sheet, help for pupils who find it hard and a stretch idea.

Is this a screen free activity?

Yes. It needs only paper and a pencil, even though the topic is computing. It works well for quiet time, homework, a rainy day or a calm moment away from devices.

Can teachers use it in class?

Yes. It works as a starter after teaching AND, OR and NOT, or as a plenary, homework or early finisher task. It needs no preparation beyond printing, and page 2 supports mixed ability groups.

Do pupils need to know AND, OR and NOT first?

Yes, a basic idea of each helps. Recap them briefly before starting: AND needs both sides true, OR needs at least one, and NOT flips a value. Then model one row together.

Preview the full PDF

Made by Jaques of London, making games for families since 1795. A printable supports classroom learning and does not replace a teacher.