Topics /

Math & Algorithms

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

Any year
1742

Interactive Numerical Optimization Tutorial

Numerical Optimization is one of the central techniques in Machine Learning. For many problems it is hard to figure out the best solution directly, but it is relatively easy to set up a loss function that measures how good a solution is - and then minimize the parameters of that function to find the solution.

1746

Regular expression matching can be simple and fast (2007)

This is a tale of two approaches to regular expression matching. One of them is in widespread use in the standard interpreters for many languages, including Perl. The other is used only in a few places, notably most implementations of awk and grep. The two approaches have wildly different performance characteristics:

1751

Packing the world for longest lines of sight

I have a side project to find the longest line of sight on the planet 1 using a novel Total Viewshed algorithm . At a resolution of 3 arc-seconds (~92m x 92m), the planet contains around 4.5 billion elevation samples 2 . Now obviously we don’t need to calculate the visibility between literally every single one of…

1752

High Precision Mapping from Scratch

The fun of owning rural property is that knowing where your land actually starts and ends is a guess usually. Sure, you have a parcel description, and maybe even an online service with “official” GIS boundaries (for us here in New Brunswick, this is GeoNB ). However, since it’s in the middle of the forest, the odds of…

1754

Lindenmayer Systems

Originally developed by Aristid Lindenmayer in 1968, an L-System is a formalism to generate self-similar structures. Although, L-Systems are capable of generating famous fractals like the Sierpinski Triangle (Axiom: FXF--FF--FF, F → FF , X → --FXF++FXF++FXF-- , angle = 60 ) or the Gosper Curve (Axiom: FX, X →…

1755

The Math Behind GANs (2020)

Generative Adversarial Networks refer to a family of generative models that seek to discover the underlying distribution behind a certain data generating process. This distribution is discovered through an adversarial competition between a generator and a discriminator. As we saw in an earlier introductory post on…

1757

Doing a math assignment with the Lean theorem prover

Note: this post was written for Lean 3; the latest version, Lean 4, is a very different language. Turn back the clock to 2009: a confused physics major newly infatuated with math and computer science, I enrolled in MATH 273: Numbers and Proofs at the University of Calgary. This wasn’t my first encounter with…

1759

SVD Image Compression

Singular Value Decomposition (SVD) is a fundamental concept in linear algebra, and it is particularly important in the field of machine learning for tasks such as dimensionality reduction, data compression, and noise reduction.

1763

Differential Heuristics

In 2005 Google showed off Google Maps, which lets you drag the map around instead of reloading the page like MapQuest and others used. That’s the feature that got everyone’s attention. But what got my attention was a feature they added in 2007 where you could drag the start/end points on a route [1] , and it would…