← Starting out

On or off

Inside a computer are tiny switches that can only be on or off. On is written 1 and off is 0. One switch makes 2 patterns, two make 4, three make 8: every switch you add doubles the patterns. Patterns of switches are how a computer stores numbers.

Inside a computer there are billions of tiny switches, and each one can only be on or off. How can that store a number, or a letter?

A switch is either on or off: nothing in between. On is written 1 and off is written 0. Each card on the board is one switch: face up is on, face down is off.

How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.

Two switches

One switch can be on or off: that's 2 patterns. How many different patterns can two switches make?

TryTry it on the board and compare the result with your prediction.

Try: find every pattern

Was your guess right?

Try it yourselfYour edits are saved in this browser.

Flip the cards to make every pattern you can. Count them as you go. Finish with both cards face up.

Use the board. This ticks when you get there.

InvestigateWork out why it happens, one step at a time.

Worked example: three switches

Worked exampleBefore each step, say what you think comes next.
  1. 00, 01, 10, 1100,\ 01,\ 10,\ 11Two switches: 4 patterns.

Now: what does face up mean?

A card is face up. What does the computer write for it?

Sam counts the patterns for two switches. Click the line where it first goes wrong.

How many patterns can three switches make?

ModifyChange the problem on purpose and see what happens.

Vary: add switches

Try it yourselfYour edits are saved in this browser.

Press Add a card until there are three cards.

Use the board. This ticks when you get there.

With three cards, make the pattern on, off, on (left to right).

Use the board. This ticks when you get there.

Add one more card in your head. How many patterns can four switches make?

PractiseA few on your own, to check you have it.

Switches

Four cards are face up, down, down, up. How does the computer write that?

How many patterns can five switches make?

Why are a computer's switches only on or off, not ten different settings?

MakeMake your own problem using what you have learned. Expect a few tries; that is normal.

A secret signal

Then: with your partner, make up a code where each pattern of three cards means something (8 messages). What would you choose?

Try it yourselfYour edits are saved in this browser.
Need a hint?

Before a hint: what kind of stuck is this? Try a strategy first

1 means face up and 0 means face down.

Another hint

Read the signal left to right, one card at a time.

Your secret signal is 0110. Set the four cards to it.

Use the board. This ticks when you get there.

Now you can
Next lesson4. Counting dotsDot cards turn switches into numbers. Each card has double the dots of the card on its right: 1, 2, 4, 8 and so on. Turn some face up and add their dots to get the number. Seven cards can make 65, the code for the letter A, so a letter is stored as switches too.
For teachers

Students flip dot cards as switches, write on as 1 and off as 0, list the patterns two and three switches make, and see that each switch doubles the patterns (AC9TDI6K04 node 1). About 35 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Do the boards yourself first. The cards are CS Unplugged's binary cards; doing it with real cards first works well. Here the dots don't count yet: this lesson is only on and off.

The one idea: on/off switches are written 1 and 0, and each switch doubles the number of patterns. No powers or place value needed; listing and doubling is enough.

Year 7–8 catch-up: How many patterns? (8K04 n2) does this with 2ⁿ; this lesson is the idea before the notation.

Running the lesson

  1. Predict: students who chose 3 missed all off; ask what 0 would look like.
  2. Try: have pairs say each pattern aloud as they flip.
  3. Worked example: build the 8 patterns on the board from the 4.
  4. Make: let partners invent a three-card code.

The hard part (on purpose)

Leaving out all off (two switches make 3). Ask every time: is all face down a pattern too?

When students get stuck

Stretch and support

Stretch: How many switches would you need to give every student in your school their own pattern?

Support: A card: up = on = 1, down = off = 0. 1 switch: 2, 2: 4, 3: 8, 4: 16.

Where it leads

Next: Counting dots (patterns become numbers).

Year 7–8: Bits and binary numbers, How many patterns?

What each step is for