Topics /

Math & Algorithms

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

Any year
1387

Decision Tables

I really like decision tables but they’ve fallen out of common knowledge. Let’s fix that. A decision table is a means of concisely representing branching and conditional computations. In the most basic form, you have some columns that represent the “inputs” as booleans and some columns that represent outputs and…

1391

Lánczos Interpolation Explained (2022)

When you resize, rotate, or in any way transform an image; or more generally when you resample some discrete signal, the software you are using must _interpolate_ between the discrete points to produce a result. Linear and cubic interpolation are easy to explain, but Lánczos interpolation, one of the most popular…

1401

Kelly Criterion (2007)

It’s fairly clear when one should buy a particular stock. One should buy stock when it is undervalued. What I have always wondered about is how much stock one should buy. A few months ago I stumbled upon the answer which is given by the Kelly criterion . It says that one should invest an amount to maximize one’s…

1406

Constructing a Four-Point Egg

For reasons beyond the scope of this entry, I have been investigating elliptical and ovoid shapes. The Wikipedia article for Moss’s egg has a link to a tutorial on Euclidean Eggs by Freyja Hreinsdóttir which (amongst other things) describes how to construct the “four point egg”. I think it is a nicer shape than Moss’s…

1407

Exact numeric nth derivatives

Automatic differentiation is a well-studied technique for computing exact numeric derivatives. Dan Piponi has a great introduction on the subject , but to give you an overview, the idea is that you introduce an algebraic symbol such that but . Formulas involving are called dual numbers (e.g., , ) in much the same way…