PDA

View Full Version : Computers, dice, randomness



shadow_archmagi
2012-01-25, 10:51 AM
For the purposes of playing a game, is there a difference between numbers generated by an algorithm and by dice?

If so, what would the difference be?

Also, the conversation that triggered this


Friend: I don't like computers. They don't seem to generate average results very much.
Friend2: I know what you mean! In the rogue trader game I'm in, I rolled a bunch of 90s one time!
Friend: Yeah!
Me: Friend2, you rolled plenty of successes that day. You're just upset about one incident.
Friend2: Yeah, but I never did anything IMPORTANT right! It was all the armor penetration that I bungled!
Me: So you're saying that fair dice would've succeeded when you wanted them to and failed when it didn't really matter?

Saph
2012-01-25, 11:07 AM
For the purposes of playing a game, is there a difference between numbers generated by an algorithm and by dice?

If so, what would the difference be?

Depends on the algorithm and the dice. It's actually quite difficult to generate truly random numbers and so a lot of algorithm writers take the lazy way out and produce pseudorandom results that aren't very 'random' at all - I've seen "random number generators" that give you the same numbers every single time.

But more likely it's just observational bias.

DaMullet
2012-01-25, 11:32 AM
There are good and bad algorithms... On the one hand, you have http://xkcd.com/221/ and on the other you have http://www.random.org/. The former is just poor design, as Saph mentioned; the latter generates numbers based on atmospheric noise, which at least at present is random enough for any predictive purposes (atmospheres are VERY complicated systems).

Yora
2012-01-25, 11:33 AM
Because of the way current computers work, I don't think they actually can create truly random numbers.

But I think it would not be difficult to create pseudorandom number generators that create numbers that get closer to expected random distributions than actual dice. Since physical dice will have at least microscopic irregularities that affect how it falls.
You only would have to make the programm really complex.

http://xkcd.com/221/
But it's funny, 'cause it's true. :smallbiggrin:

Mustard
2012-01-25, 11:34 AM
I'm not an expert in the matter, but I think a low-quality computer (pseudorandom) number generator is far worse than a low-quality die (unless you include cheat dice). There are pretty good PRNGs out there, and I believe a popular algorithm is the Mersenne Twister. Uniformity is the quality we're interested in most of the time, since that is how an ideal die would perform.

But in common situations, I believe you get more or less equivalent results using either means of random number generation.

Tyndmyr
2012-01-25, 11:37 AM
Depends on the algorithm and the dice. It's actually quite difficult to generate truly random numbers and so a lot of algorithm writers take the lazy way out and produce pseudorandom results that aren't very 'random' at all - I've seen "random number generators" that give you the same numbers every single time.

But more likely it's just observational bias.

That said, actual, physical dice are probably less random.

Any random number generator now is likely based on a non-fixed seed, and is not going to give you the same numbers. They are, for these purposes, pretty damned random.*

It's definitely observational bias.


*It's not even about complexity. It's about your sources of entropy. Last digit(s) of time is, while not perfectly evenly weighted, pretty good for general use. That's the de facto standard, things like atmospheric measurements are even better. Assume they all crush bog standard dice from chessex or wherever.

Saph
2012-01-25, 12:00 PM
That said, actual, physical dice are probably less random.

Out of curiosity, how random are average-quality dice, assuming they're being rolled a decent distance?

Mustard
2012-01-25, 12:03 PM
The standard C/C++ random number generator is notoriously non-uniform, but it depends on your needs. If you need millions of uniformly random numbers, it is not a good choice, but for playing an RPG, it is probably sufficient.

If I were writing a dice roller, I'd still go grab Mersenne Twister. It's built-in to several programming languages, and in others, it's generally easy to grab an implementation.

Chauncymancer
2012-01-25, 12:08 PM
The trouble is that out of say, 3 dice, all three are probably slightly biased. But since you probably haven't looked at your dice through a magnifying glass or run the omega's and sigma's on a table of results, you don't know what the bias of the three dice are, and thus to you, the roll is random. (BC when you pick a die, you randomly pick a bias.)
In reality, the die's 'randomness' probably falls away very quickly, but obnoxious numbers of dice let you pull a random number out of a hat.
(PS. Expensive, hard, incredibly sharp dice stay more 'random' longer, but will eventually break in a way that makes them un-rollable.)

