Tutorpip← About this lessonAHide the answer keyDownload PDF
Coding · Ages 10+ · Set A
The two-key lamp
Scan to mark
on screen
A
Name
Date
Start Finish
Goal: 15 min
Score/ 11
Remember: A truth table lists every way the switches can be set, and the answer for each. Each extra switch doubles the rows.

Read and answer

Read the story, then answer.

The bug that hidLeo and his twin Ada are building a two-key lamp for the robot club. It has to light only when switch one and switch two are both on. Leo tries both switches off, and the lamp stays dark, then both on, and it lights, so he says it works. Then Ada flips only the first switch, and the lamp lights when it should stay dark. The bug hid in the rows Leo skipped. They list every way the two switches can be set: off and off, off and on, on and off, on and on. Each switch is off or on, so two switches make two times two, four rows. Beside each row they write what the lamp should do, and that is a truth table. Leo rewires his switches in a row, one after the other, so the current needs both.
1
Leo's lamp lights only when both switches are on (AND). Which row lights it?
Row ARow BRow CRow D
2
An OR lamp lights when either switch is on. Which row is the only dark one?
Row DRow CRow A
3
How many rows does a table for three switches have?
6 rows8 rows4 rows
4
Each extra switch the rows.
halvesadds one todoubles
5
Two tries are enough to check a lamp.
TrueFalse
6
A truth table lists every way the switches can be set.
TrueFalse

Match, order and fix

7
Join each table to its number of rows.
  1. 1one switch
  2. 2two switches
  3. 3three switches
  4. 4four switches
  • A16 rows
  • B2 rows
  • C8 rows
  • D4 rows
8
Leo finds his bug. Put the story in order.
  • Ada flips only the first switch and the lamp lights
  • Leo rewires the switches in a row
  • Leo tries both off and both on
  • They list every row of the table
9
Leo tried only two rows and said the lamp works. What is the mix-up to fix?
Two tries are enoughHe did not check every rowThe lamp needs more switches
10
Three switches have the same number of rows as two switches.
TrueFalse
11
A truth table has 16 rows. It is for switches.
12
Write a rule with two parts, like: I can watch a show if homework is done and chores are done.
13
Draw a table with four rows for two switches, off or on.
Scan the code at the top to mark this sheet on screenTake a photo of your answers or type them. It is marked for you automatically, and your score is kept.
Answer key · Set A
The two-key lamp
1Row D AND needs both switches on, and only row D has both on.
2Row A OR is dark only when both switches are off, which is row A.
38 rows Each extra switch doubles the rows: two switches have 4 rows, and three have 8.
4doubles One switch has two rows, two have four, and three have eight.
5False Two tries leave other rows unchecked, and a bug can hide in a row you skipped.
6True A table never skips a row, even a dull one.
71-B, 2-D, 3-C, 4-A Each extra switch doubles the rows: 2, 4, 8, 16.
82, 4, 1, 3 Leo's two tries look fine, Ada finds the bug, the table checks every row, and then Leo can fix it.
9He did not check every row A bug can hide in the rows you skip. A truth table checks every row.
10False Three switches have eight rows, and two switches have only four.
114 One switch has 2 rows, two have 4, three have 8, and four switches have 16 rows.
12Your own words: a grown-up reads it.
Mark each answer, count the right ones and write the score on the sheet.