From: Chris Pine Date: 2003-04-19T07:52:23+09:00 Subject: Re: Biased weighted random? ----- Original Message ----- From: "Hal E. Fulton" 1. Are you sure you want to call Daniel's method the bonehead algorithm? :) ---------------------------- See, now I feel bad about that. :( But, if you look, I called it the bonehead algorithm in my post before Daniel posted it. So I should ask you: Are you sure you want to call my bonehead algorithm Daniel's algorithm? I'm certainly not trying to insult anyone; I was just poking fun at myself when I called it that. Most problems have a "bonehead" solution: like O(n^2) sorts, you know? It's the first thing that pops into your head, before you have a chance to realize that it's: - pointlessly slow, - ugly, - or (as in this case) flat-out wrong. But I wanted to try it, anyway, to see what happened. Sometimes your sort can be slow. Sometimes an ugly answer is good enough. And, as in this case, sometimes the wrong algorithm can be part of the right algorithm. Anyway, since my post was over an hour before Daniel's, all the bone-headedness is mine to claim! ---------------------------- 3. As I did back then, I can't help wondering: Shouldn't there be a simple non-iterative solution for this? Or at least non-matrix? Something like, umm, find the geometric mean and divide each weight by that and multiply by the price of tea in China? ---------------------------- Yep. There were two iterative steps. One I did 5 times, but if I had wanted to, I could have solved the system of linear equations to get the eigenvector. Since it was a transition matrix, squaring it seemed to work... but it might not always work... I'm not sure. The second was trickier (the thing I did 50 times). Mauricio claimed to have solved that part (and I've never seen him make a mathematical mistake), but I didn't check it myself. It was too much to do at my computer, and I had no paper around. Even so, it looked like he was trying to give you a transition matrix, but I really think that, in order to by psychologically satisfying, or as "locally random" as possible, or however you want to say it, you need to get a weighting and then just run it through the aforementioned, poorly named, "bonehead" algorithm. Chris