Sunday, 1 September 2013

Tackling Psuedo-Random numbers and True Random numbers

Just a quick bit on an issue I was faced with a few months ago.
VB.NET program I was working on, and I was just being painful, when I starting working with Random numbers.
Why do random number software not take advantage of various variables provided by Windows for a start

                    randseedA = My.Computer.Info.TotalPhysicalMemory
                    randseedB = My.Computer.Info.AvailablePhysicalMemory
                    randseedC = My.Computer.Clock.TickCount
                    randseedD = My.Computer.FileSystem.CurrentDirectory.Length
                    randseedE = My.Computer.Clock.TickCount
                    randseedF = My.Computer.Info.AvailableVirtualMemory

And then there are more deeper H/W variables such as Fan speeds, CPU Temps, MB Temps, GfX Card variables etc...

I know each line of code takes up resources and memory, but if you're going to do something, do it right?

The 6 lines of code are at the start of my program. I work with these and a few others, including TickCount and AvailblePhysicalMemory through loops to randomize a number. It is slower, but after 10's millions of iterations, the plot is much more noisy than the regular random number generator provided by VB.


---
http://www.wolftech.net.au/
BTC: 1EYadazzGU317MFtpg1JZtnwkafAZPd7Fz
LTC: LQWsQZncYij8rQHznwfq7TbvganJwNfMJb
FTC: 6rem3rkTy4Wd1NRdf5Puv5bSCnDXq1bXod