Wednesday, August 24, 2011

Meta-Proposal: RNG

Hi fellows, I noticed that the random number generator is not really random. Especially when activated with little time in between, it generates equal or similar numbers. Also the numbers at the limits of the range are prevalent. So I think it would be nice to have a program which generates more random numbers. Unfortunately I lack the programming skills to do it, but maybe someone would be willing to do it.


Prince Anduril:

24-08-2011 19:32:07 UTC

Wow - Maths A Level does come in useful! Though I don’t know how it’s programmed, my understanding is that a random number generator generally works by picking the nth digit of pi, which as far as we know holds no perceivable pattern. If someone could program that then it would be pretty random.

Roujo: he/him

24-08-2011 21:35:54 UTC

I’ve seen some that work by performing complex math on the miliseconds part of the current timestamp. In any case, I’ll whip something even random-er when I get the time. If I don’t post back in a day or two, though, I probably had too much schoolwork to take care of it. =P


25-08-2011 07:55:57 UTC

Before anyone starts work on a new RNG, you should verify that the effects Blacky mentions exist. Were Blacky’s observations made from a data analysis or did he just scan the gndt log by eye? In the latter case, this could easily just be an example of the human mind seeing a pattern where there isn’t one.

These claims can be easily checked given enough data. For anyone who’s wondering: the first effect should stand out in the autocorrelation of results generated soon after each other if it exists, and the second can be checked directly from the data (or you could also go for a Bayesian model comparison if you’re feeling fancy, but we can probably trivially generate enough data to make this overkill).

Prince Anduril:

25-08-2011 12:28:57 UTC

These were the results I got:
Number / Frequency

1.  10
2.  4
3.  9
4.  4
5.  11
6.  8
7.  4
8.  4
9.  8
10.  10

The limits are prevalent, but not exclusively of the middle numbers. Couldn’t you use PMCC to assess this? Not familiar with the Bayesian model.


25-08-2011 14:29:55 UTC

You’ll need more data than that to make a convincing argument. Someone with server access could use the gndt’s RNG to roll ten thousand DICE100s, for example (I shouldn’t need to add that this should not be done on the gdnt itself).

Kevan: he/him

25-08-2011 14:37:31 UTC

The GNDT is just using Perl’s builtin rand() function, with no explicit seeding. Here’s a result of a script running on the BlogNomic server that calls rand() a million times with a d10 roll:-

1: 100342
2: 100210
3: 99690
4: 100358
5: 100047
6: 99756
7: 99991
8: 99970
9: 99853
10: 99783

Prince Anduril:

25-08-2011 15:58:44 UTC

Looks fine then.


25-08-2011 21:31:34 UTC

OK, that it really was my impression that the targets were rolled at the edges of the arena. Sorry for the trouble and thanks for checking.