next up previous contents
Next: User Interface Issues Up: Miscellaneous issues Previous: Miscellaneous issues

Generating random numbers

In the project, I needed a function for generating real-valued random numbers within a range. The initial function I used was a simple function based on the UNIX random() function.

I found this function inadequate because the numbers generated are equally distributed between the two extremes. When generating random expressions for combination, it is desirable to have the parameters toward the extrema of the expression to maximise the initial distance between different expressions. To achieve this, I changed the function to randomly select from one of the two extrema, returning it. This, however, resulted in initial expressions which were insufficiently diverse (for example, each was either smiling or frowning intensely).

The random function I needed was one which generated random numbers within a range, with the probability distribution skewed to the extrema of the range. I found that the following function gives a probability distribution in the range between and , with an increased probability of values near the edges:

where r is a function returning a random number whose probability is equally distributed between two extremes.

 
Figure 4: A graph of the probability distribution of the random function used for generating facial parameters.

The probability distribution of this random function is approximated by the function:

A graph of this function is shown in figure 4.



Andrew C Bulhak
Tue Nov 7 11:44:11 EST 1995