Please enable JavaScript to use CodeHS

Quantum Computing

When Quantum Beats Classical

Quantum computers aren't faster at everything — they're astonishingly better at certain problems. Learn which ones, and the trick that makes it work.

Quantum ~10 min Beginner friendly
The Big Idea

Interference, not brute force

You may have heard that a quantum computer is fast because it "tries every answer at once." It's a catchy line — and it's misleading. If qubits really held every answer, measuring them would just hand you one random pick. Most of the time you'd get a wrong answer back.

The real trick is interference. Before measuring, a quantum algorithm choreographs the qubits so the waves behind the wrong answers cancel each other out, while the wave behind the right answer builds up. Then, when you measure, the right answer is the one you're most likely to see.

Simple definition: a quantum speedup uses interference to boost the chance of the right answer — instead of checking possibilities one by one.

This is more than a party trick. Grover's algorithm can find one item hiding in a list of N items in about √N steps — so a million doors take about a thousand steps, not a million. And Shor's algorithm can factor giant numbers far faster than any known classical method, which is a big deal for the encryption that protects data today.


Try It

The great door race

One prize is hidden behind one of 16 doors. Race it two ways.

On the left, play like a classical computer: click doors one at a time until you find it. On the right, play quantum-inspired: press "Quantum step" and watch the right door's glow grow while the wrong doors fade.

Door race 16 doors · 1 prize

Classical

Click doors one by one.

Guesses used: 0

Quantum-inspired

Amplify the right door step by step.

Steps used: 0 · right-door glow: 6%

A metaphor for amplitude amplification — real quantum computers choreograph probabilities.

Count your guesses on the classical side: on average you'll need about half the doors — roughly 8 or 9. The quantum side opens its door in about √16 = 4 steps, every time. Now scale it up: with a million doors, classical search takes about half a million guesses on average, while the quantum trick takes about a thousand.


Keep It Honest

What quantum can't speed up

Quantum computers are not faster at everything. Browsing the web, streaming video, running your everyday apps — a classical computer already handles those brilliantly, and quantum hardware would be slower, fussier, and wildly more expensive for them.

Quantum wins on problems with a hidden structure it can exploit: searching an unsorted space, simulating molecules, certain optimizations, and factoring. Those are the problems where wrong answers can be made to cancel and the right answer to reinforce.

Honesty check: our door race is a metaphor. Real quantum chips are noisy and hard to control, and too many steps can overshoot and dim the right answer again — engineers have to stop at just the right moment.

So a future quantum computer won't replace your laptop. It will be more like a specialist you call in for the few problems where interference pays off — while a classical computer does everything else.


Why It Matters

Why the speedup matters

The problems quantum is good at aren't random curiosities — they're some of the most valuable problems we have.

  • Simulating molecules could speed up drug discovery and help design better batteries and materials.
  • Optimization could help route delivery trucks, schedule factories, and plan power grids more efficiently.
  • Factoring is why researchers are already building "quantum-safe" encryption to protect data before big quantum machines arrive.
  • Searching huge spaces faster shows up in everything from logistics to machine learning.

That's also why a brand-new job field is opening up — quantum software engineers, quantum hardware scientists, and the people who translate real-world problems into circuits. Understanding when quantum helps is step one of joining them.


Your Turn

Check your understanding

Why is "a quantum computer tries all answers at once" a misleading way to explain the speedup? What's actually going on?

Your answer:

Sample answer: If qubits really tried every answer at once, measuring them would just return one random answer — usually a wrong one. The real trick is interference: the algorithm amplifies the probability of the right answer while canceling the wrong ones, so measurement is very likely to reveal it.


Check Yourself

Quick quiz

1. What actually makes a quantum algorithm faster on the problems it wins at?

2. A prize hides behind one of 1,000,000 doors. About how many steps does Grover's search algorithm need?

3. Which of these is quantum computing NOT expected to speed up?

Keep exploring quantum

You've seen when quantum wins — and when it doesn't. Next, meet the real machines being built today and the problems people are already pointing them at.

Part of the Quantum Computing tutorial series.