Angband Forums

Angband Forums (
-   Vanilla (
-   -   Damage vs Accuracy (

Ighalli March 29, 2018 05:23


Originally Posted by Derakon (Post 128773)
Yes, many times. It is on average quite random. Humans are bad at recognizing randomness. :)

What seems stranger than the allegedly streaky RNG is how frequently the fairness of it is questioned. :D

Pondlife March 29, 2018 19:33


Originally Posted by Ighalli (Post 128777)
What seems stranger than the allegedly streaky RNG is how frequently the fairness of it is questioned. :D

I think the mathematical definition of random differs from the "common sense" definition of random. See for example "The Black Swan: The Impact of the Highly Improbable" by Nassim Nicholas Taleb; or Apple's decision to change the shuffle algorithm from true random because that didn't "feel" random to users.

I beleive the Angband RNG is random in the mathematical and statistical sense; but often it seems "unfair" or "streaky" to humans.

Pete Mack March 29, 2018 21:20

Um. No pseudorandom RNG is "random in the mathematical sense." And there are a whole lot of statistical ways to analyze a sequence for randomness. I suspect the angband RNG is good under some of the basic ones, which is usually good enough.

Gordon March 29, 2018 22:19

Well, 1 in 18593 is slightly less probable than flipping a coin and having it come up heads 14 times in a row. I think any intelligent being would look upon that coin with suspicion. That said, I was glad to hear that this RNG had been tested for correlation. Serial correlation analysis is just as important as uniformity analysis when evaluating a RNG and is often neglected.

Pete Mack March 29, 2018 23:33

When evaluating likelihood of an event like repeated fails on a 5% throw, it's better to ignore the first failure, as you are looking at a case where there is at least one failure. So the first failure should be considered a prior. 1 in 18000 isn't all that unlikely when integrated over all games and players.

t4nk March 30, 2018 01:16


Originally Posted by Gordon (Post 128772)
One other thing. When I was looking for a monster to try the Wand of Annihilation on, I ran into Ariel, Queen of Air. Seeing as I knew that the wand wouldn't work on her, I cast Mana Storm instead. It failed five times in a row. With @'s current 14% chance of failure for this spell, the probability of that happening by chance is 1 in 18593. Has anyone checked the RNG used for spell failure for correlation?

This is a fun question. I searched the internet for answers and this article seems pretty good:
I skipped the formulas, of course (maybe Nick can verify them :)). But there are also some human language examplanations and even some code. So I played a bit with it on my machine. If you cast mana storm 100 times, you'll get a streak of 5 or more failures in a row with about 1% probability. 18000 casts give you more than 50% chance of getting a bad run.
I guess there is a useful lesson here - always be prepared for the worst :)

Gordon March 30, 2018 17:07

Here is a prettied up version of a python script for calculating this that I found on a link on that site.


import argparse

argparser = argparse.ArgumentParser(description='Calculate the probability of run of n events in m trials where p is the probabilty of an event')
argparser.add_argument('-n', type=int, required=True, help='run length')
argparser.add_argument('-m', type=int, required=True, help='number of trials')
argparser.add_argument('-p', type=float, required=True, help='probability of an event')
args = argparser.parse_args()

N = args.n
M = args.m
p = args.p
q = 1-p #probability of failure

#setting up P_i (P[i] will be the probability that we see a run of length n in i flips)

P = [None for i in range(0,M+1)] #initialize list to all Nones

for i in range(0,N): #set boundary conditions, (not including P_N (r)
    P[i] = 0

P[N] =p**N #P_N (r) is now equal to p^N

#now for main recursion (using a loop here instead)
for i in range(N,M):
    P[i +1] = P[i] + (1-P[i-N]) * q * P[N]

print 'A run of',N, 'events of probability',p, 'has a chance of 1 in',1.0 / P[M], 'of occuring in',M, 'trials'

Chud April 12, 2018 22:51

The other thing people often lose track of (or don't think about in the first place) is just how many trials are really being run in a typical game. I'll bet it's a *lot* more than most people realize, so when you do the math and come up with a 1 in 18,000 chance of something, you think "come on, that'll never happen" when in fact there are so many trials that it's to be expected a lot more than you think.

All times are GMT +1. The time now is 10:09.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.