Re: The *Birthday* problem
- From: "\"Luis A. Afonso\"" <licas_@xxxxxxxxxxx>
- Date: Wed, 31 May 2006 18:38:12 EDT
Some data concerning the *Birthday Matches*
_birthdays___0______1_______2______3_______4______5___
_n=20____0.9466__0.0521__0.0013
_n=40____0.8961__0.0985__0.0053__0.0002
_n=60____0.8482__0.1398__0.0113__0.0006
_n=100___0.7601__0.2088__0.0283__0.0026__0.0002
_n=200___0.5778__0.3174__0.0868__0.0156__0.0022__0.0002
____________________________________________________
For example the probability that to find a day all over the year that, among 100 persons, 3 of them have the same birthday is 0.0026 (1 day/year) whereas 0.7601*365 = 277 days (approximately 23 days/mo) are expected not-birthday days.
______licas (Luis A Afonso)
REM "birthMC"
CLS
DIM has(365), w(20)
INPUT " pp= "; pp
all = 4000
FOR rpt = 1 TO all: RANDOMIZE TIMER
FOR ii = 1 TO 365: has(ii) = 0: NEXT ii
FOR p = 1 TO pp
g = INT(365 * RND) + 1
has(g) = has(g) + 1
NEXT p
FOR k = 0 TO 20
FOR di = 1 TO 365
IF has(di) = k THEN w(k) = w(k) + 1
NEXT di
NEXT k
uu = INT(rpt / 1000): vv = rpt / 1000
IF uu <> vv THEN GOTO 123
LOCATE 10, 10
PRINT USING "############"; all - rpt
FOR ki = 0 TO 6
PRINT USING "## #.#### "; ki; w(ki) / (365 * rpt);
NEXT ki
123 NEXT rpt
END
.
- Prev by Date: Chi-square for binomial samples
- Next by Date: Re: Chi-square for binomial samples
- Previous by thread: Chi-square for binomial samples
- Next by thread: Re: The *Birthday* problem
- Index(es):
Relevant Pages
|