The two-state (on/off) system

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

The two-state (on/off) system

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A light switch is either off or on. Is this a two-state system?
A Yes, it has only two possible conditions
B No, it needs ten conditions to count
2. In binary, which pair of digits is used to write the two states?
A 0 and 1
B 1 and 2
3. A light switch is off. Which digit shows this state?
A 1
B 0
4. A row of 4 lights is on, off, on, on. How is this written in binary?
A 1101
B 1011
5. Which of these is NOT a two-state system?
A A dimmer dial with 10 brightness levels
B A door that is open or closed

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1off = 0, on = 1 AA light switch only has two states, off and on, so it uses only 0 and 1. There is no state 2.
2light switch: 0 or 1 BA light switch has only two states, so it can be shown with one binary digit.
3Three light switches in a row can show a binary pattern, where off is 0 and on is 1. CThe usual rule is the other way round: off is 0 and on is 1.
4A binary bracelet uses two bead colours: one colour means 0 and the other means 1. Doff on on = 011
5A light switch has 3 states: 0, 1, 2 EA two-state system written in binary: off is 0 and on is 1.
6off = 1, on = 0 (in the usual binary rule) Fwhite = 0, black = 1: black white black = 101

Definitions

two-state system

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
light ← _ // the light is off
2.
bead ← _ // the bead is on
3.
IF switch = _ THEN DISPLAY "Light is on" END IF
4.
states ← _ // off and on
5.
switch ← ___ switch // flip the state

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A light = "off"
B state = 2
C if light == "on":
D state = 1
E print(state)
Question 2
A switch = 1
B if switch == 1:
C print("light is off")
D else:
E print("light is off")
Question 3
A states = ["off", "on"]
B switch = 1
C print(states[2])
Question 4
A light = "on"
B if light = "on":
C bit = 1
D else:
E bit = 0
Question 5
A states = ["off", "on", "dim"]
B print(len(states))
C # output: 2

Answer Key

The two-state (on/off) system
Section A: Quick Questions
Q1
A — Yes, it has only two possible conditions
Q2
A — 0 and 1
Q3
B — 0
Q4
B — 1011
Q5
A — A dimmer dial with 10 brightness levels
Section B: Match the Pairs
Q1
off = 0, on = 1 → A two-state system written in binary: off is 0 and on is 1.
Q2
light switch: 0 or 1 → A light switch has only two states, so it can be shown with one binary digit.
Q3
Three light switches in a row can show a binary pattern, where off is 0 and on is 1. → off on on = 011
Q4
A binary bracelet uses two bead colours: one colour means 0 and the other means 1. → white = 0, black = 1: black white black = 101
Q5
A light switch has 3 states: 0, 1, 2 → A light switch only has two states, off and on, so it uses only 0 and 1. There is no state 2.
Q6
off = 1, on = 0 (in the usual binary rule) → The usual rule is the other way round: off is 0 and on is 1.
Section C: Definitions
Q1
two-state system — A system with only two possible conditions, like a light switch being off or on. We write the two states as 0 and 1, which is the idea behind binary.
Section D: Fill in the Blanks
Q1
light ← 0 // the light is off
Q2
bead ← 1 // the bead is on
Q3
IF switch = 1 THEN DISPLAY "Light is on" END IF
Q4
states ← 2 // off and on
Q5
switch ← NOT switch // flip the state
Section E: Spot the Error
Q1
B — A two-state system only has the values 0 and 1. Off is written as 0, so the line should be state = 0, not 2.
Q2
C — The value 1 means on. When switch == 1 the program should print "light is on", not "light is off".
Q3
C — A two-state list only has positions 0 (off) and 1 (on). Position 2 does not exist. It should be states[switch] or states[1].
Q4
B — A single = assigns a value. To check whether the light is on, use the comparison ==, so the line should be if light == "on":.
Q5
A — A two-state system has only two conditions. Adding "dim" makes three states, so the list should be just ["off", "on"].