note 110694 added to function.stats-cdf-poisson

From: Date: Fri, 23 Nov 2012 09:33:55 +0000
Subject: note 110694 added to function.stats-cdf-poisson
Groups: php.notes 
Request: Send a blank email to php-notes+get-192117@lists.php.net to get a copy of this message
A simple poisson-distribution function, which only works for relatively small numbers (maximum of ~100/100 for most systems): <?php function factorial($number) { if ($number < 2) { return 1; } else { return ($number * factorial($number-1)); } } function poisson($chance, $occurrence) { $e = exp(1); $a = pow($e, (-1 * $chance)); $b = pow($chance,$occurrence); $c = factorial($occurrence); return $a * $b / $c; } $test = poisson(100,100); echo $test . "\n"; ?> ---- Server IP: 69.147.83.199 Probable Submitter: 139.63.57.59 ---- Manual Page -- http://www.php.net/manual/en/function.stats-cdf-poisson.php Edit -- https://master.php.net/note/edit/110694 Del: integrated -- https://master.php.net/note/delete/110694/integrated Del: useless -- https://master.php.net/note/delete/110694/useless Del: bad code -- https://master.php.net/note/delete/110694/bad+code Del: spam -- https://master.php.net/note/delete/110694/spam Del: non-english -- https://master.php.net/note/delete/110694/non-english Del: in docs -- https://master.php.net/note/delete/110694/in+docs Del: other reasons-- https://master.php.net/note/delete/110694 Reject -- https://master.php.net/note/reject/110694 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#192117) next »