Game Development Reference
In-Depth Information
LowBound
0
HighBound
70
Pinch
0
SkewDirection
Right
SkewFactor
2
As we can see, this distribution has a range of 70 and is skewed to the right—
meaning that the “tail� extends more to the right than it does to the left. This
description fits the curve that we identified in Figure 11.2.
By calling the function GetGuess() , we are creating random guessers of all four
types in the percentages that we laid out. That means that each call to GetGuess()
could generate a 33, a 22, a random guess between 0 and 100, or a random guess
between 0 and 70 with a bias toward about 25. If we call this function many times
and examine a histogram of the results (Figure 11.22), we see a distribution similar
to the one we found in the original data from the Denmark experiment.
FIGURE 11.22 The histogram of 3,000 random guesses using the GetGuess() function.
Aside from the two specific guesses of 22 and 33, we created the rest using
two different types of probability distribution: a uniform distribution from
0 to 100, and a right-skewed normal distribution from 0 to 70.
With some analysis of the population (which we performed earlier in the chapter),
some planning, a little tweaking of our percentages, and a few calls to our probabil-
ity distribution functions, we are able to replicate the population that entered the
Search WWH ::




Custom Search