[ILUG] impressive... [OT - lotto odds]
Aidan Keady
aidan at ssldesign.com
Thu Oct 28 15:27:00 IST 1999
> On Thu, Oct 28, 1999 at 08:59:44AM -0500, John_White at dell.com mentioned:
> > as easy as it would be to write one that gets the factorial of 5 :)
> > but you'd need a mad data type to store the result in . . .
>
> That's part of the point! Lisp doesn't mind!
>
> Question though. I was doing the lotto calculation, and:
>
> ==> (/ (factorial 42) (factorial 36))
> 3776965920
>
> Is it really a 3.777 billion to one chance of winning now ?
>
> 42*41*40*39*38*37=3776965920
>
> Kate
No, you've forgotten the 6! in the bottom line.
i.e. n
C = n!/[r!(n-r)!]
r
The odds against having the six numbers are only about 5.25 million to 1.
ATB,
Aidan.
More information about the ILUG
mailing list