L0-08 · Store a choice with a bit
A bit holds one choice out of two, like yes or no, on or off, 1 or 0.
What you will learn¶
I can store a yes or no answer with a card.
I can write a row of cards as 1s and 0s.
I can read a code back the same way it was made.
Story: The secret card code¶
Maya wants to ask Leo four questions. Leo wants to answer without saying a word. Maya has an idea. “Let’s use cards!”
First they make a plan. A card face up means yes. A card face down means no. They will always read the cards from left to right.
Maya asks, “Do you like rain? Do you have a pet? Is blue your best color? Can you skip?” Leo puts down four cards. Up, down, up, up.
Maya reads them. “Yes, no, yes, yes!” Leo grins. She got every answer right.
Then Leo writes the row with numbers. Up is 1, and down is 0. The row says 1 0 1 1. Each card holds one choice out of two. That is a bit.
Face up means yes, or 1. Face down means no, or 0. This row says 1, 0, 1, 1.
Hands-on: Card code¶
About 15 minutes.
You need:
Four playing cards, or four paper squares with a star on one side
Paper and a pencil
Steps:
Agree on the code. Face up means yes. Face down means no.
Agree to read the cards from left to right.
Your grown-up asks four yes or no questions. Write them down in order.
For each question, put down one card, face up or face down.
Your partner reads the row back as yes or no. Did they get it right?
Now write your row as numbers. Face up is 1. Face down is 0.
Swap jobs. Your partner answers, and you read the code.
Practice together¶
A row of cards goes up, up, down, up. How do you write it with numbers?
Check your answer
Up is 1 and down is 0, so it is 1 1 0 1. That is four bits.
Try it yourself¶
1. Leo’s row is 0 0 1 0. Which question got a yes?
Check your answer
The third one. It is the only card that shows 1, so it is the only yes.
2. Sam reads the cards from right to left by mistake. Will Sam get the right answers?
Check your answer
Not always. The order is part of the code. Both people must read the same way.
Talk about it¶
Why did Maya and Leo make a plan before they started?
What else in your home is on or off, like a light switch?
How many questions could you answer with ten cards?
Check yourself¶
1. How many choices can one bit hold at a time?
A. Any number you like.
B. One choice out of two.
C. Two choices together.
Show the answer
B. One choice out of two.
A bit is like one card. It is up or it is down. It shows one of two choices.
2. Your code says face up is 1. Your row is down, up, up, down. What do you write?
A. 0 1 1 0
B. 1 0 0 1
C. 0 1 1 1
Show the answer
A. 0 1 1 0
Down is 0 and up is 1. So down, up, up, down is 0 1 1 0.
3. Remember Lesson 2. You sort buttons. What should your rule do? (Review of L0-02)
A. Change halfway through the sort.
B. Say clearly which group each button goes in.
C. Leave out the tricky buttons.
Show the answer
B. Say clearly which group each button goes in.
A good rule is clear, so each thing goes in one group. A card code is like that. Each card is up or down, and never both.
Words to know¶
- bit
- One spot that holds one of two choices, like 1 or 0.
- code
- A way to show a message that both people agree on.
For grown-ups: about this lesson
Why it matters. This lesson introduces the bit, the smallest unit of information: one choice between two states. Unplugged activities use two-sided cards in a similar way to show how two-state symbols can store information CS Unplugged, n.d.. The key ideas are that a code needs an agreement (which side means what) and an order (which card comes first). Computers store information using very many bits.
Watch for these mix-ups.
A 0 means nothing is there. (Here 0 is a real answer, no, just as 1 is yes.)
Any reader can read the code. (Both people must agree on what each side means and which end to start from.)
A bit can hold a whole word. (One bit holds only one of two choices; a word needs many bits.)
To make it easier. Use two cards and two questions. Say the words yes and no first, then add 1 and 0 at the end.
To make it harder. Ask how many different rows four cards can make. Try listing them in an organized way; there are 16. Note that this activity stores answers; it is not yet counting in binary, which comes later.
Limits. Real computers do not use cards; they keep bits as tiny electrical or magnetic states. The card code shows the idea of a two-choice symbol, not how the hardware works. A quantum bit, met later in the course, behaves differently from an ordinary bit.
On the computer. Grown-ups can see where this idea leads later in Lab: Qubits and the Bloch sphere, written for older learners.
Sources for this guide. CS Unplugged, n.d.
Next: L0-09 · A clue is not a cause
- CS Unplugged. (n.d.). Binary numbers. CS Unplugged. https://www.csunplugged.org/en/topics/binary-numbers/