Topics /

Math & Algorithms

The most popular blog posts about math & algorithms on Hacker News. 2,391 posts.

Any year
668

A study of musical scales (2017)

PREFACE. This essay was written in 2009. Since then, a few errata have been corrected and I embedded the youtube videos, but there have been no substantial additions. I think it still holds up fairly well, but if I were to rewrite it today, I would change some things. My main regret is using the criteria of maximum…

672

Matrices as Tensor Network Diagrams

In the previous post, I described a simple way to think about matrices, namely as bipartite graphs. Today I'd like to share a different way to picture matrices—one which is used not only in mathematics, but also in physics and machine learning. Here's the basic idea. An $m\times n$ matrix $M$ with real entries…

677

Who Can Name the Bigger Number?

[This essay in Spanish] [This essay in French] [This essay in Chinese] In an old joke, two noblemen vie to name the bigger number. The first, after ruminating for hours, triumphantly announces "Eighty-three!" The second, mightily impressed, replies "You win." A biggest number contest is clearly pointless when the…

678

Is the reversal curse in LLMs real?

A recent paper The Reversal Curse points out an apparent failure in large large language models like GPT-4. From the abstract: We expose a surprising failure of generalization in auto-regressive large language models (LLMs). If a model is

685

A Formula for the Number of Days in Each Month

Recently, after being awake for longer than I should have, I started thinking about methods of remembering the number of days in each month of the year. There is a rhyme for it, and a way to count on your knuckles, but these didn’t satisfy me. I wondered if there was a mathematical formula for the problem, and upon…

690

An interactive intro to quadtrees

An interactive exploration of quadtrees. Start with brute-force spatial search, build recursive space partitioning step by step, then use it for point lookups, range queries, nearest-neighbor search, collision detection, and image compression.