in reply to Probabilities of drawing certain cards

just for fun and cool uses for Perl, here the math for the first column

DB<29> $h = 5 DB<30> sub A_and_B { bk($n-2,$h-2) / bk($n,$h) } DB<31> sub bk { my ($n,$k) = @_; fac($n)/(fac($k)*fac($n-$k)) } DB<32> sub fac { my ($n) =@_; my $f=1; $f*=$_ for 2..$n; $f} DB<33> printf ( "%i %0.3f\n", $n=$_, A_and_B ) for 6..15 6 0.667 7 0.476 8 0.357 9 0.278 10 0.222 11 0.182 12 0.152 13 0.128 14 0.110 15 0.095

remaining cols left for the interested reader. :) °

Further reading:

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

update

°) spoiler

DB<74> sub A_and_B { bk($n-2,$h-2) / bk($n,$h) } DB<75> sub A_and_not_B { bk($n-2,$h-1) / bk($n,$h) } DB<76> sub A_xor_B { 2*bk($n-2,$h-1) / bk($n,$h) } + # NB: 2 * A_and_not_B DB<77> sub A_or_B { ( 2*bk($n-2,$h-1) + bk($n-2,$h-2) ) / bk($n,$h) +} # NB: A_and_B + A_xor_B DB<78> printf ( "%2i ".("\t%2.1f"x4)."\n", $n=$_, map {100*$_} A_and +_B, A_and_not_B, A_xor_B, A_or_B ) for 6..15 6 66.7 16.7 33.3 100.0 7 47.6 23.8 47.6 95.2 8 35.7 26.8 53.6 89.3 9 27.8 27.8 55.6 83.3 10 22.2 27.8 55.6 77.8 11 18.2 27.3 54.5 72.7 12 15.2 26.5 53.0 68.2 13 12.8 25.6 51.3 64.1 14 11.0 24.7 49.5 60.4 15 9.5 23.8 47.6 57.1 DB<79>