WhatNitrous
Well-known member
- Messages
- 23,422
- Points
- 113
Built in Twister? I may use it myselfThanks for the Spinning wheel suggestion, but I'm trying to keep it as simple as possible.
About Excel reliability, it is covered:
- For old versions:
Description of the RAND function in Excel
web.archive.org
- As of Excel 2010, Excel uses the Mersenne Twister algorithm (MT19937) to generate random numbers
Mersenne Twister - Wikipedia
en.wikipedia.org
And rocket science aside, all the magic needed to generate a pseudo random number between 1 & 10 (as example) the formula is:
=INT(RAND()*(10-1)+1)
Paste it in a cell and Voilá!
Spreadsheets, one of the most incredible tools at the human service to the rescue!
Also remember there is -always- the human factor:
Despite how effective the tool to generate the pseudo random number is,
I could run as many random requests until I "get" the winning number -I want-
Don't you agree? Including spinning wheels and any other method anyway
Don't worry and trust your luck![]()
I guess you really haven't been around long enough to know I was going to add that to my own generator, but its randomization is always 'needed to be seeded' at such an insanely high number that i decided against it for a random generator that is going to be selecting a number between like 1-30 tops.
I didn't know they built it into excel but I'm guessing it was meant for fractional purposes where a small number would be seen as huge.
Your right about the human factor for sure, I actually had to rerun mine during my second raffle after walking away for ten minutes because I went straight from testing to doing the actual winners and I felt I may have unconsciously decided it was satisfactory when those numbers were on the screen...so I went and smoked a couple butts, came back and did one run.
Winners, period. Just to make sure I was fair.
To be honest idc if I ever win or lose, so no big deal to me if you draw paper out of a hat
But I don't need a lesson in the Rnd, rand, or rand_s for that matter, let alone the math.
I'm not sure about excel, but in C/C++ it would be done like this to generate a number between 1 and 10.
=INT(RAND()%(10)+1)
Or more properly
=INT(RAND()%(MaxUsers - LowestNum + 1) + LowestNum
Lowest number being 1 always. The percent instead of the multiplication makes it fractional which is the reason for the INT being there at all.
Again I don't use excel so i may be wrong.
In C/C++
it would be
int num = (int)((rand() % (maxUsers - LowNumber + 1)) + LowNumber)
You should never use 0 in a random function especially if its going to go fractional first as it can throw an error with an Integer if it goes below 0.5 or a negative number could be drawn.
Which is also why you add the +1 after subtracting the lowest number so its always a minimal of 1 before division...anyways.
If it works it works, if it throws an error in excel try changing the math, either way good luck with the draw and thanks for the chance
Last edited: