Topics /

Math & Algorithms

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

2024
212

Hacking physics from the back of a napkin (2020)

February 24, 2020. The computational power of a humble napkin is awesome. I discuss three napkin algorithms — dimensional analysis, Fermi estimates, and random walks — and use them to figure out why rain falls, the length of the E. coli genome, and the mass of a proton, among other things. These examples suggest a…

213

Quicksort with Jenkins for fun and no profit

I first encountered Jenkins in 2007 while contributing to the Apache Nutch project. It was called Hudson back then. The nightly builds for the project ran on Hudson at that time. I remember sifting through my emails and reviewing build result notifications to keep an eye on the patches that got merged into the trunk…

225

Prolly Trees

A deep dive into the Probabilistic B-tree or Prolly Tree data structure including examples. Prolly Trees are used to create version controlled databases.

226

Defining Statistical Models in Jax?

This is Bob. And I’d like to know the best way for us to code a bunch of models in JAX to use to evaluate parallel algorithms including normalizing flows. I’m going to dump out my current thinking, but I’m really hoping to get feedback from experts on the best way to do this without starting a flame war in the…

231

Linear Algebra of Types (2019)

It gives my brain a pleasant thrum to learn new mathematics which mimics the algebra I learned in middle school. Basically this means that the new system has operations with properties that match those of regular numbers as much as possible. Two pretty important operations are addition and multiplication with the…

234

Collatz’s Ant

if $n \equiv 0 \, (\text{mod}\, 2)$ the ant turns 90º clockwise, else the ant turns 90º counter-clockwise. On both accounts, the state of the cell is flipped and the ant moves forward one unit. This is repeated until $n = 1$.

235

Space-filling curves, constructively

In 1890 Giuseppe Peano discovered a square-filling curve , and a year later David Hilbert published his variation . In those days people did not waste readers’ attention with dribble – Peano explained it all on 3 pages, and Hilbert on just 2 pages, with a picture!

238

Proof of the Singular Value Decomposition

The existence claim for the singular value decomposition (SVD) is quite strong: “Every matrix is diagonal, provided one uses the proper bases for the domain and range spaces” (Trefethen & Bau III, 1997) . MIT professor Gilbert Strang has a wonderful lecture on the SVD, and he includes an existence proof for the SVD…