Maths for Programmers
The small pieces of maths that keep turning up in code: probability, primes and sequences.
The Birthday Paradox
23 people, and a 50% chance two share a birthday. It is not 23 chances. It is 253 pairs.
Not started.Beginner7 minThe Sieve of Eratosthenes
Each prime crosses out its multiples at its own tempo. The gaps where nothing lands are the primes.
Not started.Beginner7 minThe Collatz Conjecture
Halve if even, triple and add one if odd. 27 takes 111 steps to reach 1 and climbs past 9,000 on the way.
Not started.Beginner6 minBinary and Hexadecimal
Computers count with two digits. Flip the bits yourself, see what each one is worth, and find out why programmers write numbers in base 16.
Not started.Beginner8 minLogarithms
How many times can you halve a million before you reach one? Twenty. That question is all a logarithm is, and it is why log n algorithms are fast.
Not started.Beginner7 minModular Arithmetic
Arithmetic that wraps around, like a clock. It is behind hash tables, ring buffers, weekdays and most of cryptography.
Not started.Beginner7 min