Statistical analysis of the RNG

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Yogin
Posts: 98
Joined: November 18th, 2005, 7:49 pm

Post by Yogin »

rrenaud wrote:

Furthermore, if we assume the sum of the distributions are normal, then we can figure out how unlucky a person is by comparison to the normal. I'm not too comfortable with this assumption, though given that the Central Limit Theorem applies only to iid r.v.'s.
By the initial text at http://mathworld.wolfram.com/CentralLimitTheorem.html I believe that the samples do not need to be drawn from a single distribution to for the result to approach the normal distribution.

Certainly you must agree that by the "fuzzy" CLT (the sum of a bunch of independent events with small magnitudes) that the results will be normally distributed for wesnoth attacks. After you have attacked say, 100 times, the effect of no single attack will be that substantial.
Well, the initial statement concerns the cdf of Xnorm, as specified on the page, but we're not interested in Xnorm, although it seems like it might just be a normalized version of Sum(Xi), which we are interested in. But again, we're interested not in the cdf, but the pdf.

The second statement, starting with "Under additional conditions on the distribution of the addend", is written awkwardly, and it's meaning isn't clear to me. It seems to be saying that if the addends (X1, X2, ...) are normal, then their sum is normal, but that's obvious, and not worth mentioning in a page concerning the CLT. So, I'm guessing they meant to address the Lindeberg Condition and the Lyapunov Condition which allow the sum of non-identical distributions to converge to normal(from wiki). Whether Wesnoth's discrete distributions resulting from a combat satisfy either of those conditions, I can't tell.

I've looked at sums of binomials with different n,p values several times in the past. I've never been convinced that the CLT holds for them, especially in cases where p values approach .1 or .9. For instance, attached is a histogram of Z = X + Y, where X~Bin(100,.1) and Y~Bin(100,.9). I took 10,000 samples of Z. Obviously, Z is a degenerate case, but where is the line between a degenerate sum of binomials and a non-degenerate one?

Furthermore, the condition of independence, I'm starting to doubt, also. Players tend to use high damage, low strike attacks on weak defense(eg. thunderer vs. units in water/grass, and low damage, high strike attacks on strong defense(eg. poison on elves in the forest or dwarves on the mountain). I have no idea whether patterns like this affect the underlying assumptions behind something like the classical, extended, or fuzzy CLT.

Otoh, our discussion is no longer relevant to Wesnoth inasmuch as the following is (a) the correct way to do it, and (b) easy to implement, and (c) requires no fancy headache inducing statistics nor a minimum sample of trials for an approximation to be legitimate.
If we have the actual distribution of expected damage dealt and received for each combat, we can just convolve them and construct the exact, true distribution for damage dealt and received for all battles seen so far.
Attachments
Picture 5.png
Picture 5.png (2.92 KiB) Viewed 689 times
Post Reply