Topics /

Math & Algorithms

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

Any year
811

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…

817

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…

818

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

828

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…

834

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.

840

Deciphering the postcard-sized raytracer

"He's done it again!" was my first thought as I looked at the back of a postcard sized Pixar flier [1] which was covered in code. In the lower right corner, the blob of statements and expressions had been signed by none other than Andrew Kensler. For those who are not familiar with him, Andrew is the programmer who…