(Original image by Hljod.Huskona / CC BY-SA 2.0). I used to hate neural nets. Mostly, I realise now, because I struggled to implement them correctly. Texts explaining the working of neural nets focus heavily on the mathematical mechanics, and this is good…

## Generating Random Integers With Arbitrary Probabilities

I finally laid my hands on Donald Knuth’s The Art of Computer Programming (what a wonderful set of books!), and found a neat algorithm for generating random integers 0, 1, 2, … , n – 1, with probabilities p_0, p_1,…

## Cellular Automata for Simulation in Games

A cellular automata system is one of the best demonstrations of emergence. If you do not know what cellular automata (CA) is, then you should go download Conway’s Game of Life immediately: Conway’s Game of Life Essentially, CA is a…

## A simple texture algorithm – faster code and more results

Faster Code A while back I wrote about a simple texture algorithm that I have been exploring. The Python implementation was very slow – so much, that I decided to implement it in C++ to see what performance gain I…

## 5 Tips for Prototyping Slow Algorithms

(Photo by Darren Hester) Some algorithms take a long time to return their results. Whether it is because the algorithm has to operate on a huge data set, or because it has combinatorial complexity; every time you run it you…