Saturday, January 3, 2009

Randomness

I know kung fu :)
Abstract Design Pattern and Factory Design Pattern are piece of cake from now on :)
Well, I had to spend my new year's eve working on my own random number generator algorithm and applying it along with Java's Random class to one of the design patterns.
Random Number Algorithms Suck!!! Thanks to Java so we don't have to write our own Random class. It is do-able but why spend time on something that's already there ? ;) Yeah, I know that's called "being lazy"...
Anyways, after searching for mathematical equations and trying to apply it to Java for about a day, it wasn't purely random in the end!! It allows you to create a set of integers in a predictable way ( in my case it was integer type) then picking elements from the list. Afterwards I happened to see this quote :
"Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin."
Wisely said by John von Neumann, I asked myself who wants to be in a state of sin ?? Not me! :)) So I created a simple array of integers, shuffled them and picked the numbers! :D I came to a conclusion that this was as close as to computers randomness.

"Creativity is the ability to introduce order into the randomness of nature."


"We all experience many freakish and unexpected events - you have to be open to suffering a little. The philosopher Schopenhauer talked about how out of the randomness, there is an apparent intention in the fate of an individual that can be glimpsed later on. When you are an old guy, you can look back, and maybe this rambling life has some through-line. Others can see it better sometimes. But when you glimpse it yourself, you see it more clearly than anyone."