Posts

Mondrian was a Mathematician

Image
On my most recent trip, I read about Roy and Teh's Mondrian Process. The name was chosen because it can be used to produce things like look similar to Piet Mondrian's paintings. Of course, it is useful for much more than that, but for now I'm just going to focus on the pretty. (If you are bored by the math scroll to the bottom to see the end result).

Piet Mondrian, Composition II in Red, Blue, and Yellow, 1930
(borrowed from wikipedia)

The Mondrian process is a random process that generates ways of partitioning the "product space" of one or more sets. The product space of two sets is the set of all possible pairs with one thing taken from each. One example of a product space is the square. It can be thought of as the product space of the set of numbers between 0 and 1 with itself: every point in the square is represented by an x-coordinate and a y-coordinate, each a number between 0 and 1.

To explain the Mondrian process, I will describe how to generate a random …

Revamp

After a 6 month hiatus, I'm taking up blogging again. Hopefully less time will pass until my next post. I decided to move from Wordpress to Blogger because I couldn't include javascript in my posts. I just took the train up to NYC, so I've got something new to post. Until then, here's a hint.

How to pick a screen name

I've been trying to sign up for an account on Steam, but I can't pick a unique username.  It seems that absolutely anything that I pick is already taken.  Obscure references to ancient Rome? Taken.  Random physics jargon? Taken.  Combinations of obscure references to ancient Rome and random physics jargon? Taken.

People generally fail as sources of randomness and I seem to be no exception (see for example this). So, I decided that what I really needed was a program that would generate random words for me, then I can pick a name from that.  But, these words can't be any random combination of letters --  I want them vaguely resemble actual words, so that they will be pronounceable.   To accomplish this I am going to try to random generate n-grams rather than random letters.  An n-gram is just a list of consecutive words or letters in a text of length n.   For example, the n-grams of length 2 (or 2-grams) in the word 'hello' are: 'he', 'el', 'll…