Rule of twelve

from Wikipedia, the free encyclopedia
Simulated normal distribution of the rule of twelve compared to the calculated normal distribution (mean 6, variance 1).

The rule of twelve describes a method to generate approximately normally distributed ( pseudo ) random numbers . It says that the random variable is approximately normally distributed if it is generated with twelve independent random numbers evenly distributed over the interval [0,1] . has the expected value 6 and the standard deviation 1.

The distribution of is an Irwin-Hall distribution , which rapidly approaches a normal distribution as it grows . The basis for this statement is the central limit value theorem .

In order to obtain normal distributions with other parameters, one subtracts the expected value from the obtained values s , multiplies with the new standard deviation and adds the new mean value :

.

The importance of the rule of twelve lies in the fact that reasonable results can be achieved with little programming effort and manageable computing effort. It does not require complex mathematical functions such as the logarithm . However, better methods are known today, e.g. B. the polar method . This will give much better results normally distributed with significantly less computational effort if the processor is a floating - ALU has integrated.

When applying the rule of twelve, the independence of the summed up is important . In the case of many pseudo-random number generators , however, the independence of twelve consecutive random numbers is not given. Linear congruence generators are often used in standard libraries . The spectral test , which calculates how many consecutively generated random numbers can be considered independent, only guarantees the independence of a maximum of seven of them , usually less. For numerical simulations it is therefore very questionable to use the rule of twelve with a random number generator from the standard library that is not known in detail. For this reason, too, other methods such as the Polar method are preferable. However, there are also random number generators that guarantee very good independence from 12 consecutive numbers, e.g. B. the Mersenne Twister .

Beispiel von 8 Simulationen (die Abbildung basiert auf 6000): 
1     2     3     4     5     6     7     8     9     10    11    12   Sum1-12     Std1-12
0,82  0,46  0,58  0,48  0,44  0,84  0,51  0,24  0,19  0,38  0,83  0,67  6,43       0,21
0,19  0,1   0,76  0,67  0,59  0,43  0,03  0,58  0,24  0,71  0,36  0,43  5,08       0,24
0,01  0,93  0,53  0,29  0,91  0,97  0,56  0,44  0,62  0,69  0,77  0,74  7,46       0,27
0,61  0,13  0,27  0,83  0,53  0,95  0,65  0,62  0,02  0,67  0,44  0,69  6,41       0,26
0,55  0,79  0,01  0,97  0,54  0,06  0,62  0,44  0,24  0,35  0,23  0,24  5,06       0,27
0,8   0,22  0,67  0,76  0,9   0,55  1     0,19  0,3   0,58   0,5  0,22  6,68       0,27
0,84  0,45  0,14  0,19  0,17  0,78  0,03  0,48  0,7   0,27  0,64  0,35  5,03       0,26
0,09  0,97  0,27  0,16  0,87  0,05  0,72  0,1   0,28  0,8   0,43  0,29  5,01       0,32
                                                        Mittelwert:     5,9
                                                        Standardabw:    0,96
Die Simulationswerte liegen in der Nähe der berechneten Parameter: 
Standardabweichung von Xi: 0,24 (berechnet: 1/sqrt(12)= 0,29) 
Mittelwert von Xi: 0,49 (berechnet: 0,5) 
Mittelwert der Verteilung von sn: 5,9 (berechnet: 6)  
Standardabweichung von sn: 0,96 (berechnet: 1)

Web links