Tyndmyr
2012-01-25, 12:11 PM
Out of curiosity, how random are average-quality dice, assuming they're being rolled a decent distance?

I once did about a ten-thousand roll test on Games Workshop dice. I'm afraid I no longer have the detailed results around, but I evenually came to the conclusion that certain values had a >5% higher chance of coming up than they should have, especially for specific dice. A substantial portion of the dice(>25%) had visibly noticable air bubbles inside when I cut them open.

Chessex is notably better, but air bubbles and the like are still fairly probable.

I haven't done any testing on the precision dice you see sold at conventions, but as they're clear, and I haven't noticed any bubbles in any of them, I suspect they perform a lot better. Likewise, casino dice should perform pretty well.

The above all assumes a decently fair roll, but larger skews can always be gotten if you have poor rolling style.

GeekGirl
2012-01-25, 01:17 PM
I found a really good article about random number generators. It was basically explaining at the hardware level on a computers it always starting with the same base, they use so information hard coded in to the processor. something with either production date or time. It was a few months ago and I don't remember everything, so I'm not going to say to much more. I will find it and repost, it was a fun read.

Found it (http://spectrum.ieee.org/computing/hardware/behind-intels-new-randomnumber-generator) Thought its more about random number on a a hardware level for encryption than I remembered. Not really what your looking for, still worth a read.

shadow_archmagi
2012-01-25, 01:53 PM
I once did about a ten-thousand roll test on Games Workshop dice. I'm afraid I no longer have the detailed results around, but I evenually came to the conclusion that certain values had a >5% higher chance of coming up than they should have, especially for specific dice. A substantial portion of the dice(>25%) had visibly noticable air bubbles inside when I cut them open.


Interesting. Has anyone else taken the time to do this sort of study, or a comparative one for RNGs?

razark
2012-01-25, 02:05 PM
Out of curiosity, how random are average-quality dice, assuming they're being rolled a decent distance?

1000 roll test on my Chessex D20


Result Percentage
1 3.9
2 4.8
3 5.1
4 6.5
5 6.8
6 5.3
7 3.6
8 3.7
9 5.8
10 5.2
11 4.7
12 4
13 5.2
14 4.5
15 5.7
16 4.5
17 5.5
18 5.7
19 5.8
20 3.7

Tyndmyr
2012-01-25, 04:12 PM
Given that the 20 and 1 are on opposing sides, it sounds like you've got a die that's not perfectly round(surprisingly common, I realized at one point in a random game that I got notably different heights when I stacked a bunch of D20s in a different way. Not a good sign.). Those are some pretty notable differences from random, and you'd be quite unlikely to get that level of inequality on that many rolls.

kyoryu
2012-01-25, 04:23 PM
Computer RNGs are *not* random. They are pseudo-random. Meaning, given a particular "seed" number, they will generate the same results every. single. time. However, PRNGs are typically seeded with the start time, making them, for all practical purposes, pretty darn random.

Realistically, the distribution of a decent PRNG, for a given small sample set (what would be used in a typical game) is close enough to random for all reasonable purposes.

"I just rolled three 90s, this isn't random at all!" is just an example of the Gambler's Fallacy. It's an outlier, which is why it's noticed.

There are really a few questions that can be asked about PRNGs.

1) Is the result sufficiently random to enable a good gaming experience? Or will the PRNG's bias be a sufficient factor that it becomes part of strategy?

2) Is the bias of a PRNG greater than the variance from "pure random" for a set of the typical size used in a game? IOW, can we tell the bias from normal deviation from "perfectly" random given the typical number of rolls used?

3) Is the result of a PRNG more or less biased than a typical result from typical physical dice, given manufacturer imperfections?

Note that even a sample size of 1000 is probably insufficient to really measure. However, my experience with PRNGs (even the crappy default ones) has been that they are *far* less biased than razark's sample.

I'll try to write a couple sample ones (probably C#/C++) and post the results later.

Mastikator
2012-01-25, 04:26 PM
1000 roll test on my Chessex D20


