Probability Explained (Salty Style With Weird Examples)

It’s google imagesearch’s rabbit, but I agree that it is beautiful and i love them, too. (I live in a tiny 1-room-apartment and am disabled, so I couldn’t care for any kind of pet or I would so keep rabbits, though!)

1 Like

Aww, I’m sorry you can’t have one. I had two when I married and I’ll have some in future and build an outside run for them.

1 Like

:heart_eyes: That sounds wonderful and it’s so great that you will keep more than one so that they can have company! Too many people keep solitary rabbits in small cages, it’s sad! I hope that when the day comes, you will post lots of photos of your new bunnies!

…Thread derailment. Lemme quickly quote something before I get yelled at again.

That explains everything going on on my account, ever. No clue about seeds and salt but I wanna trade my salt. Is that possible? Might or might not come with a rabbit licking your salty hands if you take my salt.
ed423f6f45dd9e231452dde9ce7a8754

Thread derailment… okay, not averted at all. But still. Bunnies. And unicorns. And salt. And stuff.
…Is it called ‘salt’ because Salty made this thread?
I am so confused and need to go to bed.
No seriously, though - I pulled 3 mythics at once from 50 VIP chests and that was about it for the rest of ever. One superlucky day. Also got two legendaries I had really wanted that day. And that was the end of my luck forever. I swear my RNG is weird.

2 Likes

Potentially, yes.

We need more information on what RNG they use (standard library procedure?) and how it is really seeded. If time stamps are used, how are they generated and to what accuracy. Is the accuracy of time stamps user network related?

Grundulum, there is no absolute test.

Let me vastly over simplify, by picking the scenario where you think the chance that something is going to happen is 50% (for example, getting heads on a coin flip), but you record some number of trials, n, and the event doesn’t occur (you get all tails). What is the probability of that happening if the odds are correct, and the coin flip is fair?

Well, the probability of getting tail on one flip is 1/2. Even if that happens, you have no evidence the coin is not fair, because there is a very high likelihood of that outcome occurring.

For two coin flips to both come out tails, the likelihood of it occuring is 1/2 * 1/2, or 1/4. Still not a lot of evidence.

On the other hand, if you get 20 tails in 20 trials, the odds are 1 in 1,048,576 of that happening by chance. You might at that point begin to suspect the coin is not fair–but it is still not absolute proof. It’s the literal one in a million chance, as it were.

You have to have a large enough sample size to get the amount of statistical confidence that you desire… which is a fancy way of saying you have to do enough trials that the odds of getting an inappropriate outcome by bad luck are low enough you feel good about your conclusion.

But performing these tests correctly, and doing the math correctly, is challenging. For example, just finding a streak of m tails in a row isn’t a trial. With a large enough sample size, you will eventually get streaks of almost any number.

If you have hundreds of people doing hundreds of trials of n coin flips, even something as rare as eight trials with all tails (1/256) or ten trials (1/1024) will happen sometimes. Even rarer events are going to happen sometimes if you have enough trials, so just because someone reports “this happened” doesn’t mean that the process behind it isn’t random.

1 Like

Thanks for this post, I actually understood this. All this stuff about seeds and whatnot I didn’t, but this I got. :smiley:

1 Like

You missed the whole pseudo part in (pseudo)RNG.

Salty should have never been asked to make this thread. It’s a ‘complicated’ subject and not a ‘social media’ topic, though I bet the devs wished it was lol.

Salty, this is not a topic for you. Not to be rude, and I’m sorry if it appears that I am. This is serious Maths and not social media.

1 Like

UK,

With respect, within the tolerances of games, good pseudo-random number generations really are good enough, if they are used correctly.

The actual non-randomness and periodicity of pseudo-random number generators is a vanishingly small contributor to the actual game outcomes, unless there is an egregious programming bug. Any such bug is also more far, far more likely to be in the logic that consumes the random numbers than in the random number generator itself assuming that the generator was not home rolled… and why would anyone do that? Unity comes with one. I am sure whatever the server side technology is, it also has one.

Monto carlo simulation is even a well accepted scientific practice, which relies on the same type of pseudo random number generation, although those generators may be subject to more scrutiny than one that is used in a games library.

This does assume true randomness and not pseudo-randomness. The algorithms for randomness in many, many games can be seen to have bugs in them.

For instance, based on probability, I should never see one color of gem spawn for all 64 gems dropped in a cascade more than once. Seeing it multiple times, often means some type of error, often a race condition in how multiple random number requests are seen and handled.

GoW is doesn’t seem as bad as Mavel Puzzle Quest was. It’s random was very poor, and I saw “Once in a lifetime” events more than once. Places where the odds of me witnessing something were around 1 in a trillion games, that I saw more than 20 times. It seemed to suffer from a performance based race condition that would return the previous result of the random generation if a small delay occurred.

Usually yes, except in lottery situations.

And I’m a wealthy duck with all mythics and 30k gems, 3k gems keys, etc obscene wealth.

Random processes are non-intuitive, and perhaps require some education and thinking to understand, but they are not inscrutable, and I do think it is appropriate to try to explain them even for people who don’t want to take a university level probability and statistics course.

Our brains have evolved as incredibly efficient pattern detection systems. We see patterns everywhere. This is a good thing when you want to see the evidence of the bear in the forest from the movement of the leaves on the the trees, even if you cannot see the bear.

But it can be bad, when it makes you think that there are patterns that don’t exist, such as thinking that getting ten blacks in a row on a roulette wheel means red is “due”–the classic gambler’s fallacy.

Within any reasonable level of accuracy for games, one can treat pseudo random numbers as if they were truly random, and the reasoning is the same, outside of a terrible bug.

Recognizing what random really looks like is hard, though, before claiming the outcomes in a game are not at least a reasonable simulation of true randomness.

