Each extra bit doubles the number of patterns: n bits make 2ⁿ patterns. One pattern is 0, so the largest number is 2ⁿ − 1: four bits hold 0 to 15, eight bits (a byte) hold 0 to 255. Count one past the largest and the bits overflow back to 0.
Colour values in a program stop at 255, and old game scores wrapped round to 0. Both come from the same rule about bits.
In Bits and binary numbers, each card was worth double the card on its right. Now the question is how many different numbers a set of cards can show, and what happens when you run out.
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
The biggest number
TryTry it on the board and compare the result with your prediction.
Try: count up
Was your prediction right? Watch the 1 card as you count: it flips every time.
Try it yourselfYour edits are saved in this browser.
Press + 1 to count up until every card is face up. What number is it?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: count the patterns
Worked exampleBefore each step, say what you think comes next.
1111=8+4+2+1=15All cards face up is the biggest number.
0000=0All cards face down is the smallest.
2×2×2×2=24=16Each card has 2 choices, so each card doubles the patterns.
0 to 1516 patterns, and one of them is 0, so the biggest is 15.
24−1=15With n bits: 2n patterns, and the biggest number is 2n−1.
Now try five bits.
What is the biggest number **five** bits can show?
Sam works out how many numbers 4 bits can show. Click the line where the working first goes wrong.
How many different patterns can **three** bits make?
ModifyChange the problem on purpose and see what happens.
Vary: one change at a time
Keep doubling: 1, 3, 7, 15, 31, 63, 127. Which is the first that reaches 100?
Try it yourselfYour edits are saved in this browser.
The board shows 1111, which is 15. Press + 1 once. What happens to the cards?
Use the board. This ticks when you get there.
Press Add a card. What is the new card worth? Make the biggest number five cards can show.
Use the board. This ticks when you get there.
Add one more card and make the biggest number six cards can show.
Use the board. This ticks when you get there.
Eight bits are called a **byte**. What is the biggest number a byte can hold?
What is the **fewest** bits that can hold the number 100?
PractiseA few on your own, to check you have it.
Patterns and limits
How many different patterns can **ten** bits make?
In many programs, the amount of red in a colour goes from 0 to 255. How many bits store it?
What is the biggest number **three** bits can show?
Review: what number is **10101** in binary?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Enough bits
Then: how many more students could join before you need a seventh card?
Try it yourselfYour edits are saved in this browser.
Need a hint?
How big a number must the cards show? Add cards until they can show it.
Another hint
Five cards stop at 31. Is that enough for 39?
Another hint
Six cards: 32 + 4 + 2 + 1.
A school gives each student in a group an ID number from 0 to 39. Use the fewest cards that can show 39, then set them to 39.
Use the board. This ticks when you get there.
For teachers
Students count up on binary cards to find that n bits make 2ⁿ patterns and hold 0 to 2ⁿ − 1, see a count overflow, and choose how many bits a number needs (AC9TDI8K04). About 40 minutes.
I can work out how many patterns some bits can make.
I can find the biggest number some bits can hold.
I can explain overflow, and choose how many bits a number needs.
Before class
Do the Try and Vary boards yourself first. Students need Bits and binary numbers (reading binary) and powers of 2 from maths.
The one idea: each extra bit doubles the number of patterns, so n bits make 2n patterns, and because one pattern is 0, the largest number is 2n−1. Overflow is what happens when you count past it.
Real examples worth a minute: colour values 0 to 255 (one byte each); the micro:bit LED brightness 0 to 255; game scores and counters that wrapped round. Students who have done Arcade or micro:bit can look for 255 limits in the blocks.
Running the lesson
Predict: students who chose 16 counted the patterns but forgot 0; 4 counted the cards.
Try: ask how many presses it took to get from 0 to 1111, and how many patterns that makes.
Worked example: pause before line 3 and ask why we multiply, not add.
Vary: before Add a card, ask students to predict the new card's value and the new biggest number.
Make: have students say the range first (0 to 39), then the bits.
The hard part (on purpose)
Forgetting that one pattern is 0, so saying 4 bits go up to 16. Ask "what do the cards show when they are all face down?" every time a largest number comes up.
When students get stuck
A student says 4 bits hold 1 to 16 (Sam's mistake). Ask: What number do the cards show when they are all face down? Fix: 0 is one of the patterns, so the 16 patterns are 0 to 15.
A student says 10 bits make 20 patterns. Ask: What happens to the patterns when you add one card? Fix: Each card doubles them: 2, 4, 8, 16, …, so multiply.
A student thinks overflow is an error message. Ask: What does + 1 do to 1111 if there is no fifth card? Fix: Every card flips down: the computer just loses the carry.
Stretch and support
Stretch: How many bits would you need to give every person on Earth (about 8 billion) a different number? (33: 2³² is about 4.3 billion, 2³³ about 8.6 billion.)
Support: Keep a doubling table beside the board: bits 1 to 8, patterns 2 to 256, biggest 1 to 255.
Where it leads
Builds on: the data as numbers lessons. Colour amounts (0 to 255) are one byte each, and 16-bit audio has 2¹⁶ = 65 536 levels: ask students to explain both now.
Where it leads: data sizes (bytes, kilobytes) and, in Years 9–10, compression.
the biggest number: Committing to the largest 4-bit number shows whether students forget that one pattern is 0 (16), confuse it with the number of cards (4), or read 1111 as a base-10 number.
Try: count up: Counting up with + 1 until every card is face up settles the prediction: the count stops at 1111, which is 15.
Worked example: count the patterns: Counting the patterns as 2 × 2 × 2 × 2 models the new move: n bits give 2ⁿ patterns and the largest is 2ⁿ − 1. Sam counts 16 patterns and then forgets 0, the misconception planted after the method.
Vary: one change at a time: Each task changes one thing: one more past the largest (overflow), one more card (patterns double), another card, then a byte, then the edge case of choosing how many bits a number needs.
patterns and limits: Patterns and largest numbers for other bit counts, overflow in a real context, why colour values stop at 255, and a review of reading binary from lesson 1.
enough bits: Choosing the fewest cards for a given range reverses the process: students start from the largest number needed and work out the bits, then check it on the board.
Now you can
Work out how many patterns some bits can make.
Find the biggest number some bits can hold.
Explain overflow, and choose how many bits a number needs.