Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Algorithm for cancelling common factors between two lists of multiplicands

by QM (Parson)
on Aug 09, 2005 at 15:19 UTC ( [id://482242] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub n_choose_k {
      my ($n, $k) = @_;
      # f($n) = $n!
      return f($n)/f($k)/f($n-$k);
    }
    
  2. or download this
    sub n_choose_k {
      my ($n, $k) = @_;
    ...
      }
      return $t;
    }