Reputation: 2187
I want to calculate the number of combinations when given some number, e.g number of combinations when 5 choose from 10. But the Math::Combinatorics
module gives you the combination lists when given character set. Is there such a module or I need to use factorial functions to represent it when programming?
Upvotes: 1
Views: 641
Reputation: 234797
You can use Math::Combinatorics
and count the size of the returned list. However, a better module would be Math::Counting
.
use Math::Counting ':big';
printf "C(10, 5) = %d\n", bcomb(10, 5);
Upvotes: 3