Unit 0 · The Big Picture · Lesson 0.2

Everything is Bits

How can a photo, a song, and a text all travel down the same wire?

Big PictureNo grade — participation

Before this lesson — read on Runestone

Short pages, a few minutes each. Enrolled in our Runestone course? Open them from there so your progress counts.

1

Where We Are

People → Bits → Programs → Internet → Security → Big Data → Impact

Step 1 of the photo trip. Before anything can be sent, it has to become bits — and it turns out everything becomes the same kind of bits.

2

The Hook

01001000 01101001That is not a picture of anything. It is two letters. The same two symbols, arranged differently, are also every photo on your phone, every song you have played, and every video you have watched. One alphabet, two characters, everything.
3

The Idea

A wire can do two things: carry a signal, or not. On or off. That is the entire vocabulary a computer has to work with, and it never gets richer than that.

So the trick computers use is this: agree on what patterns mean. If everyone agrees that 01001000 means the letter H, then H can travel down a wire that only knows on and off.

A bit is one 0 or one 1. That is the smallest piece of information there is. Everything else is bits arranged in agreed-upon patterns.

The remarkable part is not that text works this way. It is that everything does. A photo is a grid of colors, and each color is a number. A song is the height of a sound wave measured thousands of times a second, and each measurement is a number. Numbers are bits.

That is why one wire can carry all of it. To the wire, there is no difference between your music and your homework.

4

Try It

Encode a picture by hand

Grid paper, 8×8. Draw something simple in black and white — a letter, a smiley, an arrow. Fill squares in completely or leave them blank.

Now write it as bits: 1 for filled, 0 for blank, reading left to right, top to bottom. You will end up with 64 digits.

Hand only the digits to a partner — not the picture. Can they rebuild it?

If they can, you just did what your phone's camera does, by hand, at a rate of about one pixel per second instead of twelve million.

Do it on paper first — that is the part that sticks. Then use this to check your work, or to trade with someone across the room.

Your picture, as bits

Click squares to fill them. 1 is filled, 0 is blank, read left to right and top to bottom — the same order you used on paper.

5

Vocabulary

You only need to recognize these today. Every one gets taught properly later.

bitrecognition
A single 0 or 1. The smallest unit of data there is.
binaryrecognition
Writing information using only two symbols, 0 and 1.
digital datarecognition
Data stored as discrete numbers — countable, exact, copyable.
analog datarecognition
Data that varies smoothly and continuously, like a real sound wave before anything measures it.
6

Think About It

Before you go

  1. Your 8×8 drawing took 64 bits. A real photo is about 12 million pixels, and each pixel needs more than one bit. Guess how many bits a real photo is.
  2. If a photo really is that many bits, how does it arrive in one second?

Hold onto that second question. Unit 1 answers it, and the answer is genuinely clever.

Sign in first if you want Mr. Muller to see it.
7

Connections

Came from 0.1 — this is step 1 of the photo trip, the part where light becomes numbers.
Unit 1 — does this for real, with arithmetic, file sizes, and the trick that makes a 36 MB photo fit in 3 MB.
Unit 7 — once everything is bits, everything can be scrambled on purpose. That is encryption.
← 0.1 The Photo Trip