speedup help
mike castleman
mlc67@columbia.edu
Mon, 3 Mar 2003 20:29:06 -0500
I have no idea if the following is faster or not (I suspect not), but
it is certainly easier to read:
n `choose` k = (n `permute` k) `div` (fact k)
n `permute` k = product [(n-k+1) .. n]
fact n = product [1 .. n]
mike
--
mike castleman / mlc67@columbia.edu / http://mlcastle.net
aolim: mlcastle / icq: 3520821 / yahoo: mlc000
"we have invented the technology to eliminate scarcity, but we are
deliberately throwing it away to be benefit those who profit from
scarcity....I think we should embrace the era of plenty, and work out
how to mutually live in it." -- john gilmore