----- Original Message -----
From: "Chris Pine" <nemo / hellotree.com>

|  0,   0.5,  0.5  |
|  .67, 0,    .33  |
|  .67, .33,  0    |


|  0,   .25,  .75  |
|  1,   0,    0    |
|  .33, .67,  0    |
----------------------------

Looking at this again, it seems that the latter matrix is flawed.  Not only
is it uglier (a reasonable complaint), but it isn't "locally random", so to
speak.  The long term probabilities are correct, but every 'b' is followed
by an 'a'.

So, uh... how do we define that "requirement"?  Of all the matrices that
work, choose the most... "balanced"?  What does that mean?  (I love
psychological algorithms!)

Perhaps a matrix is "naturally balanced" if the ratio of any two
probabilities in any row is the same as the ratio of the corresponding
probabilities in your initial vector (ignoring the zeros of the diagonal).

I'm pretty sure such a matrix would be unique.

BTW, is this getting off-topic?  Feels more like math than Ruby to me.
(But, if you're lucky, programming gets that way sometimes!)

Chris