1000 rolls isn't that high, you should try 10 million rolls. Should only take a second anyway. You'll get more accurate results of the algorithms bias.

Doug Lampert
2012-01-25, 04:35 PM
Quite often a computer method has been fairly thoughly tested for uniformity (i.e. the psuodo-random numbers are even distributed), but hasn't been nearly as well tested to assure there are no patterns.

You get generators that start repeating every few hundred thousand rolls, or where every Nth roll has a strong bias but the other rolls are "close enough" to random, or where a high number is more likely to be followed by a low number but again it averages out.

Again, most of these paterns are unnoticable to actual people playing an actual game. But they can be important.

Also: Not all randomizers use a random seed by any means. Lots of the softwear apps I work with we WANT a result to be reproducable. So the seed always defaults to the same value unless specifically reset, and even then you have to give it a seed which is recorded in your output for later debugging and checking.

We want a monte-carlo ensemble to be "random", but we also want to be able to reproduce any problems. So the ideal is that the user picks a reasonable random seed by using atmospheric pressure or thermal variation or exact time or whatever, and inputs it so if he wants to he can reproduce the result later.

razark
2012-01-25, 04:42 PM
"I just rolled three 90s, this isn't random at all!" is just an example of the Gambler's Fallacy. It's an outlier, which is why it's noticed.
Looking over the list of results while conducting the experiment, I was surprised by the number of times I'd get a number come up multiple times in a row, or the same pattern come up (for example: A,B,C,A,B,C).


Note that even a sample size of 1000 is probably insufficient to really measure. However, my experience with PRNGs (even the crappy default ones) has been that they are *far* less biased than razark's sample.
When I looked at the first 100 or 200 rolls, the frequency distribution was quite different. It was interesting to watch it evolve as more rolls were added.



1000 rolls isn't that high, you should try 10 million rolls. Should only take a second anyway. You'll get more accurate results of the algorithms bias.
I'll have to get back to you on that. I was actually thinking of trying it with a couple other D20s I have around here.

Douglas
2012-01-25, 04:46 PM
I haven't done any testing on the precision dice you see sold at conventions, but as they're clear, and I haven't noticed any bubbles in any of them, I suspect they perform a lot better.
You can order those online too. Search for "precision dice" on Amazon, or go looking for the company's own website (I think the company is Game Science). They're substantially more expensive than normal dice, but the physical differences are quite noticeable and seem like they would contribute to fairer probability distributions - I haven't actually done any statistical tests to be certain.


Likewise, casino dice should perform pretty well.
Casino dice have some insanely tight quality requirements mandated by law, something like 1/5000th of an inch tolerance on shape and presumably a similar requirement for distribution of weight. They are also retired from casino use pretty quickly to prevent wear from use spoiling the fairness. Unfortunately, as far as I know casinos only use d6s so no company exists that makes other dice with that level of precision.

tyckspoon
2012-01-25, 04:55 PM
Casino dice have some insanely tight quality requirements mandated by law, something like 1/5000th of an inch tolerance on shape and presumably a similar requirement for distribution of weight. They are also retired from casino use pretty quickly to prevent wear from use spoiling the fairness. Unfortunately, as far as I know casinos only use d6s so no company exists that makes other dice with that level of precision.

