Paste number 18743: birthday problem

Paste number 18743: birthday problem
Pasted by: evanpro
2 years, 5 months ago
None
Paste contents:
Raw Source | XML | Display As
;;; probability that any two members of a group of N
;;; will match in a space of M
 
(define (birthday N M)
   (let birthday-count ((product 1)
                        (n 1)
)

        (if (>= n N)
            (- 1 product)
            (birthday-count (* product (/ (- M n) M)) (+ n 1))
)
)
)

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.