I am referring to the Wikipedia example here (https://en.wikipedia.org/wiki/Fisher%27s_exact_test) which shows:
My Question is how is this 0.001346 figure reached? After reading, I appreciate that the 10! is the product but when times or summing, I cannot produce this figure in my code (I am using PHP).
private function processProducts($products){
$prods = $this->prods;
$times = 0;
foreach ($products as $p){
if (!empty($prods[$p])){
$use = $prods[$p];
} else {
// Product = 10 = 10*9*8*7*6*5*4*3*2*1
$use = array_product(range(1,$p));
$prods[$p] = $use;
}
echo $p.'--'.$use.'<br>';
if ($times == 0){
$times = $use;
} elseif ($p > 0) {
$times = $times * $use;
}
}
$this->prods = $prods;
return $times;
}
echo $this->processProducts(array(10,14,12,12)) / $this->processProducts(array(1,9,11,3,24));