The channel
A transmitter sends symbols down a wire to a receiver. The wire passes frequencies only up to B = 3000 Hz, and noise is added on the way. How many bits a second can get through with almost no errors?
A symbol is one pulse with one chosen voltage. Nyquist showed a channel of bandwidth B carries at most 2B independent symbols a second: 2 × 3000 = 6 000. Send faster and neighbouring symbols smear together.
Levels and noise
Each symbol picks one of M voltage levels, so it carries log₂ M bits. Four levels carry 2 bits; sixteen carry 4. With no noise we could use a million levels and send without limit.
Noise adds a random voltage to each symbol. Here the signal power is 15 times the noise power: S/N = 15, about 11.8 dB. The receiver picks the nearest level. With 4 levels it got 1 of 24 wrong.
Squeeze 16 levels into the same power and they sit only 0.22 V apart, closer than the noise spreads. Same noise, and now 12 of 24 picks are wrong. Extra levels stop adding information.
Voltages scale as the square root of power, so roughly √(1 + S/N) = √16 = 4 levels can be told apart. That is log₂ 4 = 2 bits per symbol, times 6 000 symbols a second: 12 000 bits a second.
Shannon's formula
Shannon (1948): C = B·log₂(1 + S/N) bits a second. Here 3000 × log₂ 16 = 12 000. Below C, a good code makes errors as rare as you like; above C, no code can. Plain 4 levels erred; coding closes that gap.
Double the signal power: S/N = 30. C = 3000 × log₂ 31 = 14.9 kbit/s, only 24% more. Power sits inside the logarithm: one more bit per symbol needs S/N = 63, about four times the power.
Double the bandwidth instead. White noise has the same power in every hertz, so N doubles and S/N falls to 7.5. C = 6000 × log₂ 8.5 = 18.5 kbit/s. With endless bandwidth C stops at 1.44·S/N₀ = 64.9 kbit/s.
The floor and the code
Energy per bit, Eb, is power divided by bit rate. Even with endless bandwidth, reliable bits need Eb/N₀ ≥ ln 2, or −1.59 dB. No code beats that. Long LDPC codes, used in Wi-Fi and 5G, come very close.
In Python with numpy, np.log2 gives the base-2 logarithm, so one line gives C = 12000.0 bit/s. Give S/N as a power ratio: convert decibels first with snr = 10 ** (db / 10).
The working
# step 1/11 · question
transmitter -> channel -> + noise -> receiver
bandwidth B = 3000 Hz
signal power S (what arrives)
noise power N in the band
S/N = 15 (a power ratio)
= 10·log10(15) = 11.76 dB
the question: the most bits per second
that can arrive almost error-free
B = 3000 Hz and S/N = 15 are chosen so the numbers come out round (log₂ 16 = 4); they are an example, not a particular cable. The noise is a seeded random draw, the same in every run, and every number in the figure is computed from this model. The motion is slowed down a great deal: the real link sends 6000 symbols a second.