Friday, 6 April 2012

Random Number Generators

In my Unit 1 feedback my tutor had suggested that I look at some Markov chains and just general random number generators. Together with my developer we have looked at how random numbers are generated in PHP, which is what we will be using to generate visuals and sounds in my project. We found out that PHP uses the Mersenne Twister

"The Mersenne Twister is an algorithm for generating random numbers.  It was designed with consideration of the flaws in various other generators. The period, 2^19937-1, and the order of equidistribution, 623 dimensions, are far greater.  The generator is also fast; it avoids multiplication and division, and it benefits from caches and pipelines." (Bellew.net) 

We found an interesting article that explained how a computer, which is essentially a logical machine, can never really generate a number that is completely random. It states that any man made algorithm can always be cracked, therefore only natural randomness is truly random. (source) Certain random algorithms tend to pick out a seed which is likely to create a totally random number, such as the time of day. However, as my developer pointed out, once a hacker identifies the seed, this too can be cracked. Of course my project is not about security, therefore hacking is not really an issue, however it could be interesting to generate a different seed perhaps through something natural.

I'm also thinking about how I could perhaps use natural chance to select the music for the project. However I think that for the computer generated 'chance' I will stick to the PHP random number generator. Of course  I have set up a number of boundaries in order to avoid slow loading speed, but still keep the viewer interested. The boundaries I have set for the interface are explained more in detail in an earlier post.

No comments:

Post a Comment