Hide Ads
 Refresh   About   Tools 

PHP mt_rand() Randomosity Tester

+1,000 data
+1 +10 +100 +1K +10K +MAX
range: 1-50, data points: 2,000, groups: 23
High / Low / Range / Average
Frequency: 54 / 22 / 32 / 40.00
Rows: 6 / 1 / 5 / 2.17
Frequency
Rows
54
1
52
1
50
1
49
1
48
3
47
2
46
1
45
1
44
1
43
3
42
6
41
5
40
3
39
1
38
3
37
2
36
2
35
3
34
3
33
2
31
2
30
2
22
1

Test runs: 1,000Avg run : 0.000000 seconds Test time: 0.000391 seconds Data Save: 0.015940 seconds Test Tools: Restart test: Random range 1 to: 1 2 3 4 5 10 50 100 500 1K 5K 10K 50K 100K Random Generator Method: SQLite ORDER BY RANDOM() PHP rand() PHP mt_rand() PHP random_int() Back to top


About the Randomosity Tester

This page tests the frequency distribution and timing of random number generation via these methods:

Random number results are stored in a test table. The test table is defined as:

CREATE TABLE 'test' ( 'id' INTEGER PRIMARY KEY, 'frequency' INTEGER DEFAULT '0' );

The table is initialized by creating all rows with frequency = 0. The number of rows in the table is defined by the range setting. The current test is set to use range: 1 to 50.

For each random number chosen, the table is updated via:

UPDATE test SET frequency = frequency + 1 WHERE id = :random_number

For SQLite tests, results are individually generated via the SQL call:

SELECT id FROM test ORDER BY RANDOM() LIMIT 1;

Generate more random numbers by clicking a  +  number button to start a test run.

Each test run is limted to ~1.42 seconds.

A Frequency of Frequencies chart displays:

This site was created with Open Source software. Find out more on Github: randomosity-tester v0.2.2

Back to top


Hide Ads