Topics /
Math & Algorithms
The most popular blog posts about math & algorithms on Hacker News. 2,391 posts.
Reverse-engineering the problematic tail behavior of Fivethirtyeight forecast
We’ve been writing a bit about some odd tail behavior in the Fivethirtyeight election forecast, for example that it was giving Joe Biden a 3% chance of winning Alabama (which seemed high), it was displaying Trump winning California as in “the range of scenarios our model thinks is possible” (which didn’t seem right)…
Why machine learning struggles with causality
Machine learning systems thrive on finding and exploiting statistical regularities. This is why they can't do causal reasoning.
What is Hindley-Milner and why is it cool? (2008)
Anyone who has taken even a cursory glance at the vast menagerie of programming languages should have at least heard the phrase "Hindley-Milner". F#, one of the most promising languages ever to emerge from the forbidding depths of Microsoft Research, makes use of this mysterious algorithm, as do Haskell, OCaml and ML…
A visual exploration of vector embeddings
For Pycon 2025, I created a poster exploring vector embedding models, which you can download at full-size . In this post, I'll translate ...
Can you be sure to clear a line at Tetris?
Summary: it is possible to play Tetris and guarantee that you will score at least one line, no matter which pieces are given to you, i.e., even assuming they are chosen adversarially.
Zero Knowledge Proofs: An illustrated primer
One of the best things about modern cryptography is the beautiful terminology. You could start any number of punk bands (or Tumblrs) named after cryptography terms like ‘hard-core predicate&#…
A Short Intro to Constraints
The essence of constraint is projection.
Fundamental Algorithms III
Three more fundamental algorithms in the series. Today, recursive permutations, subsets of the given set and variations with repetitions. Th...
The control group is out of control (2014)
I. Allan Crossman calls parapsychology the control group for science. That is, in let’s say a drug testing experiment, you give some people the drug and they recover. That doesn’t tell …
Death by hockey sticks
You may be familiar with the term “hockey stick curve,” used describe a trend that has been flat/stable for a very long time, but shoots up at the end of the series in dramatic fashion, resembling the shape of a hockey stick. Hockey can be a violent sport, and it’s easy to get hurt by even one well-aimed swing…
Why Bayesian Stats Needs Monte-Carlo Methods
Bayesian statistics rely heavily on Monte-Carlo methods. A common question that arises is “isn’t there an easier, analytical solution?” This post explores a bit more why this is by breaking down the analysis of a Bayesian A/B test and showing how tricky the analytical path is and exploring more of t
Elsevier journals – some facts
Update: figures now in from Imperial. See below. Further update: figures in from Nottingham too. Further update: figures now in from Oxford. Final update: figures in from LSE. A little over two yea…
An Algebra of Graphs
Graph theory is my favourite topic in mathematics and computing science and in this blog post I’ll introduce an algebra of graphs that I’ve been working on for a while. The algebra has become my go-to tool for manipulating graphs and I hope you will find it useful too.
Playing with Wolfram Playing Cards
A few weeks ago, I knocked my favorite mug off the counter and it shattered. RIP:
Logistic Regression from Bayes’ Theorem
In this post we’ll explore how we can derive logistic regression from Bayes’ Theorem. Starting with Bayes’ Theorem we’ll work our way to computing the log odds of our problem and the arrive at the inverse logit function. After reading this post you’ll have a much stronger intuition for how logistic
Rendering a Buddhabrot at 4K and Other Bad Ideas
Benedikt Bitterli's Portfolio
A Detailed Elliptic Curve Cryptography Tutorial
When adding two integers i and j of bitlength b, the result will be of bitlength b + 1 in the worst case. This means they can easily be naively added. If the result is larger or equal to F p one has only to subtract p from the result, i.e.:
Why Quantum Mechanics?
In the past few months, I’ve twice injured the same ankle while playing with my kids. This, perhaps combined with covid, led me to several indisputable realizations: I am mortal.Despite my se…
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…
How does cosine similarity work?
Cosine similarity measures the angle between two vectors — the dot product divided by the product of their magnitudes. Here's what each part of the formula does.
Mandelbrot deep zoom theory and practice (2021)
Perturbation and rescaling for efficient rendering of fractal images.
How inevitable is the concept of numbers?
Stephen Wolfram considers if numbers are actually required, the use of symbolics and the potential for the growing role of computational irreducibility.
What is the Axiom of Choice?
One of the easiest ways to start a (friendly) fight in a group of mathematicians is to bring up the axiom of choice. I'll explain what it is, why it's so controversial, and hopefully shed some light on how we choose axiomatic systems and what that means for the math we do.
How long does music stardom last? A statistical analysis
When do music stars achieve fame, and how long does fame typically last?
How to explain infinity to kids
From the highly eclectic blog of Mark Dominus
Why Does Integer Addition Approximate Float Multiplication?
Here is a rough approximation of float multiplication (source): float rough_float_multiply(float a, float b) { constexpr uint32_t bias = 0x3f76d000; return bit_cast<float>(bit_cast<uint32_…