Topics /
Math & Algorithms
The most popular blog posts about math & algorithms on Hacker News. 266 posts.
Ace of Aces: Why you should do maths as a game designer
Every now and again you come across something that stretches your brain in a new direction. Last week I stumbled on a magic trick of a Choose Your Own Adventure: Al Leonardi’s Ace of Aces, a paper …
A brief introduction to interval arithmetic
Why x^2 isn't always x*x.
Tritone Substitutions
A ‘tritone substitution’ is a popular trick for making your music sound more sophisticated. I’ll show you a couple of videos with lots of examples. But since I’m mathematici…
A High-Level Technical Overview of Homomorphic Encryption
About two years ago, I switched teams at Google to focus on fully homomorphic encryption (abbreviated FHE, or sometimes HE). Since then I’ve got to work on a lot of interesting projects, learning along the way about post-quantum cryptography, compiler design, and the ins and outs of fully homomorphic encryption. If…
Better-performing “25519” elliptic-curve cryptography
Automated reasoning and optimizations specific to CPU microarchitectures improve both performance and assurance of correct implementation.
Seven basic rules for causal inference
Personal website of Dr. Peder M. Isager
General Theory of Neural Networks
From gene regulatory networks to artificial neural networks
SQL is syntactic sugar for relational algebra
This idea is particularly sticky because it was more or less true 50 years ago, and it's a passable mental model to use when learning sql. But it's an inadequate mental model for building new sql frontends, designing new query languages, or writing tools likes ORMs that abstract over sql.
Diffusion Forcing: Next-Token Prediction Meets Full-Sequence Diffusion
Official Website of Diffusion Forcing
An Intuitive Explanation of Black–Scholes
The Black–Scholes formula is the crown jewel of quantitative finance. The formula gives the fair price of a European-style option, and its success can ultimately be measured by its impact on option markets. Before the formula’s publication in 1973 (Black & Scholes, 1973; Merton, 1973) , option markets were relatively…
Adding row polymorphism to Damas-Hindley-Milner
Intro to HM
Music and Geometry: Intervals and Scales
An article about music and geometry, in particular about musical intervals and scales and their geometric equivalent ...
Probability-generating functions
I have long struggled with understanding what probability-generating functions are and how to intuit them. There were two pieces of the puzzle missing for me, and we’ll go through both in this article.
Lewis Carroll – computing the day of the week for any given date (1887)
A letter from Lewis Carroll to Nature, March 31, 1887: Having hit upon the following method of mentally computing the day of the week for any given date, I send it you in the hope that it may interest some of your readers. I am not a rapid computer myself, and as I find my average time for doing any such question is…
A new rare high-rank elliptic curve, and an orchard of Diophantine equations
I got an email the other day from mathematician Bogdan Grechuk, whose book Polynomial Diophantine Equations: A Systematic Approach ( was recently released. This is to my mind a rather remarkable bo…
There's more to mathematics than rigour and proofs (2007)
The history of every major galactic civilization tends to pass through three distinct and recognizable phases, those of Survival, Inquiry and Sophistication, otherwise known as the How, Why, and Wh…
The expected value of the game is positive regardless of Ballmer’s strategy
A few days ago John Graham-Cumming posted about “Steve Ballmer’s incorrect binary search interview question” which drew a lot of attention on Hacker News. The Ballmer’s favorite brain teaser goes like this:
The new APT 3.0 solver
APT 2.9.3 introduces the first iteration of the new solver codenamed solver3, and now available with the –solver 3.0 option. The new solver works fundamentally different from the old one. How does it work? Solver3 is a fully backtracking dependency solving algorithm that defers choices to as late as possible. It…
Stacking triangles for fun and profit
One thing you may have noticed about the trigonometric functions sine and cosine is that they seem to have no agreed upon definition. Or rather, different authors choose different definitions as the starting point, mainly based on convenience. This isn’t problematic or even particularly unusual in mathematics: as long…
B-Trees Require Fewer Comparisons Than Balanced Binary Search Trees
A blog by and for database architects.
The bunkbed conjecture is false
What follows is an unusual story of perseverance. We start with a conjecture and after some plot twists end up discussing the meaning of truth. While the title is a spoiler, you might not be able t…
Primitive Recursive Functions for a Working Programmer
Programmers on the internet often use Turing-completeness terminology. Typically, not being Turing-complete is extolled as a virtue or even a requirement in specific domains. I claim that most such discussions are misinformed --- that not being Turing complete doesn't actually mean what folks want it to mean, and is…
Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
Efficient filtering of polygonal shapes with closed-form solutions based on Green’s theorem with piecewise-polynomial filters (e.g. box/bilinear/bicubic).
Adventures in algorithmic trading on the Runescape Grand Exchange
Runescape has been a game near and dear to my heart since I was a child. Though I do not actively play anymore, it still functions as an interesting programming project substrate. Most recently, I created a bot that automatically executes trades on the Grand Exchange in order to conduct market making via common…
Using Euro coins as weights (2004)
Here is a cheap way to obtain a set of standard weights, for measuring weights up to about 100 gram, to an accuracy of about 0.5 gram : Use the coins of the currency of your country. Thus one can make use of the fact that these coins are fabricated in mass production, and because of that have not only a constant shape…