/*
############################################################################
This function returns the EXACT count of unique permutations of (N) items
that are possible when selected in random groups of (R) at a time.
NOTE: In permutations, the sequential line order of items in each group
IS important. No two selected sequences are in the same order.
Permutations refers to the physical count of the number of unique sequences
into which we can arrange the items within a row, line or column.
RULE: (N, R) are non-negative integers where 0 <= R <= N
This function uses arbitrary-precision BC (Binary Calculator) arithmetic
which can return exact values up to several thousands of digits long.
NO DEPENDENCIES
############################################################################
*/
function BC_Perm_N_R ($N, $R)
{
$P=1; for ($i=0; $i < $R; $i++) {$P = bcMul($P, $N-$i);} return $P;
} // End of BC_Perm_N_R (...)