The Mudcat Café TM
Thread #119102   Message #2580457
Posted By: Uncle_DaveO
03-Mar-09 - 02:16 PM
Thread Name: Tech: Programming Randomness
Subject: RE: Tech: Programming Randomness
As I understand it, any "random number generator" has to have SOME given number(s) to start from. In order to make a random sequence come out of the random number generator, one needs at least one and preferably more independently occurring number(s) for the built in protocols to work on.

One approach might be for the program to look on the web for the current atomic clock time as one datum. It would be unlikely and very difficult indeed for someone on line to pick an exact (down to milliseconds) time to start the game.

If there are two players for your Scrabble game, the program could ask for each player to secretly type in let's say a seven-letter word. The program would use the numeric equivalent of each of those words. Now you have three independent variables, none known to both of the players; each player would control the word (s)he typed in, but not the atomic clock time and the other player's entered word.

So the program takes those three generated numbers as a basis for its random number generation for that game.

Even if the two players play each other again, the game start time would be different, and the program could require that each player put in a new and different word, perhaps of a different length.

I can think of a number of other refinements that would contribute to randomness, such as periodically renewing the time that worked on the previously entered word-number-values. Or using different figures from within the time-number value(say the second and fifth figure) to activate alternative random number protocols even in the course of a game.

I'm not sure whether even these sorts of dodges would create a "TRUE" random number sequence in an ideal theoretical sense, but the sequence would be a good approximation of random, as the result was perceived by the players. None of the above suggestions should be beyond the ability of a competent programmer.

Dave Oesterreich