Binomial Coefficient
AUTHOR
L. Grondin
Number of ways to choose P objects among N. It's also the coefficient of the monome of degree P in the expansion of (1 + X)^N, thus the name.
N (N-P+1)*(N-P+2)*...*N
( ) = ā -------------------
P 1*2*...*P
More
http://rosettacode.org/wiki/Evaluate_binomial_coefficients#Raku
Notable features used
infix sub definition
reduction meta-operator
self-declared parameters
sequence operator to get a decreasing order
Zip metaoperator with list of different sizes
use of rational numbers as a default
use v6;
sub infix:<choose> { [*] ($^n ... 0) Z/ 1 .. $^p }
say 5 choose 3;
# vim: expandtab shiftwidth=4 ft=perl6