IskandriaTimeline Background Mechanics Bookstore
Mass event resolution
Often, for game purposes, a number of events (attacks, etc.) with
equal probability of success can be resolved consecutively.
Furthermore, details about the success can be deferred. If suitable
electronic support is available (spreadsheets or scientific
calculator with the combinatorial
function C(n,k), where k,n are non-negative integers such that
0<k<n), the following procedure for resolving
how many successes are in a mass event is to be used:
Now, we are going to use the Binomial Theorem:
(p+q)n = Σk=0..n C(n,k)pkqn-k
Each term has a significance:
P(exactly k events of probability p)=C(n,k)pkqn-k
Observe that there is a minimal m such that a pseudorandomly
generated (decimal) number R from the uniform distribution over the
interval [0,1] (a number between 0 and 1) satisfies
R < Σk=0..m C(n,k)pkqn-k
This m is the number of events with probability p in the mass
event. n-m is the number of events with probability q in the mass
event. Detail resolution depends on what the mass event is.
- There is a probability for success P(success), and a
corresponding probability of failure P(failure), related by
P(success)+P(failure)=1. The larger of these is denoted by
the variable q, and the smaller of these is denoted by the variable
p. [If both are 1/2, obviously the precise allocation doesn't
- The calculational procedure assumes that both P(success) and
P(failure) are in a form suitable for entering for electronic
calculation...that is, decimal approximations. If both P(success)
and P(failure) have explicit analytic formulae, explicitly
calculate the smaller of the two [p] and use the transformed
constraint q=1-p to get q for the calculator.
- Because we are preparing numerical approximations for further
calculation, we have to consider the truncation error that
results from subtracting two numbers...which manifests as a loss of
significant digits (which impairs calculations derived from the
resulting intermediate data). EXERCISE: Explain why the stated
procedure generally minimizes truncation error for both p and q
compared to the other way around.
The attentive reader will notice that this does not necessarily
precisely compute boundaries near 1...which does not seem to be a
significant problem, in practice. More problematic is that the
direct computation of m (by adding terms until it is found) is
tedious for large n as p approaches 1/2 from above.
Opinions, comments, criticism, etc.? Let me know about it.
Return to the Iskandria page, or the main page.