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+
Topics /
The most popular blog posts about math & algorithms on Hacker News. 2,851 posts.
Counting years backwards unlocks faster speed. The first date algorithm to use only 4 multiplications, instead of 7+
Introduction You may have heard of the Kelly bet allocation strategy. It is a system for correctly exploiting information or bias in a gambling situation. It is also known as a maximally aggressive…
[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…
Mathematics, applications of mathematics to life in general, and my life as 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.
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…
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…
Musings on Hofstadter’s phenomenal book about computation, consciousness, and epistemology.
We introduce FunSearch, a method for searching for “functions” written in computer code, and find new solutions in mathematics and computer science. FunSearch works by pairing a pre-trained LLM, whose goal is to provide creative solutions in the form of computer code, with an automated “evaluator”, which guards…
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…
Recent advances in quantum hardware and software have accelerated the timeline on which quantum attack might happen. Cloudflare is responding by moving our target for full post-quantum security to 2029.
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…
Exploring the Weapon-Target Assignment problem: how missile defense connects to NP-completeness, SSPK probability calculations, and how saturation attacks exploit computational limits.
This is a set of notes for learning calculus using the Julia language. Julia is an open-source programming language with an easy to learn syntax that is well suited for this task.
I had to get there eventually. I had a blog post called “I Wrote a Fast Hashtable” and another blog post called “I Wrote a Faster Hashtable.” Now I finally wrote the fastest…
This tutorial aims to give a gentle introduction to diffusion models, with a running example to illustrate how to build, train and sample from a simple diffusion model from scratch.
From the highly eclectic blog of Mark Dominus
Introduction to quaternions and rotations in 3D.
This articles describes how Kalman filters and other state estimation techniques work, focusing on building intuition and pointing out good implementation techniques.
This post is an anecdote from over a decade ago, of which I lost the actual code. So please forgive me if I do not accurately remember all the details. Some details are also simplified so that anyone that likes computer security can enjoy this article, not just those who have played World of Warcraft (although the…
This article is available in German at Heise Online . In 1993, Intel released the high-performance Pentium processor, the start of the long...
A curious pattern in polar plots with prime numbers, together with discussion of Dirichlet's theorem
Finding the median in a list seems like a trivial problem, but doing so in linear time turns out to be tricky. In this post I’m going to walk through one of my favorite algorithms, the median-of-medians approach to find the median of a list in deterministic linear time. Although proving that this algorithm runs in…
MIT’s Erik Demaine improves on his landmark, 18-year-old algorithm for generating origami folding patterns for any 3-D shape. The new work adds the requirement of “watertightness,” or minimizing the number of seams in an origami approximation of a closed surface.
Regular expressions are extremely powerful. This is something I read at least once or twice every day while reading articles and blogs on the Web.