And unless you took excessively good care of them, your typical use (getting rock-tumblered with other dice in a bag/box, rolling against all kinds of random surfaces, getting rolled for no purpose other than to be rolled when you're bored, etc) of gaming dice would wear them down pretty quickly anyway.

Coidzor
2012-01-25, 05:01 PM
The above all assumes a decently fair roll, but larger skews can always be gotten if you have poor rolling style.

What are optimal rolling styles anyway? I used to keep having arguments with one friend that basically just dropping the die flatly isn't going to produce a good roll as it's essentially just whatever was facing up unless it hits a corner and flops over one where he'd counter that it'd be random enough based on how his handling would cause a different die result to be top before he dropped it.

This only got worse when he started basically having a steady series of very low rolls that lead to a couple of character deaths from poor saves.

kyoryu
2012-01-25, 08:59 PM
And unless you took excessively good care of them, your typical use (getting rock-tumblered with other dice in a bag/box, rolling against all kinds of random surfaces, getting rolled for no purpose other than to be rolled when you're bored, etc) of gaming dice would wear them down pretty quickly anyway.

Exactly. Look at casino dice - precision made, holes filled with material of the same density, and retired very quickly.

Gaming dice just don't meet the same quality criteria.

Tyndmyr
2012-01-26, 11:00 AM
What are optimal rolling styles anyway? I used to keep having arguments with one friend that basically just dropping the die flatly isn't going to produce a good roll as it's essentially just whatever was facing up unless it hits a corner and flops over one where he'd counter that it'd be random enough based on how his handling would cause a different die result to be top before he dropped it.

This only got worse when he started basically having a steady series of very low rolls that lead to a couple of character deaths from poor saves.

A die basically exists to give you a fairly large degree of variance from slight changes in the initial condition. So...you're going to want it to bounce/roll a bit. Dropping can be sufficient, if there's a good deal of height, but if it's say, just tipping it off your hand onto the table, that's clearly insufficient, as you'll be able to, with a little practice, greatly influence the results. I personally like a good sideways roll, as you get good variance in results, but the die doesn't go randomly flying off the table. Dice towers and the like also work well.

nooblade
2012-01-26, 11:32 AM
Computer RNGs are *not* random. They are pseudo-random. Meaning, given a particular "seed" number, they will generate the same results every. single. time. However, PRNGs are typically seeded with the start time, making them, for all practical purposes, pretty darn random.

I remember when I was first derping around with this, I made the mistake of calling seed within a loop. If I went through that loop quickly enough, I'd start with the same seed and get the same numbers. That's one programmer error that will result in always getting the same numbers. It's a programmer error and not a computer one. The system is designed to be the most random for just one seed at the start. Sometimes less human work is better.

The time function in time.h actually gives the number of seconds since January 1, 1970. Divide by 3600 seconds per hour, 24 hours per day, and ~365 days per year and you get 42, which is the Ultimate Answer to the Question of the Meaning of Life, the Universe, and Everything. Also the number of years since 1970. The leap years don't matter because we're almost done with January now.

But there is something fun about rolling the dice yourself that the computer doesn't give, even if it leads to all kinds of kooky superstition or practical cheating with weighted dice.

Knaight
2012-01-26, 11:49 AM
1000 rolls isn't that high, you should try 10 million rolls. Should only take a second anyway. You'll get more accurate results of the algorithms bias.

The Cheesex d20 rolled was an actual, physical die. 10 million rolls is going to take 10,000 times as long as 1000 rolls, which I'd estimate at about 20 minutes. 200,000 minutes is rather a lot.

Roderick_BR
2012-01-26, 01:14 PM
Computer RNGs are *not* random. They are pseudo-random. Meaning, given a particular "seed" number, they will generate the same results every. single. time. However, PRNGs are typically seeded with the start time, making them, for all practical purposes, pretty darn random.
(...)
Exactly. When you get a seed, it'll give you the same sequence of results. Good programs, however, will randomly choose a seed by random*, among hundreds of seeds, each different from each one, and will re-choose it after every single roll.

*This random part is usually user-activated, for example, the instant you press the button, it'll calculate the hour-minute-second-millisecond, run some calculations, and based on that, then he'll choose a seed, meaning that every single time you activate it, it can randomly choose a list of numbers to choose from. You'll very rarely run the same calculation again. Run enough variables and calculations at once, and you'll get VERY random numbers.

Tyndmyr
2012-01-26, 01:19 PM
Exactly. When you get a seed, it'll give you the same sequence of results. Good programs, however, will randomly choose a seed by random*, among hundreds of seeds, each different from each one, and will re-choose it after every single roll.

You do not necessarily want to re-choose seeds after every roll. Using shared seeds is how you do some nifty stuff like verifiable rolls. As long as the distribution is even and there's a lack of predictability to the users, sticking with the same key is fine.

DaMullet
2012-01-26, 02:25 PM
A slightly more complicated line of inquiry is, how many levels of recursion do you need to make a poor seed algorithm into a less poor one? If you generate your random number with a seed, and you previously generated that seed with the same algorithm, how many times do you need to generate a seed for the next level before you start seeing more respectable results? Or is this method exactly as uniform as the algorithm you're seeding and no more?

nooblade
2012-01-26, 03:16 PM
A slightly more complicated line of inquiry is, how many levels of recursion do you need to make a poor seed algorithm into a less poor one? If you generate your random number with a seed, and you previously generated that seed with the same algorithm, how many times do you need to generate a seed for the next level before you start seeing more respectable results? Or is this method exactly as uniform as the algorithm you're seeding and no more?

If you start out with a set of numbers which are not random, and you select numbers from that set using methods which are not random, how do you get more randomness? I think the XKCD comic is about this--you generate your bunch of numbers but as data they're nothing special. I can do an experiment really quick. Results are in. I'd say it's better to just seed once. (http://img513.imageshack.us/img513/4038/testua.png)

But I'm not getting as many total numbers as I should. I don't know where they went. :smallannoyed: It comes to 900,000 numbers in the first set, better in the second. Maybe it's due to the typecasting to int in my function? Oh well. All programs have bugs.

Probability and statistics aren't my best subjects, but this kind of thing makes me want to study them. For now, I'm more inclined to trust the set of numbers that mathematicians say is random enough for my purposes (a game is not an exercise in cryptography). And I'm pretty impressed by the grouping on a million rolls of the twenty sided die.

Tengu_temp
2012-01-26, 03:46 PM
Gah, why did I discover this thread only after all the major points have already been made? Pseudo-random numbers are one of my biggest interests as far as computer science is concerned.

Anyway, to answer the OP's question: as long as you use a decent pseudo-random number generator, it should be enough for gaming purposes and probably more equally distributed than most dice. If it keeps rolling very high or very low for you, then you probably just have good or bad luck.

kyoryu
2012-01-26, 04:36 PM
A slightly more complicated line of inquiry is, how many levels of recursion do you need to make a poor seed algorithm into a less poor one? If you generate your random number with a seed, and you previously generated that seed with the same algorithm, how many times do you need to generate a seed for the next level before you start seeing more respectable results? Or is this method exactly as uniform as the algorithm you're seeding and no more?

"proper seed algorithm"? Not quite sure what you mean by that. Again, many games will use the start time as a seed - meaning that it'd be pretty darn difficult to actually regenerate the same seed again, as well as requiring explicit effort on the part of the user, and even then getting to a second, much less millisecond, would be pretty tough.

The quality of the algorithm is independent of the seed. That's a big part of the definition of the algorithm quality of a PRNG.

Soylent Dave
2012-01-26, 10:33 PM
The Cheesex d20 rolled was an actual, physical die. 10 million rolls is going to take 10,000 times as long as 1000 rolls, which I'd estimate at about 20 minutes. 200,000 minutes is rather a lot.

And that wouldn't show how precise the die is.

It would show you how precise it was - with each roll eroding the die a little (especially on the corners).

Due to the observer effect, the act of measuring the precision of a die makes it less precise in future.

...so that's fun.

huttj509
2012-01-27, 12:04 AM
Depends on the algorithm and the dice. It's actually quite difficult to generate truly random numbers and so a lot of algorithm writers take the lazy way out and produce pseudorandom results that aren't very 'random' at all - I've seen "random number generators" that give you the same numbers every single time.

But more likely it's just observational bias.

It's also quite difficult to generate truly random dice.

Crud, can't remember the link to the video of the guy explaining why his dice were worth the extra cost, had some good examples of various gaming D20s not being spherical due to a tumbling method of painting the numbers. It was a video of his booth from GenCon or something.

Edit: Found it (http://www.youtube.com/watch?v=bR2fxoNHIuU) and part 2. (http://www.youtube.com/watch?v=PxmkWrDbn34&feature=related)

Rockphed
2012-01-27, 10:44 PM
Well, you can actually get pretty random is you drive flip-flops into a metastable state and let them come out on their own. However, that sort of technology is far from standard. And typically it doesn't produce numbers fast enough, so they end up just seeding a pseudo-random number generator with it.

Knaight
2012-01-27, 10:50 PM
It would show you how precise it was - with each roll eroding the die a little (especially on the corners).

Due to the observer effect, the act of measuring the precision of a die makes it less precise in future.

That's less "observer effect" and more a combination of friction and rapid deceleration. That said, you're very much right - after ten million rolls your die is probably roughly spherical.

PetterTomBos
2012-01-28, 07:20 AM
Under the hood, how the c++ random number generator works.

I call for a random number, then it takes the last random number it made (or the seed, if you sees'ed) multiplies it with a really big prime number, and then divide that by another big prime number:

seed*huge prime/huge prime.

Which should pop out a quite unpredictable number. Funny how I just had a debate on this with a friend of mine the other day xD

Martin Greywolf
2012-01-28, 09:37 AM
Hm, I donīt think anyone mentioned this yet, but if you look for real randomness, there is only one place: radioactive decay.

Even if you roll a die, itīs just a really complicated system - you could learn to throw die in a way that you would always get the same number (yīknow, theoretically, no idea if someone managed to do it with casino dice).

Decay of, say, uranium is a funny thing, though. Not only does it not decay if you are watching it, there is no known factor in the world that determines when it will decay. So, if you use this as a seed in your RNG and your algorithm doesnīt suck, yeah, you have only true randomness we really have.

shadow_archmagi
2012-01-28, 12:00 PM
not decay if you are watching it

I find this difficult to believe.

Soylent Dave
2012-01-30, 11:02 AM
That's less "observer effect" and more a combination of friction and rapid deceleration.

Which in this case is textbook observer effect - the act of measuring something alters the result.

i.e. in order to measure multiple results rolled on a die, you have to roll it - which wears the edges away and changes the shape of the die.

(ooh - unless you rolled it in a frictionless environment. But that would have the consequence of never stopping... your dice would never wear out though, so swings and roundabouts, eh?)



Uranium [does] not decay if you are watching it

I find this difficult to believe.

Radioactive decay is the 'watched pot' of physics.

But there's a lot in quantum mechanics which is pretty difficult to believe (like quantum tunnelling)

Dimers
2012-01-30, 12:20 PM
Anyone got data and/or opinions on the performance of the GitP forum die roller?

Knaight
2012-01-30, 02:17 PM
Which in this case is textbook observer effect - the act of measuring something alters the result.


It doesn't matter whether you measure it or not. If you roll the die, don't check what it says, and roll it again that first roll - which was not a measurement - still alters future rolls. Observing the die doesn't actually have any noticeable effect (given that the die is very much macroscopic that isn't surprising), rolling it does. It just looks like observer effect at a casual glance because you are measuring something and the results are changing, even though the two are related only inasmuch as the same action (rolling the die) is required for both of them.

Jay R
2012-01-30, 03:20 PM
1000 roll test on my Chessex D20


The Chi-squared value for this data is 30.3. With 19 degrees of freedom, that is high enough to reject the null hypothesis that the die is unbiased at the alpha = 5% level, but not at the 4% level.

The p-value is actually 0.0481024.

What does this mean? There's not really enough evidence to declare the die biased, except with a test so weak that you would conclude that 5% of all perfect dice were also biased.

The bias on a die is small enough that it will take a lot more rolls than that to prove it's there.

But I'm prepared to declare the die is biased based on other evidence - it's Chessex. Any die except a casino die or a sharp-edged GameScience die will have bias, just from the process of rounding the edges.

But the bias is small enough that it won't have a serious effect on a game that only lasts a few years. If you're still worried about it, get several dice and draw one at random to roll each time. That way, their biases are more likely to cancel each other. (There will still be an overall bias, but it will be much smaller.)

The average computer pseudorandom method will be much closer to perfect. I just did the same test on the one in Excel twenty times, with 1,000 rolls each, to be comparable to yours, and never got a result as far off as yours was.

It's possible to write a poor algorithm, and there were some in the early days, but today I doubt if you can find an algorithm actually implemented as biased as the average gaming die. Mersenne twister algorithms are useful for up to 10 to the 6,000 rolls. That's far less bias than any real die (even a casino or GameScience die).

Rockphed
2012-01-30, 03:46 PM
But there's a lot in quantum mechanics which is pretty difficult to believe (like quantum tunnelling)

Quantum tunneling is not hard to believe. The same thing happens with total internal reflection of EM waves. Put simply, the probability of a particle passing a barrier is similar to the magnitude of a decaying electromagnetic wave as a function of position. The math is, actually, really similar.

razark
2012-01-30, 04:15 PM
The Chi-squared value for this data is 30.3. With 19 degrees of freedom, that is high enough to reject the null hypothesis that the die is unbiased at the alpha = 5% level, but not at the 4% level.

The p-value is actually 0.0481024.
The statistics class I took is way too far in the past. I'll take your word for it.


What does this mean? There's not really enough evidence to declare the die biased, except with a test so weak that you would conclude that 5% of all perfect dice were also biased.
I'm still using it as evidence that my dice are horrible, evil, biased little monsters that need to be replaced. Fortunately, the wife has less of an understanding of statistics than I.


The bias on a die is small enough that it will take a lot more rolls than that to prove it's there.
I never considered it a serious test. It was really just something to pass the time during a slow week. I just happened to have it when this thread came up.

shadow_archmagi
2012-01-31, 05:05 PM
Radioactive decay is the 'watched pot' of physics.

But there's a lot in quantum mechanics which is pretty difficult to believe (like quantum tunnelling)

The whole observation wizardry always seemed particularly tricky to me. Could you cite a source for uranium feeling like its being watched?

Grinner
2012-01-31, 06:47 PM
Anyone got data and/or opinions on the performance of the GitP forum die roller?

Actually, I've been thinking of writing a script to do that. Problem is that I'm terrible at writing parsers, so I'd have to sort all of the resulting data by hand.

deuxhero
2012-01-31, 10:47 PM
Depends on the algorithm and the dice. It's actually quite difficult to generate truly random numbers and so a lot of algorithm writers take the lazy way out and produce pseudorandom results that aren't very 'random' at all - I've seen "random number generators" that give you the same numbers every single time.

But more likely it's just observational bias.


It's possible to produce a truly random number?

Rockphed
2012-01-31, 11:08 PM
It's possible to produce a truly random number?

I think that is a good question. Is there true random in this universe?

Bovine Colonel
2012-01-31, 11:12 PM
I think that is a good question. Is there true random in this universe?

I'd say so, yeah. (http://en.wikipedia.org/wiki/Uncertainty_principle)

PairO'Dice Lost
2012-02-01, 12:53 AM
Actually, I've been thinking of writing a script to do that. Problem is that I'm terrible at writing parsers, so I'd have to sort all of the resulting data by hand.

I've done a fair bit of data analysis and parsing, so as long as we're allowed to just post a few bazillion rolls, I can whip up a script to analyze the roller for us.

Tyndmyr
2012-02-01, 08:54 AM
The Chi-squared value for this data is 30.3. With 19 degrees of freedom, that is high enough to reject the null hypothesis that the die is unbiased at the alpha = 5% level, but not at the 4% level.

The p-value is actually 0.0481024.

What does this mean? There's not really enough evidence to declare the die biased, except with a test so weak that you would conclude that 5% of all perfect dice were also biased.

The bias on a die is small enough that it will take a lot more rolls than that to prove it's there.

Honestly, a 95% confidence that it's biased is good enough for me.

I make a habit of doing such tests occasionally when I suspect a die is biased...it isn't perfect, but it's hella better than going off heavily confirmation biased occasional observation.

Given that a die is a coupla bucks at most, I'm ok with a slight chance of accidentally tossing a good die.

Psyren
2012-02-01, 09:43 AM
As long as they're biased away from the 1s I'm fine :smalltongue:

Tyndmyr
2012-02-01, 09:51 AM
As long as they're biased away from the 1s I'm fine :smalltongue:

Heh, unless you use a counter D20, you shouldn't see a ridiculous high/low skew overall, because of the alternating numbers...that said, if there's an air bubble under the 20...

Jay R
2012-02-01, 11:04 AM
Honestly, a 95% confidence that it's biased is good enough for me.

I make a habit of doing such tests occasionally when I suspect a die is biased...it isn't perfect, but it's hella better than going off heavily confirmation biased occasional observation.

Given that a die is a coupla bucks at most, I'm ok with a slight chance of accidentally tossing a good die.

Actually, you'll never toss a completely fair die, because you'll never own one. The closest you can get are casino dice and straight-edged GameScience dice. They are far better than the round-edged dice most people sell, but they aren't truly unbiased either. But casino dice are close enough for casinos to make money with, which ought to be good enough for your D&D game.

The problem with tossing biased dice is that you will toss all your dice.

Tyndmyr
2012-02-01, 12:38 PM
Actually, you'll never toss a completely fair die, because you'll never own one. The closest you can get are casino dice and straight-edged GameScience dice. They are far better than the round-edged dice most people sell, but they aren't truly unbiased either. But casino dice are close enough for casinos to make money with, which ought to be good enough for your D&D game.

The problem with tossing biased dice is that you will toss all your dice.

I don't need 100% fair dice. If a thousand roll test gets me results that look like a fair die, that's close enough in my book. I'll call it fair in general practice because it's as fair as I'm going to get. I'll toss the ones with obvious bias. If I toss one or two good dice in doing that, meh.

(or at least it was before I rolled it)

phineus
2012-02-02, 06:43 AM
i think rolling dices is the best option as far as randomness goes....given that all the players don't take it serious enough to try and learn to get required numbers..... (cheat in other words)........computer generated numbers cant be as random as the die but there the chance of controlling is lesser than in dice unless of course if you try too hard and hack the computer being used (cheat).....

Tyndmyr
2012-02-02, 10:07 AM
i think rolling dices is the best option as far as randomness goes....given that all the players don't take it serious enough to try and learn to get required numbers..... (cheat in other words)........computer generated numbers cant be as random as the die but there the chance of controlling is lesser than in dice unless of course if you try too hard and hack the computer being used (cheat).....

What?

Computers are more random than dice.

It's generally easier to cheat a roll with a dice(ie, buy a cheater die, or bake your own, or spend a trivial amount of time learning how to cheat rolls) than it is to hack a computer in such a way as to skew the randomness for you.

If your players aren't gonna cheat a roll, they're not gonna hack a computer to cheat either.

kyoryu
2012-02-02, 01:34 PM
i think rolling dices is the best option as far as randomness goes....given that all the players don't take it serious enough to try and learn to get required numbers..... (cheat in other words)........computer generated numbers cant be as random as the die but there the chance of controlling is lesser than in dice unless of course if you try too hard and hack the computer being used (cheat).....

Have you read this thread? Given the typical quality of dice used in gaming, a computer PRNG will have less bias that physical dice.

That being said, rolling dice is more fun.

shadow_archmagi
2012-02-03, 10:57 AM
Given its use of the word "Dices" I'm not sure the post was ever meant to be coherent or contributory.

Grinner
2012-02-03, 12:09 PM
It's generally easier to cheat a roll with a dice(ie, buy a cheater die, or bake your own, or spend a trivial amount of time learning how to cheat rolls) than it is to hack a computer in such a way as to skew the randomness for you.

For the sake of accuracy, I'm going to have to disagree with that. Certain methods, like memory editing, are likely to be considerably easier. Depends on your skill set, really.

Tyndmyr
2012-02-03, 01:43 PM
For the sake of accuracy, I'm going to have to disagree with that. Certain methods, like memory editing, are likely to be considerably easier. Depends on your skill set, really.

Learning the skillset to hack a computer is a lot harder than getting the skillset to fudge a die roll.

Baking a die, for instance, basically malforms the dice slightly, but is an entirely one time deal, and is pretty easy to pull off.

Edit: Hell, finding out which dice you have that are already unintentionally weighted a specific way requires basically no skill at all other than the ability to use a die and the ability to count.

shadow_archmagi
2012-02-03, 02:56 PM
Also keep in mind that it's easy to bring derp dice to a gaming session, whereas it's often considerably more difficult to get access to the GM's computer

Jay R
2012-02-04, 06:29 PM
I don't need 100% fair dice. If a thousand roll test gets me results that look like a fair die, that's close enough in my book. I'll call it fair in general practice because it's as fair as I'm going to get. I'll toss the ones with obvious bias. If I toss one or two good dice in doing that, meh.

(or at least it was before I rolled it)

The easiest way to get dice with the least possible bias is to buy casino d6s and GameScience sharp-edged polyhedra for the rest.