Damn Cool Algorithms: Cardinality Estimation
Posted by Nick Johnson | Filed under python , cardinality-estimation , damn-cool-algorithms
Topics /
The most popular blog posts about math & algorithms on Hacker News. 2,851 posts.
Posted by Nick Johnson | Filed under python , cardinality-estimation , damn-cool-algorithms
Today we’ve released a pre-publication version of an update to our 2022 paper “Progress toward fusion energy breakeven and gain as measured against the...
This is an explanation of the key function on Proof-of-Work in the Bitcoin blockchain. It focuses on the one feature of Proof-of-Work that is essential and shows that other features often talked about such as security are secondary side-effects, useful, but not essential. This explanation rests on illustrating a few…
I've long had a soft spot for dependently-typed languages like Coq Rocq and Lean. They offer the possibility of a type system capable of encoding and enforcing arbitrarily subtle invariants. The sort of thing that, in regular languages, ends up (at best) as a comment, and which quickly gets lost as the size of the…
In this post we will implement a data compression program in about 150 lines of Haskell. It will use Huffman coding and handle arbitrary binary files using constant memory for encoding and decoding.
a personal blog
We published the triangulator of our map engine as earstrip, an ISC-licensed C++ and WebAssembly library. How it came to be: the ear clipper rebuilt one idea at a time and timed on 3.7 million polygons of real map data.
Water is complicated and fascinating stuff! There are at least sixteen known crystal phases of ice, many shown in this diagram based on the work of Martin Chaplin: (Click for a larger version.) For…
Here’s to being a preserving student for life.
A tale of numbers that like to turn: a different look at complex numbers and the strange things they do.
The max-flow problem, which is ubiquitous in network analysis, scheduling, and logistics, can now be solved more efficiently than ever.
This blog is written by Hanno Böck. Unless noted otherwise, its content is licensed as CC0 .
Let us say that I ask you to find the number I am thinking about between -1000 and 1000, by repeatedly guessing a number. With each guess, I tell you whether your guess is correct, smaller or larger than my number. A binary search algorithm tries to find a value in an interval by repeating … Continue reading Fast…
If I multiply two 64-bit integers (having values in [0, 264)), the product requires 128 bits. Intel and AMD processors (x64) can compute the full (128-bit) product of two 64-bit integers using a single instruction (mul). ARM processors, such as those found in your mobile phone, require two instructions to achieve the…
Recently I came across a puzzling fact: the International Criminal Court hashes electronic evidence with MD5, even though MD5 is badly broken. So, why are lawyers using broken, outdated technology? The answer involves the common law system, cultural isolation, and a single man named Don L. Lewis.
Describes a simple Markov chain algorithm to generate reasonable-sounding but utterly nonsensical text, and presents some example outputs as well as a Python implementation.
Epistemic Status: Resident Expert I’m a little late on this, which was an old promise to Robin Hanson (not that he asked for it). I was motivated to deal with this again by the launch of Augu…
You may remember from high school what a polynomial is. If so, you may also remember how to multiply two of them. But what if I told you that the method you were taught is slow as F? In this post we will connect polynomials with the Fourier Transform and convolutions, and show you how to multiply polynomials with…
Ilkka Törmä and Ville Salo, a pair of researchers at the University of Turku in Finland, have found a finite configuration in Conway’s Game of Life such that, if it occurs within a universe a…
In my puzzle collection , there are many games in which you have to connect points together by edges, making a graph, and the puzzle rules say you must avoid making any loop in the graph. Examples are Net , Slant , and some configurations of Bridges (although not the default one). Loopy and Pearl also care about…
Linear Algebra Geometric Algebra Applications Multiplying Vectors Rotors Double Angle Formula Complex Numbers Characterizing B Ratios Conjugates Geometric Algebra is fascinating, and I believe solves a large number of problems that arise from a more traditional approach to vectors, but I've been very disappointed with…
How I created a wall poster of knot diagrams.
During my internship at Jane Street 1 , one of my projects was a config editing tool that at first sounded straightforward but culminated in me designing a custom tree diffing algorithm using dynamic programming, relentlessly optimizing it and then transforming it into an A* accelerated path finding algorithm. This…
EDIT: Be warned that this post is angry. If you’re easily offended when someone goes on a rant, then leave now because I’m very unforgiving in several places below. The tone of my writing is unusually harsh, but the people whose work I’m talking about deserve it, and here’s why. Even though I had been working with…
L19 = 208168199381979984699478633344862770286522453884530548425639456820927419612738015378525648451698519643907259916015628128546089888314427129715319317557736620397247064840935
V8’s Math.random implementation now uses an algorithm called xorshift128+, improving the randomness compared to the old MWC1616 implementation.
Would you believe me, if I claimed that an algorithm which has been on the books as "optimal" for 46 years, which have been analyzed in excruciating detail by geniuses like Knuth and taught in all CS courses in the world, can be optimized to run ten times faster ?