View Full Version : Roller Test
DinbinFanfoom
22nd April 2009, 02:52 PM
Not that I really suspect it, but hey, tests are free...
Average: 10.9
Asharad
22nd April 2009, 02:53 PM
yeah, I was mostly kidding, but the number 3 really has come up a lot.
edit: hooray!
DinbinFanfoom
22nd April 2009, 02:53 PM
test 2
Average: 7.4
DinbinFanfoom
22nd April 2009, 02:54 PM
Yeah, we're TOTALLY AWESOME at rolling 10+ when IT DOESN'T MATTER! :P
DinbinFanfoom
22nd April 2009, 02:54 PM
test 3
Average: 10
Greebo
22nd April 2009, 02:58 PM
I did a 10d20 test so I got 100 numbers
DinbinFanfoom
22nd April 2009, 02:59 PM
test 4
Shiz
22nd April 2009, 03:11 PM
You need 24 samples, minimum, to get some sense of randomness.
Greebo
22nd April 2009, 03:15 PM
Din roll 10d100 instead of 1d100
DinbinFanfoom
22nd April 2009, 03:16 PM
10 d 100's
Average 1d100 roll: 53.17
Seems right
Greebo
22nd April 2009, 03:19 PM
If y'all are satisfied, can I put the seed back on its rigged setting now?
:twisted:
Shiz
22nd April 2009, 03:29 PM
I don't have any doubts about the reasaonble randomness. Ash got 3s with different dice so it was clearly just coincidence.
Asharad
22nd April 2009, 03:31 PM
no, I got four threes with different dice. I got three threes with the 1d20.
But I never really thought it was broken. that's just an amazing run.
Greebo
22nd April 2009, 03:31 PM
Sometimes even real d20's roll snake eyes.
Asharad
22nd April 2009, 03:34 PM
yeah, but they really rarely roll snake eyes and the snake's one eye'd friend who is traveling along with him!
Greebo
22nd April 2009, 03:38 PM
This would be the day to play the lottery then - you beat 1:8000 odds.
Asharad
22nd April 2009, 03:41 PM
I was going to ask someone smarter than me (ie, anyone) to figure out the odds of rolling the same three numbers three times on a 20d.
Greebo
22nd April 2009, 03:43 PM
Someone better than me at statistics should check too but I think its simply 1 in 20 x 20 x 20 this time.
Shiz
22nd April 2009, 04:01 PM
1/20 X 1/20 X 1/20 = 1/8,000
Seems like long odds but think of it differently. Put 100 people in a room, each with a quarter. Have them flip the coin. Heads, leave the room. Tails, stay. Go until one guy wins. Just using a normal curve probability, the winner will probably flip tails close to 10 times in a row. No, I don't remember the calculation.
1/2^10 = 1/1,000 roughly. 1/2^20 = 1/million roughly.
Now, consider that most 6 number lotteries have odds of 1/85 million to win the big jackpot and you start to see the pointlessness of buying lottery tickets (even though we all do anyway).
So you have almost a 100 times better chance of flipping tails 20 times in a row than of winning the Mega Millions.
EricStratton
22nd April 2009, 04:20 PM
I will forever regret damaging the part of my brain that stored all the info I learned in my combinatorics class. /sigh.
Greebo
23rd April 2009, 09:30 AM
For the curious:
/* Written by PointSingularity. Feel free to come and play some play-by-post rpg at 2d4.org! */
/* Anyone may use this code however they want, although I'd appriciate mentioning me somewhere. ;) */
if ($_REQUEST['do'] == "rolldice") {
$desclen = strlen($_POST['rolltitle']);
$rolltitle = htmlspecialchars_uni($db->escape_string($_POST['rolltitle']));
$rollcount = $_POST['rollcount'];
$rollface = $_POST['rollface'];
if ($_POST['rolluser'] != 5 OR !empty($_POST['rollpassword'])) {
eval(standard_error($vbphrase[dicerollerphrase_an_error_has_occurred]));
}
elseif (empty($_REQUEST['p']) OR !is_numeric($_REQUEST['p'])) {
eval(standard_error($vbphrase[dicerollerphrase_no_post_or_an_invalid_post_specif ied]));
}
elseif (empty($rolltitle) OR empty($rollcount) OR empty($rollface)) {
eval(standard_error($vbphrase[dicerollerphrase_you_must_fill_out_all_of_the_fiel ds]));
}
elseif (!is_numeric($rollcount) OR !is_numeric($rollface)) {
eval(standard_error($vbphrase[dicerollerphrase_please_use_only_numbers_in_the_di ce_fields]));
}
elseif ($desclen > $dicerollervar_maxdesclen) {
eval(standard_error($vbphrase[dicerollerphrase_your_roll_description_contains_to o_many_characters]));
}
elseif ($rollcount < $dicerollervar_mindice OR $rollcount > $dicerollervar_maxdice OR $rollface < $dicerollervar_minface OR $rollface > $dicerollervar_maxface) {
eval(standard_error($vbphrase[dicerollerphrase_you_have_entered_one_or_more_inva lid_values]));
}
else {
$rpost = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "post WHERE postid = ".$_REQUEST['p']);
if (empty($rpost[postid])) {
eval(standard_error($vbphrase[dicerollerphrase_invalid_post_specified]));
}
elseif ($vbulletin->userinfo['userid'] != $rpost[userid]) {
eval(standard_error($vbphrase[dicerollerphrase_you_do_not_have_permission_to_add _rolls_to_this_post]));
}
else {
$rrolldata = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "roll WHERE postid = ".$rpost['postid']);
$rrollsstored = 0;
$titleexiststerminate = false;
while ($rroll = $db->fetch_array($rrolldata)) {
$rrollsstored = $rrollsstored + 1;
if (trim(strtoupper($rroll[rolltitle])) == trim(strtoupper($rolltitle))) {
$titleexiststerminate = true;
}
}
$db->free_result($rrolldata);
$rfloodcheck = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "roll WHERE userid = ".$vbulletin->userinfo['userid']." ORDER BY rollid DESC");
$rflood = TIMENOW - $rfloodcheck[dateline];
if ($rrollsstored >= $dicerollervar_maxrolls) {
eval(standard_error($vbphrase[dicerollerphrase_this_post_already_contains_the_ma ximum_amount_of_rolls_allowed]));
}
elseif ($titleexiststerminate == true) {
eval(standard_error($vbphrase[dicerollerphrase_an_entry_with_that_description_al ready_exists_for_specified_post]));
}
elseif ($rflood <= $dicerollervar_floodlimit) {
if ($dicerollervar_floodlimit == 60) {
eval(standard_error($vbphrase[dicerollerphrase_you_added_a_roll]." ".$rflood." ".$vbphrase[dicerollerphrase_seconds_ago_please_wait_at_least_ one_minute_between_adding_rolls]));
}
elseif ($dicerollervar_floodlimit == 30) {
eval(standard_error($vbphrase[dicerollerphrase_you_added_a_roll]." ".$rflood." ".$vbphrase[dicerollerphrase_seconds_ago_please_wait_at_least_ half_a_minute_between_adding_rolls]));
}
else {
eval(standard_error($vbphrase[dicerollerphrase_you_added_a_roll]." ".$rflood." ".$vbphrase[dicerollerphrase_seconds_ago_please_wait_at_least]." ".$dicerollervar_floodlimit." ".$vbphrase[dicerollerphrase_seconds_between_adding_rolls]));
}
}
else {
for ($i=1; $i<=$rollcount; $i++) {
$rollresultarray[$i] = mt_rand(1,$rollface);
$rollresult = $rollresult + $rollresultarray[$i];
}
$db->query_write("INSERT INTO " . TABLE_PREFIX . "roll
(userid, dateline, postid, rolltitle, rolldice, rollvalue, rollresult)
VALUES
('".$rpost[userid]."',
'". TIMENOW ."',
'".$rpost[postid]."',
'".$rolltitle."',
'".$rollcount."',
'".$rollface."',
'".$rollresult."')
");
$getrollid = $db->insert_id();
foreach ($rollresultarray as $dieresult) {
$db->query_write("INSERT INTO " . TABLE_PREFIX . "dice
(rollid, dieface, dieresult)
VALUES
('".$getrollid."',
'".$rollface."',
'".$dieresult."')
");
}
$vbulletin->url = "showthread.php?" . $vbulletin->session->vars['sessionurl_js'] . "p=" . $rpost[postid];
$_REQUEST['forceredirect'] = true;
if ($rollcount == 1) {
eval(print_standard_redirect($vbphrase[dicerollerphrase_dierollsuccess], false, true));
}
else {
eval(print_standard_redirect($vbphrase[dicerollerphrase_dicerollsuccess], false, true));
}
}
}
}
}
if ($_REQUEST['do'] == "newroll") {
if (empty($_REQUEST['p']) OR !is_numeric($_REQUEST['p'])) {
eval(standard_error($vbphrase[dicerollerphrase_no_post_or_an_invalid_post_specif ied]));
}
else {
$npost = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "post WHERE postid = ".$_REQUEST['p']);
if (empty($npost[postid])) {
eval(standard_error($vbphrase[dicerollerphrase_invalid_post_specified]));
}
elseif ($vbulletin->userinfo['userid'] != $npost[userid]) {
eval(standard_error($vbphrase[dicerollerphrase_you_do_not_have_permission_to_add _rolls_to_this_post]));
}
else {
$nfloodcheck = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "roll WHERE userid = ".$vbulletin->userinfo['userid']." ORDER BY rollid DESC");
$nflood = TIMENOW - $nfloodcheck[dateline];
if ($nflood <= $dicerollervar_floodlimit) {
if ($dicerollervar_floodlimit == 60) {
eval(standard_error($vbphrase[dicerollerphrase_you_added_a_roll]." ".$nflood." ".$vbphrase[dicerollerphrase_seconds_ago_please_wait_at_least_ one_minute_between_adding_rolls]));
}
elseif ($dicerollervar_floodlimit == 30) {
eval(standard_error($vbphrase[dicerollerphrase_you_added_a_roll]." ".$nflood." ".$vbphrase[dicerollerphrase_seconds_ago_please_wait_at_least_ half_a_minute_between_adding_rolls]));
}
else {
eval(standard_error($vbphrase[dicerollerphrase_you_added_a_roll]." ".$nflood." ".$vbphrase[dicerollerphrase_seconds_ago_please_wait_at_least]." ".$dicerollervar_floodlimit." ".$vbphrase[dicerollerphrase_seconds_between_adding_rolls]));
}
}
else {
$drthispost = $_REQUEST['p'];
$navbits[$parent] = $vbphrase[dicerollerphrase_addroll];
$navbits = construct_navbits($navbits);
eval('$HTML = "' .fetch_template('roll_addform'). '";');
eval('$navbar = "' .fetch_template('navbar'). '";');
eval('print_output("' .fetch_template('GENERIC_SHELL'). '");');
}
}
}
}
Key line:
$rollresultarray[$i] = mt_rand(1,$rollface);
Unless the php randomizer itself is screwy, I think we're just having a really bad streak of luck here...
DinbinFanfoom
23rd April 2009, 09:34 AM
There's also the possibility that pre-auto-roller DM's were fudging rolls in the PC's favour before, given an obvious string of crappy rolls. IE: Ash gets 3 sub-5's in a row... DM says "Uh, next roll is a... 19! Look at that!" This of course, is something just about all DM's do, good or bad, I'm not commenting on that. This would mean we are now experiencing the naked and raw chaos of the universe for the first time. :D We were unprepared for it's savagery!
Moonshadow
23rd April 2009, 11:08 AM
Hmmm, my rolls have gotten better with the Auto roller.
/eye ES
noptov52
23rd April 2009, 11:12 AM
Hmmm, my rolls have gotten better with the Auto roller.
/eye ES
Yeah you actually managed to nick a kobold or two :rotflmao:
Lycos
23rd April 2009, 11:16 AM
I think it's the Illuminati who have been messing with our adventures. Please feel free to make your own conspiracy theories. :D
Asharad
23rd April 2009, 12:34 PM
I don't really think there is anything wrong with the roller.
The idea that I rolled a one so my next roll has less of a chance of being a one is the gambler's fallacy. Every roll is unique.
I will grant you a string of sub 4 rolls seems weird but it's only really weird because it is noticeable.
I always chuckle when you go to a casino and by the roulette table they have a big, electronic sign that shows the last numbers that have come up. it (mostly) means nothing, because everytime they drop the ball the odds reset. but people swear y it anyway.
DinbinFanfoom
23rd April 2009, 12:37 PM
That is, of course true. The algorithm only becomes suspect when you look at trends / averages over time, as we have attempted to do. :) Looks like all is well... as most runs give you results in the 50% average range, and no significantly larger occurrences of one number over another. Just a bad run, yes. :D
Greebo
24th April 2009, 09:47 AM
more testing
Greebo
24th April 2009, 09:47 AM
Tab order of controls fixed
And also if you didn't know, after you tab between the fields and fill them in you can hit ENTER to post the roll if you were mousing to "roll" each time. You don't *have* to tab to the roll button first.
DinbinFanfoom
24th April 2009, 09:49 AM
Oooh! You critted your Asdfas! Roll and add!
Greebo
24th April 2009, 09:52 AM
Now *I*'m stealing ash's mojo apparently
EricStratton
24th April 2009, 03:14 PM
test
eta: nice, thank you.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.