Here is a classic example:

Which one is the random dot distribution?

Surprisingly, the answer is NOT the top one, where the dots are seemly distributed evenly. There is some effect or correlation in the data of that image making the distance between dots fairly consistent. The streaks that characterize real random data are not there.

The bottom image is a classic random distribution. Sometimes, by pure chance, there is clumping. Sometimes, again by pure chance, their are little streaks of emptiness.

Yes, pseudo-random number generators are not truly random, and the nth number of the sequence has an effect on the n + 1’th number. This is true. But it is also true that well designed pseudo-random generators give sequences of numbers that are distributed as if they were random, and which one can, within the limits of almost any purpose, treat as random, when they are used correctly.

When absolute true randomness is critical (which is not the case in games!), such as generating highly trustable encryption keys, there are hardware devices that can observe truly random physical processes (like background radio noise, or radioactive decay events) and derive random numbers from these processes. The problem is that they are fairly slow (in computer time), as actual physics must take place, and be observed.

For almost any other purpose, pseudo random numbers are plenty good enough.

Note: the image was stolen shamelessly from this post, which is a great read:

6 Likes

UK,

Well, yes, but lotteries use those ping pong ball things or other physics based random or at least chaotic processes to get their winning numbers… :slight_smile:

And it would be a whole separate post I am too lazy to write about why one should not play the lottery until and unless the mathematical expectation turns positive (which has been done in the past!)

Eso, those are bugs in the programming logic which is consuming the (pseudo) random number sequences, and not in the pseudo-random generators themselves.

The outcome would not have changed even if a magical true hardware based random number provider was in use.

It is misleading to suggest that because computers use pseudo-random number sequences that it is the number generator that is at the root of issues, when it almost never is.

I don’t gamble because I’m not stupid and I’m honest, an unfortunate combination.

You’ve no idea what you’re talking about.
“It is misleading to suggest that because computers use pseudo-random number sequences that it is the number generator that is at the root of issues, when it almost never is.”

2 Likes

All these crappy useless troops coming into the game blocking the rates of getting the better troops :smiley:

1 Like

No one’s going to ‘destroy’ Salty’s point because it is 100% true of independent events. That people don’t like it and expect someone to tell them it works differently is only proof “our brains don’t understand probability”. Some things in life aren’t intuitive. For example, I once thought, “Grown humans of sound mind won’t intentionally eat Tide Pods.” That’s been shattered. (I guess you could argue perhaps Youtube hosts aren’t of sound mind but whatever.)

One can argue the game isn’t “truly” random, or that maybe the RNG algorithm has flaws, but the problem is you’re chasing a different question with that answer. The correct question for that discussion is, “Can I do something, in game, that will manipulate the results of my RNG in a predictable fashion?” What we can say is, “Every action you take manipulates the RNG”, but so long as you cannot predict the outcome it’s still random.

For analogy: suppose I’m going to roll a die and, if I roll five or better I get all of your money. You offer a compromise: you want to eat a taco first. I sigh, let you, then roll the die. We can argue that due to wind, cosmic waves, or whatever that eating the taco meant rolling the die at a different time and getting a different result. But you don’t know if your odds got better or worse. What you want is to take a compromise like, “Can I place a piece of tape on the die to imbalance it?” Doing that will influence the results and make it less likely I take all of your money.

RE: “bad RNG implementation” via @Exoxnepa: “really rare” is not the same thing as “never happens”. So long as the probability is not 0, something can happen twice. In Amazon’s servers, theoretically one-in-a-billion bugs happen several times per minute because they are performing hundreds of trillions of operations over their vast computing empire. The only way to make something NEVER happen twice is to record when it happens, then use that record to stop the code any time the game decides to do it again.

But since people don’t intuitively get “nothing about flipping a coin is guaranteed”, they don’t get the last paragraph either.

1 Like

Making things too complicated does not help anyone. :wink:

It is substantially more simple than you think and quite easy to determine if the coin is fair or not fair.

There are multiple clear tests to determine whether the observations are dealing with Bernoulli process or something else.

What you describe here is some twisted outlook into Law of large numbers which has nothing to do with randomness, gambler’s fallacy or anything statistical and is another pretense of some common sense household concept. All references are there is the wiki, just waiting for anybody to be read. Alas, nobody bothers. Which is probably OK.

Now, we have some new definition of random. It defies everything the sages have conceptualized but why would anyone care. :wink:

Now, the more I think about the power of this definition, the more I tend to admire the logic. If you cannot predict something, it means that this something is random. Indeed, a paradox. I always thought for some reason that random is actually quite predictable and is well studied and understood. While indeed it is a completely mysterious new entity. :wink:

UK, I know exactly what I am talking about.

Pintos used to blow up when they were rear ended.

They used steel in their construction.

To conclude that they blow up because the steel was bad (wrong alloy combination, bad heat treatment or whatever) would be incorrect. They blew up because of the placement of the fuel tank, design of the rear end of the car, and lack of other safety features.

Perfect steel would not have prevented this.

Pseudo-random number generators are like the steel. They still have to be used properly. Almost all of the types of bugs gamers attribute to “RNG” are actually in the game logic consuming the generated sequence, not in the sequence itself.

Akots,

I did say I was vastly over simplifying, and only looking at the indicator case where no heads come up to make the logic clear.

The baysian method that is described in the wiki article Checking whether a coin is fair is precisely and exactly a correct, generalized, and formal description of what I outlined. It specifically involves taking actual trials, and comparing the probability of the achieved outcome to the predicted probability, to get a confidence level or statistical likelihood that the process is fair.

Anyone who can read and appreciate the article certainly should, and I hope everyone will.

I think my explanation helps people who don’t want to or cannot interpret the math in the article a good flavor for the shape of the argument.