note 92422 deleted from ref.math by danbrown
| From: | danbrown@php.net | Date: | Thu, 23 Jul 2009 17:43:03 +0000 |
| Subject: | note 92422 deleted from ref.math by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158652@lists.php.net to get a copy of this message | ||
Note Submitter: michiel thalent netherlands
----
With borrowing the factorial function of moikboy here is a poissonPdf function.
<?php
function fact($int){
if($int<2)return 1;
for($f=2;$int-1>1;$f*=$int--);
return $f;
}
function poissonPdf($l, $k) {
return ( exp(-$l)*pow($l,$k) ) / fact($k);
}
?>