Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?
header("Content-type: text/plain");

$countTotal = 52;
$countKind = 13;

$chance = 1;

for(;;) {

        if( ++$i > 10 ) break;

        printf("Cards in pool: %u\n", $countTotal);
        printf("Cards of correct color: %u\n", $countKind);


        $fraction = $countKind / $countTotal;

        printf("Odds %u / %u = %.5f\n", $countKind, $countTotal, $fraction);

        $countKind--;
        $countTotal--;

        $chance*= $fraction;

        printf("Total chance of single color: %.20f\n\n", $chance);
}