Chapter 01

The Bit

Before a single qubit, we need the thing it generalizes. A bit is the smallest unit of information — and, surprisingly, the cleanest place to meet the vectors and matrices the rest of this course runs on.

↩ before you start · keep these handy
·A vector is just an arrow written as a stack of numbers (its “components”). We will write a bit as a stack of two numbers.
·A matrix is a machine that takes an arrow in and pushes a new arrow out, row by row. Operations on a bit are matrices.
·To square a number is to multiply it by itself; probabilities are slices of one whole pie that add to 1.
🔑 symbol decoder · every new mark, in plain words
bitthe smallest unit of information — a single 0 or 1. 2ⁿ“two to the n” — multiply 2 by itself n times. It counts how many combinations n bits can name. e₀, e₁the two basis arrows: [1,0] stands for value 0, [0,1] for value 1. [p₀, p₁]a probability vector: the odds of 0 and of 1, stacked. They add to 1. log₂ x“log base 2 of x” — the power you raise 2 to in order to get x. log₂ 8 = 3 because 2³ = 8. HShannon entropy, in bits: how much you learn, on average, from one outcome.
§1

Information is answered questions

Every message, file, and computation is built from answers to yes-or-no questions. The smallest such answer — on or off, true or false, 0 or 1 — is a bit.

A classical bit is always one definite value. Flip the switch: it lands on 0 or 1, never both, never between. That definiteness is exactly what a qubit will let go of in the next chapter.

💡 everyday picture

Think of a light switch on the wall. It is either up or down — never hovering halfway, never both at once. Walk up to it and you can always read off exactly one answer. That definiteness is the whole personality of a classical bit. The strange thing a qubit will do, two chapters from now, is to genuinely hover — something a wall switch can never do.

▸ experimentbit.flip()
{{ bit }}
one bit · {{ bitState }} · two possibilities, one held at a time
recapA bit is one yes/no answer: it holds exactly one of 0 or 1 at a time.
§2

Counting with bits

One bit names 2 things. Two bits name 4. In general n bits name 2ⁿ different combinations — but the register only ever holds one of them at a time. Read right-to-left, each bit is worth twice the one before it.

✎ worked example · read 1011 in decimal
1.write the place values under the bits, right to left:  8 4 2 1
2.line up the bits:  1 0 1 1  → the 8s, 2s and 1s places hold a 1
3.add just those places:  8 + 2 + 1 = 11
▸ experimentregister[4]
{{ rb.place }}
BINARY
{{ regBinary }}
=
DECIMAL
{{ regDecimal }}
of
RANGE
0–15
recapn bits can name 2ⁿ possibilities but hold only one at a time; reading right-to-left, each bit is worth double the last.
§3 · the mathematics

A bit as a vector

Here is the move that makes everything later possible. Instead of writing the value 0 or 1, write it as a little arrow — a column vector — that points along one of two axes:

0 → e₀ = 10
1 → e₁ = 01

The two slots are "how much 0" and "how much 1." A definite bit puts a 1 in one slot and 0 in the other. If you're only unsure about a bit — say a coin you haven't looked at — you can write your knowledge as a probability vector whose entries are odds that add to 1:

p = p₀p₁   with   p₀ + p₁ = 1

And operations on a bit become matrices that multiply the vector. The NOT gate — swap 0 and 1 — is the matrix that swaps the two slots:

▸ experimentNOT · p
0110 · {{ p0f }}{{ p1f }} = {{ p1f }}{{ p0f }}
p₀{{ p0pct }}%
p₁{{ p1pct }}%

Hold onto this picture: states are vectors, operations are matrices, and probabilities live in the entries. The leap to a qubit is almost nothing more than allowing those entries to be complex numbers — and squaring them to get the odds.

recapStates are vectors, operations are matrices, and the odds live in the entries — the exact frame a qubit will inherit.
§4 · the mathematics

How much is one bit worth?

A fair coin carries exactly one bit of information — learning the outcome resolves one perfect yes/no. A biased coin carries less, because you could half-guess it already. Claude Shannon made this precise: the information in an outcome with probabilities p₀, p₁ is

$H = -\,p_0\log_2 p_0 - p_1\log_2 p_1$  bits

It peaks at exactly 1 bit for a 50/50 coin and falls to 0 when the answer is certain. Slide the bias from the experiment above and watch it move:

✎ worked example · a lopsided coin
1.a coin lands 0 with p₀ = 0.5, 1 with p₁ = 0.5 (fair):  H = −½log₂½ − ½log₂½ = 1 bit
2.now a biased coin, p₀ = 0.9, p₁ = 0.1:  H = −(0.9)(−0.152) − (0.1)(−3.32)
3.= 0.137 + 0.332 = 0.47 bits — less than 1, because you could half-guess it already
entropy at p₀ = {{ p0f }} {{ entropy }} bits
recapA fair coin carries exactly 1 bit; the more predictable a source, the fewer bits each outcome is worth.
⚠ common misconceptions

“A bit is a tiny physical object.” No — a bit is a logical distinction (one yes/no answer). It can be carried by a voltage, a magnet, a hole punched in card, or an atom; the information is the same regardless of the hardware.

“n bits store all 2ⁿ values at once.” A register of n bits can name 2ⁿ possibilities, but at any instant it holds exactly one of them. (Holding a blend of many is precisely the trick a qubit adds later.)

“More bits always means more information.” Not quite. Information depends on the odds: a coin you can already half-predict carries less than one full bit, and a coin you are sure of carries none at all.

✓ you can now
convert between binary and decimal, and say why n bits name 2ⁿ values
write a bit as a 2-slot vector and an operation (like NOT) as a matrix that acts on it
measure how much information a coin carries, and explain why a fair coin carries the most
← home next · 02 The Qubit