Your first guess is your intuition, and intuition is natural: it shows up whether you ask for it or not, and it is right more often than you would think. The trick is not to switch it off but to use it and then examine it. Say what you expect before you look, then see what actually happens. A right guess becomes something you can trust. A wrong guess shows you exactly where your picture of the problem bends — and that is worth more than being told the answer.
Four short lessons — logic, machine learning, running time and Turing machines — made entirely of exercises that work this way. You commit to an answer; then the page shows you what happens and why. Nothing is revealed before you have guessed.
Built by Mohammad Mahmoud, a mathematician (PhD, computability and logic) who teaches theory of computation, algorithms and data structures at the University of Toronto. Plain HTML, no accounts; progress stays in your browser.
Start anywhere: each lesson stands on its own. The numbers are a suggested order, not a requirement.
Sentences with “for all” and “there exists”. Learn why swapping their order changes the meaning, practise with small games and puzzles, then write a proof and let the page try to break it.
In real life: it is the difference between “every user has a password” and “one password works for every user”. Same words, different order — and one of them is a security hole.
A computer that classifies a new point by looking at its nearest neighbours. Drag points around, change k, and watch how the decision changes.
In real life: it is the idea behind “people who bought this also bought…” — find the shoppers most like you and copy what they chose — and behind reading handwritten digits on a cheque or a postcode.
The running time of one computation is a number. The running time of a program is a function: how long it takes depending on the size of the input. Learn to count steps and compare programs.
In real life: it is why an app that feels instant with a hundred photos can crawl with a hundred thousand — and how engineers predict that before it happens.
The simplest possible computer: a tape, a head, and a short list of rules. Step through small programs one move at a time, then write one yourself.
In real life: everything your phone or laptop does, this machine can do too. That is how we know some problems no computer will ever solve — like telling in advance whether a program will finish.
One exercise from each lesson, each a minute or two long.