Jenny · Sarah
Do not disturb was on. For six days.
Sarah asks how her phone decides to show a notification.
Jenny says it’s gates. Sarah says that’s too simple.
Jenny walks her through it: the app has a new message AND notifications are on AND the phone is NOT on do not disturb.
Three conditions, two kinds of gate, one decision.
Sarah checks her settings and finds out why her group chat has been silent all week.
The short answer
By checking conditions with gates. Sarah’s phone checks “new message AND NOT do-not-disturb” before it buzzes. Grandma Ruth’s laptop checks billions of these every second. It never decides. It checks, and follows the branch.
Try it yourself
Each of these is a decision a gadget makes. Pick the gates hiding in it.
A car’s dome light comes on when the driver’s door or the passenger’s door opens.
What you just did has a name
A condition
A condition is a yes-or-no question a computer checks before acting: is the door shut, is this number bigger than that one, did the password match.
In hardware, conditions are gates. In programs, they’re written as “if this, then that.”
Either way, a computer never decides the way you do.
It checks conditions, very fast, and follows whichever branch comes out true.
A few more things
If, then, else
Almost every program is full of lines like “if the battery is below 20%, then show a warning.” Underneath, the processor compares two numbers with gates and jumps to different instructions depending on the answer.
Comparing numbers is gates too
Is 7 bigger than 5? A processor checks that with a small circuit of gates working through the bits. Module 5 shows how the same circuits do math.
Lots of small decisions
A video game deciding whether you got hit checks dozens of conditions every frame, sixty times a second. It looks like judgment. It’s a lot of very fast yes-or-no.
Go deeper
The longer version, if you want it.
Why it doesn’t feel like gates
A self-driving car seems to decide when to brake. A recommendation app seems to know what you’ll like. These systems check millions of conditions, many of them on numbers that came from huge amounts of data instead of rules a person typed in.
But all the way down, it’s the same machine: numbers in, gates checking them, an answer out. The cleverness is in how many conditions there are and where they came from, not in a different kind of thinking.
Quick check
A program shows a “low battery” warning if the battery is under 20%. What is that, to the computer?
Let’s take it slower
Think of a choose-your-own-adventure book. “If you open the door, turn to page 40. If not, turn to page 52.” The book doesn’t decide anything. It just has a branch for each answer. A program is a book like that with millions of pages, and the computer flips to the right one billions of times a second.
More examples
Automatic doors at the store
If the sensor sees motion AND the door isn’t locked for the night, open. Two conditions and a motor.
A game’s respawn
If health is zero AND lives are more than zero, respawn. Else, game over. Every game you’ve played is stacked with these.
Back to the question
So how does a computer decide anything?
Show the answer
By checking conditions with gates. Sarah’s phone checks “new message AND NOT do-not-disturb” before it buzzes. Grandma Ruth’s laptop checks billions of these every second. It never decides. It checks, and follows the branch.
One last question
Rob asks how a phone “knows” when to buzz. Who got it right?
Talk Card
Talk Card · 4.4
Your phone didn’t decide to buzz. It checked: new message, and not on do not disturb? Yes. Buzz.
How Computers Work · pettigrewlab.com/learn

