Topics /
Math & Algorithms
The most popular blog posts about math & algorithms on Hacker News. 2,391 posts.
Fibonacci Hashing: The Optimization That the World Forgot
I recently posted a blog post about a new hash table, and whenever I do something like that, I learn at least one new thing from my comments. In my last comment section Rich Geldreich talks about h…
Why recursive data structures?
In this essay, we are going to look at recursive algorithms, and how sometimes, we can organize an algorithm so that it resembles the data structure it manipulates, and organize a data structure so that it resembles the algorithms that manipulate it.
Think Bayes: Bayesian Statistics Made Simple (2012)
This HTML version of Think Bayes is provided for convenience, but it is not the best format for the book. In particular, some of the math symbols are not rendered correctly.
Conway's Gradient of Life
What happens if we start from this configuration and take a single step of the game? Here is a snapshot of the next generation:
I know why the mathematicians weep
On technological grief
JPEG Compression
JPEG is a clever image compression algorithm that exploits a human perceptual bias and the structure of natural images. It makes a change of basis before encoding so that the rewritten image representation concentrates the signal that humans are most perceptive to, and thus, the remaining details can be discarded…
Cities: Skylines Is Turing Complete
(Non-clickbait title: building a 4-bit adder in Cities:Skylines.)
“Burning Ship” fractal
The images described here are generated by analysing the following series for each point (c x ,c y ) on the plane.
A Primer on Bézier Curves
A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them.
Convolution Is Fancy Multiplication
Like making engineering students squirm? Have them explain convolution and (if you're barbarous) the convolution theorem. They'll mutter something about…
Second-Order Thinking: What Smart People Use to Outperform (2016)
Second-order thinking is a mental model that smart people like Warren Buffett & Howard Marks use to avoid problems. Read this article to learn how it works.
Regex engine internals as a library
Over the last several years, I’ve rewritten Rust’s regex crate to enable better internal composition, and to make it easier to add optimizations while maintaining correctness. In the course of this rewrite I created a new crate, regex-automata , which exposes much of the regex crate internals as their own APIs for…
Lean proved this program correct; then I found a bug
AI agents are getting very good at finding vulnerabilities in large-scale software systems.
Statistical Formulas For Programmers
When someone says “7 is greater than 5”, you declare that they’re really the same.
A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)
Counting years backwards unlocks faster speed. The first date algorithm to use only 4 multiplications, instead of 7+
Mathematics has changed. Let's act like it
[This is a guest post by Frank Calegari. This blog post was initially written in a different file format and converted using AI. — T.] Why we should not be sad The release by OpenAI on Octobe…
My IQ
Mathematics, applications of mathematics to life in general, and my life as a mathematician.
Can AI do maths yet? Thoughts from a mathematician
So the big news this week is that o3, OpenAI’s new language model, got 25% on FrontierMath. Let’s start by explaining what this means.
P vs. NP
For those who just want the survey itself, not the backstory, it’s here. (Note: Partly because of the feedback I’ve gotten on this blog, it’s now expanded to 121 pages!) Upda…
A new fast hash table in response to Google’s new fast hash table
Hi, I wrote my new favorite hash table. This came about because last year I wrote the fastest hash table (I still make that claim) and this year one of the organizers of the C++Now conference asked…
Gödel, Escher, Bach is the most influential book in my life (2022)
Musings on Hofstadter’s phenomenal book about computation, consciousness, and epistemology.
Beautiful branchless binary search
I read a blog post by Alex Muscar, “Beautiful Binary Search in D”. It describes a binary search called “Shar’s algorithm”. I’d never heard of it and it’s i…
Applied Category Theory
It just became a lot easier to learn about applied category theory, thanks to this free book: • Brendan Fong and David Spivak, Seven Sketches in Compositionality: An Invitation to Applied Cate…