Binary and hex, bitwise flags, boolean logic, sets, modulo, Big-O, counting, probability, and geometry — the everyday math hiding inside your code, learned by building a small toolkit.
Most programmers will tell you they don't use much math at work, and then spend the afternoon debugging a hex color, a permission check, a carousel that wraps around wrongly, a price that is off by one cent, or a loop that is fine with 100 users and falls over at 100,000. All of those are math problems. They just don't look like the math from school, so nobody warned you.
This series teaches the math that actually shows up in everyday
programming, and it teaches it with code instead of proofs. You will see
why 0.1 + 0.2 !== 0.3, how a single number can store a dozen yes/no
permissions, how to simplify a tangled if using De Morgan's laws, why
% makes a carousel wrap around, how many passwords exist in a given
format, and what "O(n²)" really tells you about the code in front of you.
The first half covers how computers represent and combine values: number systems (binary, hex), bitwise operations and flags, boolean logic, sets, modular arithmetic, and the limits of integers and floating-point numbers. The second half covers how code scales and how to reason about chance: powers and logarithms, Big-O notation, counting (permutations and combinations), probability, and finally coordinates and geometry for interfaces and animation.
You won't just read about it. Across the series you build mathlab,
a small JavaScript toolkit that runs in Node.js. Each chapter adds one
module: a color converter, a permission-flag checker, a set helper, a
carousel index, a money formatter, a benchmark runner, a password-space
calculator, a collision simulator, and a few geometry helpers. By the end
you have a tested library you wrote yourself, and you know where each
piece of math came from.
You need to be comfortable with the basics of JavaScript — variables,
functions, arrays, loops, and import/export — from JavaScript &
TypeScript Fundamentals,
and with the terminal from Command Line
Basics. Bits and
Bytes in How Computers Work
is a helpful warm-up for chapters 2 and 3. You need Node.js
(the LTS version) and a code editor such as Visual Studio
Code. No math beyond school arithmetic is
assumed, and nothing costs money.
Vectors, matrices, and calculus are deliberately left out. They are covered in the planned Math for AI series, where they are needed.