| Paste number 18743: | birthday problem |
| Pasted by: | evanpro |
| When: | 3 years, 2 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+EGN |
| Channel: | None |
| Paste contents: |
;;; 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.