Topics /

Math & Algorithms

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

2014
99

Planjure: A* and Dijkstra's in Om

I wrote Planjure to learn ClojureScript and Om. It’s a fun little program. You paint islands on a canvas and run path-planning algorithms to find the optimal path for your ship to traverse from start to finish. Sailing across blue ocean is faster than hiking through green islands. The three algorithms implemented are…

101

New partition function record: p(10^20) computed

The partition function p ( n ) counts the number of partitions of n , i.e. the number of ways n can be written as a sum of positive integers when disregarding the order of the terms. For example, 4 has the five distinct partitions 4, 3+1, 2+2, 2+1+1, 1+1+1+1, so p (4) = 5. This week, I set a new record by computing…

105

The Firing Squad Problem

In 1957, John Myhill first posed an interesting problem that was closely related to computer programming, but did not require any related background to solve. Dubbed the "firing squad synchronization problem," the puzzle was passed along by word of mouth and first solved by Marvin Minsky and John McCarthy. However…

107

Programming with Nothing (2011)

I love Ruby! I’ve used it every day for years and I’m not sick of it yet. It’s an easy language to love: it’s expressive, flexible and syntactically beautiful ; it has a unique combination of useful features like mixins , metaclasses and blocks ; it comes with a useful core library and comprehensive standard library …