Topics /

Math & Algorithms

The most popular blog posts about math & algorithms on Hacker News. 204 posts.

2026
183

Category Theory Illustrated – Types

In this chapter we will talk about types. This might be disappointing for you, if you expected to learn about as many new categories as possible (which you don’t even suspect are really categories till the unexpected reveal)—we’ve been talking about the category of types in a given programming language ever since the…

185

Six (and a half) intuitions for KL divergence

KL-divergence is a topic which crops up in a ton of different places in information theory and machine learning, so it's important to understand well. Unfortunately, it has some properties which seem confusing at a first pass (e.g. it isn't symmetric like we would expect from most distance measures, and it can be…

189

Squares in Squares

The following pictures show $n$ unit squares packed inside the smallest known square (of side length $s$). If a pictured packing has multiple numbers in its label above, the picture represents the largest; each smaller is represented by removing any square. For the $n ≤ 324$ not pictured, the trivial packing (with no…

192

The missing digit of Stela C

One bad thing about archeologists is that some of the successful ones get a big head. People used to think the Olmecs, who made these colossal stone heads, were contemporary with the Mayans. But in…

193

What it takes to transpose a matrix

Classical CPU architecture is a poor choice for performing matrix-oriented computations. Developers have to spend much effort to create efficient algorithms even for the problems appearing trivial on the surface. Matrix transpose is probably the most striking representative of such problems. It exposes numerous…

194

Illustration Beyond Proof

[This is a guest post by Kate Stange and Edmund Harriss. This blog post was initially written in a different file format and converted using AI. — T.] In January a group of mathematicians, hi…

196

There Is(Ǝ) – Such That (∋)

Let me tell you about a language. But if you wish to go play instead go here. It's going to get a little abstract below. There is a Canvas to Compose Upon The canvas is a square with the largest circle that has a radius of ρ. There are

198

Fast and Easy Levenshtein distance using a Trie (2011)

<img src="http://stevehanov.ca/blog/images/acer.jpg"/> If you have a web site with a search function, you will rapidly realize that most mortals are terrible typists. Many searches contain mispelled words, and users will expect these searches to magically work. This magic is often done using levenshtein distance. In…

203

Side-stepping the Secretary Problem, unwittingly

Having played both parts in the kabuki play that is employee-employer matchmaking, I feel the way we play it is a zero-sum game. I wish it were not so. When this post started life in 2024, as a wall of text chat message, it was brutal out there, on both sides of the software industry interview table. The ZIRP had…