April 1, 2012
I’ve been casually listening to a bunch of the video lectures for Stanford’s algorithm class, and the first two weeks programming challenges are pretty good if you haven’t checked them out yet. I won’t spoil the suspense in publishing the code – as I think that’s the point of these exercises, but the lectures do [...]
Read the full article →
March 19, 2012
I’ve been researching Pythagorean triplets for a Project Euler problem. Here’s an interesting article in wikipedia on using a Ternary Tree to generate primitive Pythagorean triples. I experimented writing the code for this generator (see below): # tree of primitive pythagorean triples import math from numpy import * # let’s generate ternary tree of pythagorean [...]
Read the full article →