Topics /

Math & Algorithms

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

Any year
2253

Map Simplification with Visvalingam's Algorithm

An interesting challenge in cartography is getting data of the appropriate resolution. As Lewis Fry Richardson observed , the more precisely you measure the length of a coastline, the longer it appears; geographic shapes have infinite complexity. Digital displays, in contrast, are limited by pixels. Choosing too high…

2259

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.

2261

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…

2264

Eytzinger Binary Search

This tutorial is loosely based on a 46-page paper by Paul-Virak Khuong and Pat Morin “Array layouts for comparison-based searching” and describes one particular way of performing efficient binary search by rearranging elements of a sorted array in a cache-friendly way.

2266

Nibble Sort

A while back, John Regehr posted the Nibble Sort Programming Contest on his blog. The objective was to write a program that sorts the 4-bit components (nibbles) of 64-bit words as fast as possible. For example, 0x42badc0ffeed00d5 should result in 0xffeedddcba542000 after sorting.

2275

Embeddings, vectors, and arithmetic

An embedding is the representation of a piece of text like a word, sentence, or paragraph. Traditionally this value is in the form of a mathematical vector - a point in space. You can think of it as analogous to coordinates on a map that just happens to have many, many dimensions.

2280

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…