[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] manuscripts/Sigs birthday.py
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] manuscripts/Sigs birthday.py |
Date: |
Mon, 19 May 2003 15:51:05 -0400 |
CVSROOT: /cvsroot/gzz
Module name: manuscripts
Changes by: Tuomas J. Lukka <address@hidden> 03/05/19 15:51:05
Modified files:
Sigs : birthday.py
Log message:
usage
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/manuscripts/Sigs/birthday.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: manuscripts/Sigs/birthday.py
diff -u manuscripts/Sigs/birthday.py:1.1 manuscripts/Sigs/birthday.py:1.2
--- manuscripts/Sigs/birthday.py:1.1 Mon May 19 15:50:01 2003
+++ manuscripts/Sigs/birthday.py Mon May 19 15:51:05 2003
@@ -1,6 +1,8 @@
from math import *
def log2birthdayprob(n, k):
+ """return log2(p(k balls thrown to n bins, all end up alone))
+ """
return (
(n+.5) * log(n)
- (n-k+.5) * log(n-k)