note 62294 added to function.mt-rand

From: Date: Fri, 24 Feb 2006 09:06:37 +0000
Subject: note 62294 added to function.mt-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-104362@lists.php.net to get a copy of this message
I modified Garry's generator to allow for easier testing for larger amount of numbers (I'm using 1-25) and I found that even with over 50,000 iterations the first few numbers had a disprotionate amount of selections. The solution is simple, use different number (ie 25-50). 1-25 over 50,000 iterations 1 =26031 6 =3916 11 =2030 16 =1943 21 =1963 2 =17852 7 =4103 12 =1995 17 =2050 22 =1970 3 =5942 8 =4065 13 =2002 18 =2050 23 =1916 4 =6014 9 =3990 14 =2012 19 =2000 24 =2031 5 =5993 10 =1969 15 =1939 20 =2062 25 =2005 25-50 over 50,000 iterations 25 =1934 31 =2020 37 =1970 43 =1927 49 =1866 26 =1878 32 =1984 38 =1902 44 =1916 50 =1914 27 =1938 33 =1849 39 =1932 45 =1961 28 =1965 34 =1924 40 =1887 46 =1928 29 =1964 35 =1910 41 =1915 47 =1838 30 =1986 36 =1915 42 =1872 48 =1905 feel free to email any questions, comments, suggestions as I'm not likely to check these notes ---- Server IP: 64.71.164.2 Probable Submitter: 68.49.116.82 ---- Manual Page -- http://www.php.net/manual/en/function.mt-rand.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62294 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62294&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62294&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104362) next »