Monthly Archive: August 2009

Aug
30

Catalan numbers

690px-Catalan_number_4x4_grid_example.svg

Recently I was trying to count the number of n-bit numbers that have an equal number of 1′s and 0′s.  For example, there are 6 such numbers for 4-bit long numbers (0011, 0101, 0110, 1001, 1010, 1100).  I wrote a simple program to count such numbers for arbitrarily long numbers.  However, the program was computationally …

Continue reading »