random number generator

General fruit machine related chat, if it doesn't fit another category discuss it here..
Locked
e4ans
Senior Member
Posts: 406
Joined: Sun Apr 20, 2008 7:16 pm
Location: Darlington

random number generator

Post by e4ans »

Is it possible to upload a excel file on here? I have made a simple RNG to simulate FOBT roulette. In 200 presses only once did the same number come out twice in a row
User avatar
harry2
Senior Member
Posts: 5155
Joined: Sat Feb 23, 2008 7:34 pm
Location: The Royal County

Post by harry2 »

Rand function !

.xls files not allowed. Save it to JPEG or paint.


viewtopic.php?t=974&start=140
Roulette free since December 2011.
User avatar
quizard
Senior Member
Posts: 890
Joined: Mon Jan 30, 2006 10:33 pm
Location: It's grimmm up north

Post by quizard »

It is actually some very high probability (about 99.5%) that the same number will come up consecutively at least once in 200 spins.

You can test it out here:

http://www.random.org/integers/
e4ans
Senior Member
Posts: 406
Joined: Sun Apr 20, 2008 7:16 pm
Location: Darlington

Post by e4ans »

harry2 wrote:Rand function !

.xls files not allowed. Save it to JPEG or paint.
Spot on

=RANDBETWEEN(0,36)
LordOoze
Senior Member
Posts: 197
Joined: Wed May 07, 2008 7:50 pm

Post by LordOoze »

Generate a stream of random numbers then plot them as either a 2d or a 3d - to test for structures.

for 2d - plot n against n+1
for 3d plot n against n+1 against n+2

A good random number generator will show an equal distribution whereas a poor one will reveal clusters.

Oh and see if your generator will create a unique series each time it is called. Whether it called once each time the environment used to program it is used or sequentially.

An example is the basic rand function in matlab (c) will create the approx same series each time you initialize matlab (c)
User avatar
blackmogu
Senior Member
Posts: 1028
Joined: Sat Oct 21, 2006 3:39 pm
Location: South Korea

Post by blackmogu »

LordOoze wrote:Generate a stream of random numbers then plot them as either a 2d or a 3d - to test for structures.

for 2d - plot n against n+1
for 3d plot n against n+1 against n+2

A good random number generator will show an equal distribution whereas a poor one will reveal clusters.

Oh and see if your generator will create a unique series each time it is called. Whether it called once each time the environment used to program it is used or sequentially.

An example is the basic rand function in matlab (c) will create the approx same series each time you initialize matlab (c)
modern random functions can be seeded for a different sequence upon startup.
"If only there were evil people somewhere insidiously committing evil deeds, and it were necessary only to separate them from the rest of us and destroy them. But the line dividing good and evil cuts through the heart of every human being. And who is willing to destroy a piece of his own heart?"
User avatar
Matt Vinyl
Senior Member
Posts: 7198
Joined: Wed May 11, 2005 6:56 pm
Location: Lost in the outback, Bryan

Post by Matt Vinyl »

Further reading on how Excel generates random numbers: [url=http://en.wikipedia.org/wiki/Mersenne_twister]Wiki Link: Mersenne Twister Algorithm[url]

Pseudo Random Algorithm. I'd still say these sort of randomiser algorithms are more than OK for most 'random' games?
"And do you ever contradict yourself, Minister?" "Well, yes and no..."
User avatar
Matt Vinyl
Senior Member
Posts: 7198
Joined: Wed May 11, 2005 6:56 pm
Location: Lost in the outback, Bryan

Post by Matt Vinyl »

Although this:
Observing a sufficient number of iterates (624 in the case of MT19937) allows one to predict all future iterates
is interesting...
"And do you ever contradict yourself, Minister?" "Well, yes and no..."
User avatar
blackmogu
Senior Member
Posts: 1028
Joined: Sat Oct 21, 2006 3:39 pm
Location: South Korea

Post by blackmogu »

probably down to a flawed implementation of MT19937 in Excel.
"If only there were evil people somewhere insidiously committing evil deeds, and it were necessary only to separate them from the rest of us and destroy them. But the line dividing good and evil cuts through the heart of every human being. And who is willing to destroy a piece of his own heart?"
User avatar
Matt Vinyl
Senior Member
Posts: 7198
Joined: Wed May 11, 2005 6:56 pm
Location: Lost in the outback, Bryan

Post by Matt Vinyl »

Better get our notepads and a stack of those Ladbrokes pens and get noting down those numbers. :)
"And do you ever contradict yourself, Minister?" "Well, yes and no..."
Locked