Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Darth Vader sleeps with a Teddywookie.


interests / rec.puzzles / the Most crowded room --- (expected # of max. Birthday collisions)

SubjectAuthor
* the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
+* Re: the Most crowded room --- (expected # of max. BirthdayAnton Shepelev
|`- Re: the Most crowded room --- (expected # of max. BirthdayRichard Heathfield
+* Re: the Most crowded room --- (expected # of max. Birthday collisions)Ilan Mayer
|+* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
||+* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
|||`- Re: the Most crowded room --- (expected # of max. Birthday collisions)Ilan Mayer
||`- Re: the Most crowded room --- (expected # of max. Birthday collisions)Ilan Mayer
|`* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
| `* Re: the Most crowded room --- (expected # of max. Birthdayduncan smith
|  +- Re: the Most crowded room --- (expected # of max. Birthdayduncan smith
|  `- Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
+- Re: the Most crowded room --- (expected # of max. Birthday collisions)Jonathan Dushoff
+* Re: the Most crowded room --- (expected # of max. Birthday collisions)Ilan Mayer
|`* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
| `* Re: the Most crowded room --- (expected # of max. Birthday collisions)Ilan Mayer
|  `* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
|   +- Re: the Most crowded room --- (expected # of max. Birthday collisions)Ilan Mayer
|   `- Re: the Most crowded room --- (expected # of max. BirthdayAnton Shepelev
`* Re: the Most crowded room --- (expected # of max. BirthdayAnton Shepelev
 `* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
  `* Re: the Most crowded room --- (expected # of max. BirthdayAnton Shepelev
   `* Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com
    `* Re: the Most crowded room --- (expected # of max. BirthdayAnton Shepelev
     `- Re: the Most crowded room --- (expected # of max. Birthday collisions)henh...@gmail.com

1
the Most crowded room --- (expected # of max. Birthday collisions)

<adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=479&group=rec.puzzles#479

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:620a:1a0c:b0:6cb:e0a3:f889 with SMTP id bk12-20020a05620a1a0c00b006cbe0a3f889mr22041813qkb.538.1663191752698;
Wed, 14 Sep 2022 14:42:32 -0700 (PDT)
X-Received: by 2002:a05:6214:762:b0:4ac:ad95:2849 with SMTP id
f2-20020a056214076200b004acad952849mr16429097qvz.14.1663191752580; Wed, 14
Sep 2022 14:42:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Wed, 14 Sep 2022 14:42:32 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:1a30:0:0:0:5a63;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:1a30:0:0:0:5a63
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
Subject: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Wed, 14 Sep 2022 21:42:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1990
 by: henh...@gmail.com - Wed, 14 Sep 2022 21:42 UTC

Have you encountered this number (63.2 %) some time earlier ?
( i may have, but if so, i had forgotten)

and also ..........

What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?

(is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)

according to the simulations i've done...

100 ppl are randomly assigned to 100 rooms...
---> the Most crowded room is occupied by 5 people. (A)

1000 ppl are randomly assigned to 1000 rooms...
---> the Most crowded room is occupied by 5 people. (B)

10000 ppl are randomly assigned to 1000 rooms...
---> the Most crowded room is occupied by 22 people.

---------------- what are the theoretical values for (A) and (B) ?

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<20220915152249.144acdf5b2ca90509fee0d33@g{oogle}mail.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=480&group=rec.puzzles#480

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: anton....@g{oogle}mail.com (Anton Shepelev)
Newsgroups: rec.puzzles
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Date: Thu, 15 Sep 2022 15:22:49 +0300
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <20220915152249.144acdf5b2ca90509fee0d33@g{oogle}mail.com>
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="49c4b6c549f93704eb463a1362198ee5";
logging-data="3497642"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VhRJFEy8/TaWIvRqpt8inMV2L9+jefZk="
Cancel-Lock: sha1:6jpU+jq2m/rQdnHAg2TfewL1qXQ=
X-Newsreader: Sylpheed 3.5.0 (GTK+ 2.24.23; i686-pc-mingw32)
 by: Anton Shepelev - Thu, 15 Sep 2022 12:22 UTC

Hen Hanna:

> according to the simulations i've done...
>
> 100 ppl are randomly assigned to 100 rooms...
> ---> the Most crowded room is occupied by 5 people. (A)

Your approach as faulty. The number of people in the most
crowded room is a random variable, and only, when the amount
of experiment is infinite can you rely on your simulations.

--
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<tfv6br$3atv4$1@dont-email.me>

  copy mid

https://novabbs.com/interests/article-flat.php?id=481&group=rec.puzzles#481

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rjh...@cpax.org.uk (Richard Heathfield)
Newsgroups: rec.puzzles
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Date: Thu, 15 Sep 2022 13:38:19 +0100
Organization: Fix this later
Lines: 21
Message-ID: <tfv6br$3atv4$1@dont-email.me>
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<20220915152249.144acdf5b2ca90509fee0d33@g{oogle}mail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 15 Sep 2022 12:38:19 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="db6f24a9ccdd11e46f65ee8901fbeeb0";
logging-data="3504100"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OEVLIvj7wous/3OCZY4KMwGbiINTzMTvo0EDdA0NRvA=="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:d0hrKDU/fC9jSXT3Tt0Dc5UDoEU=
Content-Language: en-GB
In-Reply-To: <20220915152249.144acdf5b2ca90509fee0d33@g{oogle}mail.com>
 by: Richard Heathfield - Thu, 15 Sep 2022 12:38 UTC

On 15/09/2022 1:22 pm, Anton Shepelev wrote:
> Hen Hanna:
>
>> according to the simulations i've done...
>>
>> 100 ppl are randomly assigned to 100 rooms...
>> ---> the Most crowded room is occupied by 5 people. (A)
>
> Your approach as faulty. The number of people in the most
> crowded room is a random variable, and only, when the amount
> of experiment is infinite can you rely on your simulations.

I did an infinite simulation, which took a while, and it turns
out that the actual answer is 6, possibly because in that room
there was a Charlie's Angels box set binge watch in progress.

--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=482&group=rec.puzzles#482

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:6214:2387:b0:496:c9db:82b0 with SMTP id fw7-20020a056214238700b00496c9db82b0mr629089qvb.111.1663257706549;
Thu, 15 Sep 2022 09:01:46 -0700 (PDT)
X-Received: by 2002:a05:6214:c6f:b0:4ac:8514:2f9 with SMTP id
t15-20020a0562140c6f00b004ac851402f9mr280864qvj.62.1663257706257; Thu, 15 Sep
2022 09:01:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Thu, 15 Sep 2022 09:01:46 -0700 (PDT)
In-Reply-To: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:5620:2f8:0:0:0:d;
posting-account=q4H9owkAAAA7qKFiZGLslkOsPXsbTfvM
NNTP-Posting-Host: 2607:fea8:5620:2f8:0:0:0:d
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: ilan_no_...@hotmail.com (Ilan Mayer)
Injection-Date: Thu, 15 Sep 2022 16:01:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3808
 by: Ilan Mayer - Thu, 15 Sep 2022 16:01 UTC

On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> Have you encountered this number (63.2 %) some time earlier ?
> ( i may have, but if so, i had forgotten)
>
>
>
> and also ..........
>
>
> What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
>
>
> (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
>
>
>
> according to the simulations i've done...
>
> 100 ppl are randomly assigned to 100 rooms...
> ---> the Most crowded room is occupied by 5 people. (A)
>
> 1000 ppl are randomly assigned to 1000 rooms...
> ---> the Most crowded room is occupied by 5 people. (B)
>
> 10000 ppl are randomly assigned to 1000 rooms...
> ---> the Most crowded room is occupied by 22 people.
>
>
> ---------------- what are the theoretical values for (A) and (B) ?
22 above seems to be wrong.

Analytic values for 1-4 rooms:
1 1
2 1.5 (3/2)
3 1.889 (17/9)
4 2.125 (17/8)

Simulation approximate results for 10,100,1000,10000 rooms:
10 2.75
100 4.23
1000 5.52
10000 6.66

Python program for simulation:

#! python
import sys
import random

def process(bins, trials):
average = 0
counts = []
for n in range(bins):
counts.append(0)
random.seed(None)
for n in range(trials):
for m in range(bins):
counts[m] = 0
for m in range(bins):
counts[random.randint(0, bins - 1)] += 1
maximum = 0
for m in range(bins):
if counts[m] > maximum:
maximum = counts[m]
average += maximum
average /= trials
print("Average maximum bin occupation is " + str(average))

if len(sys.argv) == 3:
error = False
try:
bins = int(sys.argv[1])
trials = int(sys.argv[2])
except ValueError:
print("Number of bins and number of trials must be integers")
error = True
if not error and (bins <= 1 or trials <= 0):
if bins <= 1:
print("Number of bins must be greater than 1")
else:
print("Number of trials must be greater than 0")
error = True
if not error:
try:
process(bins, trials)
except KeyboardInterrupt:
print("Cancelled")
else:
print("Usage: RandomDrop <number-of-bins> <number-of-trials>")

Please reply to ilanlmayer at gmail dot com

__/\__
\ /
__/\\ //\__ Ilan Mayer
\ /
/__ __\ Toronto, Canada
/__ __\
||

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=483&group=rec.puzzles#483

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:620a:4003:b0:6ce:1b3c:d846 with SMTP id h3-20020a05620a400300b006ce1b3cd846mr2364664qko.691.1663290934305;
Thu, 15 Sep 2022 18:15:34 -0700 (PDT)
X-Received: by 2002:a05:6214:c6f:b0:4ac:8514:2f9 with SMTP id
t15-20020a0562140c6f00b004ac851402f9mr2170420qvj.62.1663290934161; Thu, 15
Sep 2022 18:15:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Thu, 15 Sep 2022 18:15:33 -0700 (PDT)
In-Reply-To: <0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:3c50:0:0:0:1a44;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:3c50:0:0:0:1a44
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com> <0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Fri, 16 Sep 2022 01:15:34 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4330
 by: henh...@gmail.com - Fri, 16 Sep 2022 01:15 UTC

On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
> On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > Have you encountered this number (63.2 %) some time earlier ? ( i may have, but if so, i had forgotten)

100 ppl in 100 (random) rooms --> ~ 63.2 rooms get occupied


> >
> > and also ..........
> >
> >
> > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> >
> >
> > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> >
> >
> >
> > according to the simulations i've done...
> >
> > 100 ppl are randomly assigned to 100 rooms...
> > ---> the Most crowded room is occupied by 5 people. (A)
> >
> > 1000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 5 people. (B)
> >
> > 10000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 22 people.
> >
> >
> > ---------------- what are the theoretical values for (A) and (B) ?

> 22 above seems to be wrong.

really ? waht do you propose ?

>
> Analytic values for 1-4 rooms:
> 1 --- 1
> 2 --- 1.5 (3/2)
> 3 --- 1.889 (17/9)
> 4 --- 2.125 (17/8)

6 --------------- 2.408179012345679

8 -------------- 2.5972328186035156

10 ------------- 2.74868911 (exact number) ----------- a very close match with what you got !

> Simulation approximate results for 10,100,1000,10000 rooms:
> 10 2.75
> 100 4.23
> 1000 5.52
> 10000 6.66
>
> Python program for simulation:
>
> #! python
> import sys
> import random
>
>
> def process(bins, trials):
> average = 0
> counts = []
> for n in range(bins):
> counts.append(0)
> random.seed(None)
> for n in range(trials):
> for m in range(bins):
> counts[m] = 0
> for m in range(bins):
> counts[random.randint(0, bins - 1)] += 1
> maximum = 0
> for m in range(bins):
> if counts[m] > maximum:
> maximum = counts[m]
> average += maximum
> average /= trials
> print("Average maximum bin occupation is " + str(average))
>
>
> if len(sys.argv) == 3:
> error = False
> try:
> bins = int(sys.argv[1])
> trials = int(sys.argv[2])
> except ValueError:
> print("Number of bins and number of trials must be integers")
> error = True
> if not error and (bins <= 1 or trials <= 0):
> if bins <= 1:
> print("Number of bins must be greater than 1")
> else:
> print("Number of trials must be greater than 0")
> error = True
> if not error:
> try:
> process(bins, trials)
> except KeyboardInterrupt:
> print("Cancelled")
> else:
> print("Usage: RandomDrop <number-of-bins> <number-of-trials>")
>
> Please reply to ilanlmayer at gmail dot com
>
> __/\__
> \ /
> __/\\ //\__ Ilan Mayer
> \ /
> /__ __\ Toronto, Canada
> /__ __\
> ||

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<a81a1f4a-9a79-41d8-97f0-33d2da940247n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=484&group=rec.puzzles#484

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:622a:1651:b0:344:5d06:7449 with SMTP id y17-20020a05622a165100b003445d067449mr5474211qtj.292.1663349765063;
Fri, 16 Sep 2022 10:36:05 -0700 (PDT)
X-Received: by 2002:a05:6214:c89:b0:4ac:c6ba:3f22 with SMTP id
r9-20020a0562140c8900b004acc6ba3f22mr5273161qvr.9.1663349764885; Fri, 16 Sep
2022 10:36:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Fri, 16 Sep 2022 10:36:04 -0700 (PDT)
In-Reply-To: <0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:55f0:0:0:0:2e5b;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:55f0:0:0:0:2e5b
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com> <0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a81a1f4a-9a79-41d8-97f0-33d2da940247n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Fri, 16 Sep 2022 17:36:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 5055
 by: henh...@gmail.com - Fri, 16 Sep 2022 17:36 UTC

On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
> On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > Have you encountered this number (63.2 %) some time earlier ?
> > ( i may have, but if so, i had forgotten)
> >
> >
> >
> > and also ..........
> >
> >
> > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> >
> >
> > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> >
> >
> >
> > according to the simulations i've done...
> >
> > 100 ppl are randomly assigned to 100 rooms...
> > ---> the Most crowded room is occupied by 5 people. (A)
> >
> > 1000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 5 people. (B)
> >
> > 10000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 22 people.
> >
> >
> > ---------------- what are the theoretical values for (A) and (B) ?
> 22 above seems to be wrong.
>
> Analytic values for 1-4 rooms:
> 1 1
> 2 1.5 (3/2)
> 3 1.889 (17/9)
> 4 2.125 (17/8)
>
> Simulation approximate results for 10,100,1000,10000 rooms:
> 10 2.75
> 100 4.23
> 1000 5.52
> 10000 6.66
>
> Python program for simulation:
>
> #! python
> import sys
> import random
>
>
> def process(bins, trials):
> average = 0
> counts = []
> for n in range(bins):
> counts.append(0)
> random.seed(None)
> for n in range(trials):
> for m in range(bins):
> counts[m] = 0
> for m in range(bins):
> counts[random.randint(0, bins - 1)] += 1
> maximum = 0
> for m in range(bins):
> if counts[m] > maximum:
> maximum = counts[m]
> average += maximum
> average /= trials
> print("Average maximum bin occupation is " + str(average))
>
>
> if len(sys.argv) == 3:
> error = False
> try:
> bins = int(sys.argv[1])
> trials = int(sys.argv[2])
> except ValueError:
> print("Number of bins and number of trials must be integers")
> error = True
> if not error and (bins <= 1 or trials <= 0):
> if bins <= 1:
> print("Number of bins must be greater than 1")
> else:
> print("Number of trials must be greater than 0")
> error = True
> if not error:
> try:
> process(bins, trials)
> except KeyboardInterrupt:
> print("Cancelled")
> else:
> print("Usage: RandomDrop <number-of-bins> <number-of-trials>")
>
> Please reply to ilanlmayer at gmail dot com
>
> __/\__
> \ /
> __/\\ //\__ Ilan Mayer
> \ /
> /__ __\ Toronto, Canada
> /__ __\
> ||

really nice... i have basically 2 comments.

in my Python code, i was stuck with the idea that i had to use a Dictionary to do the counting (tallying up).
This (what i was doing) must be a much, MUCH slower way to do it.

dic= { }
for digit in Lis:
if (digit in dic): dic[ digit ] += 1
else: dic[ digit ] = 1

MaxVal = max(dic.values())

---------- Also, it must be a bit faster to initialize the Dictionary to all 0's in the beginning.

__________________________________________

> py RanDrop.py 100 100
Average maximum bin occupation is 4
> py RanDrop.py 1000 1000
Average maximum bin occupation is 5

At first i was getting only integer results (as above), and i had to insert one line
(apparently, to convert the int into a Floating Point number). ( i dn't really get it)

average *= 1.0 <----------------- (i inserted this line.)
average /= trials
print("Average maximum bin occupation is " + str(average))

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<7c0b36e7-470e-469f-bdb0-4eb69fe747aen@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=485&group=rec.puzzles#485

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:622a:1986:b0:343:225d:f9e1 with SMTP id u6-20020a05622a198600b00343225df9e1mr5433627qtc.651.1663350869235;
Fri, 16 Sep 2022 10:54:29 -0700 (PDT)
X-Received: by 2002:a0c:ab07:0:b0:474:9c36:413e with SMTP id
h7-20020a0cab07000000b004749c36413emr5336095qvb.56.1663350869023; Fri, 16 Sep
2022 10:54:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Fri, 16 Sep 2022 10:54:28 -0700 (PDT)
In-Reply-To: <6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:55f0:0:0:0:2e5b;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:55f0:0:0:0:2e5b
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com> <6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7c0b36e7-470e-469f-bdb0-4eb69fe747aen@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Fri, 16 Sep 2022 17:54:29 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3327
 by: henh...@gmail.com - Fri, 16 Sep 2022 17:54 UTC

On Thursday, September 15, 2022 at 6:15:35 PM UTC-7, henh...@gmail.com wrote:
> On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
> > On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > > Have you encountered this number (63.2 %) some time earlier ? ( i may have, but if so, i had forgotten)

---------- 100 ppl in 100 (random) rooms --> ~ 63.2 rooms get occupied

> > > and also ..........
> > >
> > >
> > > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> > >
> > >
> > > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> > >
> > >
> > >
> > > according to the simulations i've done...
> > >
> > > 100 ppl are randomly assigned to 100 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (A)
> > >
> > > 1000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (B)
> > >
> > > 10000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 22 people.
> > >
> > >
> > > ---------------- what are the theoretical values for (A) and (B) ?
>
>
> > 22 above seems to be wrong.

> really ? waht do you propose ? (or suggest, instead) ?

i inserted two characters [*10] into your program, to find :

Crowded\iMayer> py RanDrop10.py 1000 100
Average maximum bin occupation is 21.56
Crowded\iMayer> py RanDrop10.py 1000 200
Average maximum bin occupation is 21.615
Crowded\iMayer> py RanDrop10.py 1000 400
Average maximum bin occupation is 21.6375
Crowded\iMayer> py RanDrop10.py 1000 1000
Average maximum bin occupation is 21.616

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<cfccafc1-a339-40b8-8feb-738c31b3bd4fn@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=486&group=rec.puzzles#486

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:ac8:7f11:0:b0:35b:a3e7:648f with SMTP id f17-20020ac87f11000000b0035ba3e7648fmr5718373qtk.132.1663355794707;
Fri, 16 Sep 2022 12:16:34 -0700 (PDT)
X-Received: by 2002:ac8:5c45:0:b0:35c:cd2c:c8f8 with SMTP id
j5-20020ac85c45000000b0035ccd2cc8f8mr4700753qtj.105.1663355794514; Fri, 16
Sep 2022 12:16:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Fri, 16 Sep 2022 12:16:34 -0700 (PDT)
In-Reply-To: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2605:b100:b2b:1b9a:6d39:716b:e81:c21a;
posting-account=Z3wesAoAAADgwKkKPL0X98kstUoD_GnZ
NNTP-Posting-Host: 2605:b100:b2b:1b9a:6d39:716b:e81:c21a
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cfccafc1-a339-40b8-8feb-738c31b3bd4fn@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: jdush...@gmail.com (Jonathan Dushoff)
Injection-Date: Fri, 16 Sep 2022 19:16:34 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2337
 by: Jonathan Dushoff - Fri, 16 Sep 2022 19:16 UTC

0.632 is 1 - e^-1, and it shows up everywhere. For example, it's the proportion of rooms that will be occupied if you randomly drop a large number of people into the same number of rooms.

Jonathan

On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> Have you encountered this number (63.2 %) some time earlier ?
> ( i may have, but if so, i had forgotten)
>
>
>
> and also ..........
>
>
> What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
>
>
> (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
>
>
>
> according to the simulations i've done...
>
> 100 ppl are randomly assigned to 100 rooms...
> ---> the Most crowded room is occupied by 5 people. (A)
>
> 1000 ppl are randomly assigned to 1000 rooms...
> ---> the Most crowded room is occupied by 5 people. (B)
>
> 10000 ppl are randomly assigned to 1000 rooms...
> ---> the Most crowded room is occupied by 22 people.
>
>
> ---------------- what are the theoretical values for (A) and (B) ?

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<tFmVK.40624$kEr7.37041@fx44.iad>

  copy mid

https://novabbs.com/interests/article-flat.php?id=487&group=rec.puzzles#487

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx44.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Content-Language: en-GB
Newsgroups: rec.puzzles
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
<a81a1f4a-9a79-41d8-97f0-33d2da940247n@googlegroups.com>
From: dun...@invalid.invalid (duncan smith)
In-Reply-To: <a81a1f4a-9a79-41d8-97f0-33d2da940247n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 213
Message-ID: <tFmVK.40624$kEr7.37041@fx44.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sat, 17 Sep 2022 16:33:29 UTC
Organization: blocknews - www.blocknews.net
Date: Sat, 17 Sep 2022 17:33:25 +0100
X-Received-Bytes: 6234
 by: duncan smith - Sat, 17 Sep 2022 16:33 UTC

On 16/09/2022 18:36, henh...@gmail.com wrote:
> On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
>> On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
>>> Have you encountered this number (63.2 %) some time earlier ?
>>> ( i may have, but if so, i had forgotten)
>>>
>>>
>>>
>>> and also ..........
>>>
>>>
>>> What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
>>>
>>>
>>> (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
>>>
>>>
>>>
>>> according to the simulations i've done...
>>>
>>> 100 ppl are randomly assigned to 100 rooms...
>>> ---> the Most crowded room is occupied by 5 people. (A)
>>>
>>> 1000 ppl are randomly assigned to 1000 rooms...
>>> ---> the Most crowded room is occupied by 5 people. (B)
>>>
>>> 10000 ppl are randomly assigned to 1000 rooms...
>>> ---> the Most crowded room is occupied by 22 people.
>>>
>>>
>>> ---------------- what are the theoretical values for (A) and (B) ?
>> 22 above seems to be wrong.
>>
>> Analytic values for 1-4 rooms:
>> 1 1
>> 2 1.5 (3/2)
>> 3 1.889 (17/9)
>> 4 2.125 (17/8)
>>
>> Simulation approximate results for 10,100,1000,10000 rooms:
>> 10 2.75
>> 100 4.23
>> 1000 5.52
>> 10000 6.66
>>
>> Python program for simulation:
>>
>> #! python
>> import sys
>> import random
>>
>>
>> def process(bins, trials):
>> average = 0
>> counts = []
>> for n in range(bins):
>> counts.append(0)
>> random.seed(None)
>> for n in range(trials):
>> for m in range(bins):
>> counts[m] = 0
>> for m in range(bins):
>> counts[random.randint(0, bins - 1)] += 1
>> maximum = 0
>> for m in range(bins):
>> if counts[m] > maximum:
>> maximum = counts[m]
>> average += maximum
>> average /= trials
>> print("Average maximum bin occupation is " + str(average))
>>
>>
>> if len(sys.argv) == 3:
>> error = False
>> try:
>> bins = int(sys.argv[1])
>> trials = int(sys.argv[2])
>> except ValueError:
>> print("Number of bins and number of trials must be integers")
>> error = True
>> if not error and (bins <= 1 or trials <= 0):
>> if bins <= 1:
>> print("Number of bins must be greater than 1")
>> else:
>> print("Number of trials must be greater than 0")
>> error = True
>> if not error:
>> try:
>> process(bins, trials)
>> except KeyboardInterrupt:
>> print("Cancelled")
>> else:
>> print("Usage: RandomDrop <number-of-bins> <number-of-trials>")
>>
>> Please reply to ilanlmayer at gmail dot com
>>
>> __/\__
>> \ /
>> __/\\ //\__ Ilan Mayer
>> \ /
>> /__ __\ Toronto, Canada
>> /__ __\
>> ||
>
>
>
> really nice... i have basically 2 comments.
>
> in my Python code, i was stuck with the idea that i had to use a Dictionary to do the counting (tallying up).
> This (what i was doing) must be a much, MUCH slower way to do it.
>
> dic= { }
> for digit in Lis:
> if (digit in dic): dic[ digit ] += 1
> else: dic[ digit ] = 1
>
> MaxVal = max(dic.values())
>
>
> ---------- Also, it must be a bit faster to initialize the Dictionary to all 0's in the beginning.
>

> __________________________________________
>
>> py RanDrop.py 100 100
> Average maximum bin occupation is 4
>> py RanDrop.py 1000 1000
> Average maximum bin occupation is 5
>
>
> At first i was getting only integer results (as above), and i had to insert one line
> (apparently, to convert the int into a Floating Point number). ( i dn't really get it)
>
>
> average *= 1.0 <----------------- (i inserted this line.)
> average /= trials
> print("Average maximum bin occupation is " + str(average))

You can use a defaultdict as a counter,

from collections import defaultdict
cntr = defaultdict(int)
cntr[6] += 1
cntr[6] += 1
cntr[6]
2 cntr[1]
0

and initialise it to use the float type if you want (I wouldn't as it's
more natural for counts to be integer valued).

cntr = defaultdict(float)
cntr[6] += 1
cntr[6] += 1
cntr[6]
2.0
cntr[1]
0.0

Or there is (in sufficiently recent versions of Python) the Counter
class for counters.

from collections import Counter
cntr = Counter()
cntr[6] += 1
cntr[6] += 1
cntr[6]
2 cntr[1]
0

This also has a most_common method.

cntr[8] = 1
cntr
Counter({6: 2, 8: 1})
cntr.most_common(n=1)
[(6, 2)]

The random module has a choices function for sampling with replacement.

import random
random.choices(range(10), k=10)
[4, 6, 3, 2, 8, 7, 8, 8, 7, 0]

You could combine the above into a one-liner for sampling and finding
the maximum count.

Counter(random.choices(range(10), k=10)).most_common(n=1)[0][1]
2 Counter(random.choices(range(10), k=10)).most_common(n=1)[0][1]
3 Counter(random.choices(range(10), k=10)).most_common(n=1)[0][1]
2

total = 0
for _ in range(10000):
total += Counter(random.choices(range(10),
k=10)).most_common(n=1)[0][1]

total / 10000
2.7497

You must be using Python2 to get integer division by default. So it's
probably time to install Python3. Cheers.

Duncan

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<CImVK.108726$elEa.93830@fx09.iad>

  copy mid

https://novabbs.com/interests/article-flat.php?id=488&group=rec.puzzles#488

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Content-Language: en-GB
Newsgroups: rec.puzzles
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com>
<a81a1f4a-9a79-41d8-97f0-33d2da940247n@googlegroups.com>
<tFmVK.40624$kEr7.37041@fx44.iad>
From: dun...@invalid.invalid (duncan smith)
In-Reply-To: <tFmVK.40624$kEr7.37041@fx44.iad>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 170
Message-ID: <CImVK.108726$elEa.93830@fx09.iad>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sat, 17 Sep 2022 16:36:50 UTC
Organization: blocknews - www.blocknews.net
Date: Sat, 17 Sep 2022 17:36:41 +0100
X-Received-Bytes: 5632
 by: duncan smith - Sat, 17 Sep 2022 16:36 UTC

On 17/09/2022 17:33, duncan smith wrote:
> On 16/09/2022 18:36, henh...@gmail.com wrote:
>> On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
>>> On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4,
>>> henh...@gmail.com wrote:
>>>> Have you encountered this number (63.2 %) some time earlier ?
>>>> ( i may have, but if so, i had forgotten)
>>>>
>>>>
>>>>
>>>> and also ..........
>>>>
>>>>
>>>> What's the formula that gives me the expected # of ppl in the Most
>>>> crowded room ( 5, 5, 22 below) ?
>>>>
>>>>
>>>> (is there a Web-page that explains it? ------ i couldn't find it in
>>>> SE (StackExchange), etc.)
>>>>
>>>>
>>>>
>>>> according to the simulations i've done...
>>>>
>>>> 100 ppl are randomly assigned to 100 rooms...
>>>> ---> the Most crowded room is occupied by 5 people. (A)
>>>>
>>>> 1000 ppl are randomly assigned to 1000 rooms...
>>>> ---> the Most crowded room is occupied by 5 people. (B)
>>>>
>>>> 10000 ppl are randomly assigned to 1000 rooms...
>>>> ---> the Most crowded room is occupied by 22 people.
>>>>
>>>>
>>>> ---------------- what are the theoretical values for (A) and (B) ?
>>> 22 above seems to be wrong.
>>>
>>> Analytic values for 1-4 rooms:
>>> 1 1
>>> 2 1.5 (3/2)
>>> 3 1.889 (17/9)
>>> 4 2.125 (17/8)
>>>
>>> Simulation approximate results for 10,100,1000,10000 rooms:
>>> 10 2.75
>>> 100 4.23
>>> 1000 5.52
>>> 10000 6.66
>>>
>>> Python program for simulation:
>>>
>>> #! python
>>> import sys
>>> import random
>>>
>>>
>>> def process(bins, trials):
>>> average = 0
>>> counts = []
>>> for n in range(bins):
>>> counts.append(0)
>>> random.seed(None)
>>> for n in range(trials):
>>> for m in range(bins):
>>> counts[m] = 0
>>> for m in range(bins):
>>> counts[random.randint(0, bins - 1)] += 1
>>> maximum = 0
>>> for m in range(bins):
>>> if counts[m] > maximum:
>>> maximum = counts[m]
>>> average += maximum
>>> average /= trials
>>> print("Average maximum bin occupation is " + str(average))
>>>
>>>
>>> if len(sys.argv) == 3:
>>> error = False
>>> try:
>>> bins = int(sys.argv[1])
>>> trials = int(sys.argv[2])
>>> except ValueError:
>>> print("Number of bins and number of trials must be integers")
>>> error = True
>>> if not error and (bins <= 1 or trials <= 0):
>>> if bins <= 1:
>>> print("Number of bins must be greater than 1")
>>> else:
>>> print("Number of trials must be greater than 0")
>>> error = True
>>> if not error:
>>> try:
>>> process(bins, trials)
>>> except KeyboardInterrupt:
>>> print("Cancelled")
>>> else:
>>> print("Usage: RandomDrop <number-of-bins> <number-of-trials>")
>>>
>>> Please reply to ilanlmayer at gmail dot com
>>>
>>> __/\__
>>> \ /
>>> __/\\ //\__ Ilan Mayer
>>> \ /
>>> /__ __\ Toronto, Canada
>>> /__ __\
>>> ||
>>
>>
>>
>> really nice...                  i have basically  2 comments.
>>
>> in my Python code,  i was stuck with the idea that i had to use a
>> Dictionary to do the counting (tallying up).
>> This (what i was doing)  must be a much, MUCH slower way to do it.
>>
>>          dic= { }
>>          for digit in Lis:
>>                         if (digit in dic):       dic[ digit ] += 1
>>                         else:                        dic[ digit ] = 1
>>
>>          MaxVal = max(dic.values())
>>
>>
>> ---------- Also,  it must be a bit faster to initialize the Dictionary
>> to  all  0's  in the beginning.
>>
>
>
>
>> __________________________________________
>>
>>> py RanDrop.py    100     100
>> Average maximum bin occupation is    4
>>> py RanDrop.py    1000     1000
>> Average maximum bin occupation is    5
>>
>>
>> At first i was getting only  integer  results (as above),   and   i
>> had to insert one line
>> (apparently,   to convert the int into a Floating Point number).
>> ( i dn't really get it)
>>
>>
>>      average *= 1.0                          <-----------------  (i
>> inserted  this line.)
>>      average /= trials
>>      print("Average maximum bin occupation is " + str(average))
>
>
> You can use a defaultdict as a counter,
>
> from collections import defaultdict
> cntr = defaultdict(int)
> cntr[6] += 1
> cntr[6] += 1
> cntr[6]
> 2
> cntr[1]
> 0
>
> and initialise it to use the float type if you want (I wouldn't as it's
> more natural for counts to be integer valued).
>

[snip]

I didn't mean integer valued, I meant of type int.

Duncan

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<85a7c256-b25d-4d3c-a15f-22a1edf4b614n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=489&group=rec.puzzles#489

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:ac8:5985:0:b0:35b:ba8c:d522 with SMTP id e5-20020ac85985000000b0035bba8cd522mr11898936qte.213.1663515247098;
Sun, 18 Sep 2022 08:34:07 -0700 (PDT)
X-Received: by 2002:a05:622a:1b8c:b0:35c:c455:9150 with SMTP id
bp12-20020a05622a1b8c00b0035cc4559150mr12020092qtb.166.1663515246940; Sun, 18
Sep 2022 08:34:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Sun, 18 Sep 2022 08:34:06 -0700 (PDT)
In-Reply-To: <tFmVK.40624$kEr7.37041@fx44.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:6f70:803f:74ae:78bc:a4ef;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:6f70:803f:74ae:78bc:a4ef
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com> <a81a1f4a-9a79-41d8-97f0-33d2da940247n@googlegroups.com>
<tFmVK.40624$kEr7.37041@fx44.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <85a7c256-b25d-4d3c-a15f-22a1edf4b614n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Sun, 18 Sep 2022 15:34:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 8823
 by: henh...@gmail.com - Sun, 18 Sep 2022 15:34 UTC

On Saturday, September 17, 2022 at 9:33:32 AM UTC-7, duncan smith wrote:
> On 16/09/2022 18:36, henh...@gmail.com wrote:
> > On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
> >> On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> >>> Have you encountered this number (63.2 %) some time earlier ?
> >>> ( i may have, but if so, i had forgotten)
> >>>
> >>>
> >>>
> >>> and also ..........
> >>>
> >>>
> >>> What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> >>>
> >>>
> >>> (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> >>>
> >>>
> >>>
> >>> according to the simulations i've done...
> >>>
> >>> 100 ppl are randomly assigned to 100 rooms...
> >>> ---> the Most crowded room is occupied by 5 people. (A)
> >>>
> >>> 1000 ppl are randomly assigned to 1000 rooms...
> >>> ---> the Most crowded room is occupied by 5 people. (B)
> >>>
> >>> 10000 ppl are randomly assigned to 1000 rooms...
> >>> ---> the Most crowded room is occupied by 22 people.
> >>>
> >>>
> >>> ---------------- what are the theoretical values for (A) and (B) ?
> >> 22 above seems to be wrong.
> >>
> >> Analytic values for 1-4 rooms:
> >> 1 1
> >> 2 1.5 (3/2)
> >> 3 1.889 (17/9)
> >> 4 2.125 (17/8)
> >>
> >> Simulation approximate results for 10,100,1000,10000 rooms:
> >> 10 2.75
> >> 100 4.23
> >> 1000 5.52
> >> 10000 6.66
> >>
> >> Python program for simulation:
> >>
> >> #! python
> >> import sys
> >> import random
> >>
> >>
> >> def process(bins, trials):
> >> average = 0
> >> counts = []
> >> for n in range(bins):
> >> counts.append(0)
> >> random.seed(None)
> >> for n in range(trials):
> >> for m in range(bins):
> >> counts[m] = 0
> >> for m in range(bins):
> >> counts[random.randint(0, bins - 1)] += 1
> >> maximum = 0
> >> for m in range(bins):
> >> if counts[m] > maximum:
> >> maximum = counts[m]
> >> average += maximum
> >> average /= trials
> >> print("Average maximum bin occupation is " + str(average))
> >>
> >>
> >> if len(sys.argv) == 3:
> >> error = False
> >> try:
> >> bins = int(sys.argv[1])
> >> trials = int(sys.argv[2])
> >> except ValueError:
> >> print("Number of bins and number of trials must be integers")
> >> error = True
> >> if not error and (bins <= 1 or trials <= 0):
> >> if bins <= 1:
> >> print("Number of bins must be greater than 1")
> >> else:
> >> print("Number of trials must be greater than 0")
> >> error = True
> >> if not error:
> >> try:
> >> process(bins, trials)
> >> except KeyboardInterrupt:
> >> print("Cancelled")
> >> else:
> >> print("Usage: RandomDrop <number-of-bins> <number-of-trials>")
> >>
> >> Please reply to ilanlmayer at gmail dot com
> >>
> >> __/\__
> >> \ /
> >> __/\\ //\__ Ilan Mayer
> >> \ /
> >> /__ __\ Toronto, Canada
> >> /__ __\
> >> ||
> >
> >
> >
> > really nice... i have basically 2 comments.
> >
> > in my Python code, i was stuck with the idea that i had to use a Dictionary to do the counting (tallying up).
> > This (what i was doing) must be a much, MUCH slower way to do it.
> >
> > dic= { }
> > for digit in Lis:
> > if (digit in dic): dic[ digit ] += 1
> > else: dic[ digit ] = 1
> >
> > MaxVal = max(dic.values())
> >
> >
> > ---------- Also, it must be a bit faster to initialize the Dictionary to all 0's in the beginning.
> >
>
>
>
> > __________________________________________
> >
> >> py RanDrop.py 100 100
> > Average maximum bin occupation is 4
> >> py RanDrop.py 1000 1000
> > Average maximum bin occupation is 5
> >
> >
> > At first i was getting only integer results (as above), and i had to insert one line
> > (apparently, to convert the int into a Floating Point number). ( i dn't really get it)
> >
> >
> > average *= 1.0 <----------------- (i inserted this line.)
> > average /= trials
> > print("Average maximum bin occupation is " + str(average))
> You can use a defaultdict as a counter,
>
> from collections import defaultdict
> cntr = defaultdict(int)
> cntr[6] += 1
> cntr[6] += 1
> cntr[6]
> 2
> cntr[1]
> 0
>
> and initialise it to use the float type if you want (I wouldn't as it's
> more natural for counts to be integer valued).
>
> cntr = defaultdict(float)
> cntr[6] += 1
> cntr[6] += 1
> cntr[6]
> 2.0
> cntr[1]
> 0.0
>
> Or there is (in sufficiently recent versions of Python) the Counter
> class for counters.
>
> from collections import Counter
> cntr = Counter()
> cntr[6] += 1
> cntr[6] += 1
> cntr[6]
> 2
> cntr[1]
> 0
>
> This also has a most_common method.
>
> cntr[8] = 1
> cntr
> Counter({6: 2, 8: 1})
> cntr.most_common(n=1)
> [(6, 2)]
>
> The random module has a choices function for sampling with replacement.
>
> import random
> random.choices(range(10), k=10)
> [4, 6, 3, 2, 8, 7, 8, 8, 7, 0]
>
> You could combine the above into a one-liner for sampling and finding
> the maximum count.
>
> Counter(random.choices(range(10), k=10)).most_common(n=1)[0][1]
> 2
> Counter(random.choices(range(10), k=10)).most_common(n=1)[0][1]
> 3
> Counter(random.choices(range(10), k=10)).most_common(n=1)[0][1]
> 2
>
> total = 0
> for _ in range(10000):
> total += Counter(random.choices(range(10),
> k=10)).most_common(n=1)[0][1]
>
>
> total / 10000
> 2.7497
>
>
> You must be using Python2 to get integer division by default. So it's
> probably time to install Python3. Cheers.
>
> Duncan

thanks... that's good to know... i've only used the latest version of Python 3

i guess you never (?) use [type declarations] (on variables) in Python (3)
....................
>>> Can you declare a type in Python? -- Python is completely object oriented, and not "statically typed". You do not need to declare variables before using them, or declare their type. Every variable in Python is an object.

___________________________
re: the Most crowded room --- (expected # of max. Birthday collisions)

another, similar topic would be... if all the games in NFL, NBA, MLB... were like a (fair) coin-toss, what is the theoretical , expected Longest winning (and losing) streaks every year (for one team, for all the teams)
------------------ vs. What we actually get.

Can the actual stats be simulated if we assume (model) that the strongest (riches) teams (Yankees, Red Sox...) are likely to win any game by , say, 60 % probability ?

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<76327858-e678-41c8-af0c-69a4a46aea9dn@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=493&group=rec.puzzles#493

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:620a:2844:b0:6b8:5f52:a6b5 with SMTP id h4-20020a05620a284400b006b85f52a6b5mr11009666qkp.351.1663531252637;
Sun, 18 Sep 2022 13:00:52 -0700 (PDT)
X-Received: by 2002:a05:6214:c6f:b0:4ac:8514:2f9 with SMTP id
t15-20020a0562140c6f00b004ac851402f9mr12126859qvj.62.1663531252533; Sun, 18
Sep 2022 13:00:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Sun, 18 Sep 2022 13:00:52 -0700 (PDT)
In-Reply-To: <7c0b36e7-470e-469f-bdb0-4eb69fe747aen@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:5620:2f8:c595:9254:ed8:f3ac;
posting-account=q4H9owkAAAA7qKFiZGLslkOsPXsbTfvM
NNTP-Posting-Host: 2607:fea8:5620:2f8:c595:9254:ed8:f3ac
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com> <6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>
<7c0b36e7-470e-469f-bdb0-4eb69fe747aen@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <76327858-e678-41c8-af0c-69a4a46aea9dn@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: ilan_no_...@hotmail.com (Ilan Mayer)
Injection-Date: Sun, 18 Sep 2022 20:00:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 5225
 by: Ilan Mayer - Sun, 18 Sep 2022 20:00 UTC

On Friday, September 16, 2022 at 1:54:30 PM UTC-4, henh...@gmail.com wrote:
> On Thursday, September 15, 2022 at 6:15:35 PM UTC-7, henh...@gmail.com wrote:
> > On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
> > > On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > > > Have you encountered this number (63.2 %) some time earlier ? ( i may have, but if so, i had forgotten)
> ---------- 100 ppl in 100 (random) rooms --> ~ 63.2 rooms get occupied
> > > > and also ..........
> > > >
> > > >
> > > > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> > > >
> > > >
> > > > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> > > >
> > > >
> > > >
> > > > according to the simulations i've done...
> > > >
> > > > 100 ppl are randomly assigned to 100 rooms...
> > > > ---> the Most crowded room is occupied by 5 people. (A)
> > > >
> > > > 1000 ppl are randomly assigned to 1000 rooms...
> > > > ---> the Most crowded room is occupied by 5 people. (B)
> > > >
> > > > 10000 ppl are randomly assigned to 1000 rooms...
> > > > ---> the Most crowded room is occupied by 22 people.
> > > >
> > > >
> > > > ---------------- what are the theoretical values for (A) and (B) ?
> >
> >
> > > 22 above seems to be wrong.
> > really ? waht do you propose ? (or suggest, instead) ?
>
>
> i inserted two characters [*10] into your program, to find :
>
>
> Crowded\iMayer> py RanDrop10.py 1000 100
> Average maximum bin occupation is 21.56
> Crowded\iMayer> py RanDrop10.py 1000 200
> Average maximum bin occupation is 21.615
> Crowded\iMayer> py RanDrop10.py 1000 400
> Average maximum bin occupation is 21.6375
> Crowded\iMayer> py RanDrop10.py 1000 1000
> Average maximum bin occupation is 21.616

These numbers seem to be incorrect. Here are my results from the program below:
1000 balls, 100 bins, 1000 trials - 18.76
1000 balls, 200 bins, 1000 trials - 12.15
1000 balls, 400 bins, 1000 trials - 8.28
1000 balls, 1000 bins, 1000 trials - 5.50
Intuitively the number should decrease as the number of bins (rooms) increases for the same number of balls (people).

Here is a revised version of my program that allows any number of balls/bins (or people/rooms):

#! python
import sys
import random

def process(balls, bins, trials):
average = 0
counts = []
for n in range(bins):
counts.append(0)
random.seed(None)
for n in range(trials):
for m in range(bins):
counts[m] = 0
for m in range(balls):
counts[random.randint(0, bins - 1)] += 1
maximum = 0
for m in range(bins):
if counts[m] > maximum:
maximum = counts[m]
average += maximum
average /= trials
print("Average maximum bin occupation is " + str(average))

if len(sys.argv) == 4:
error = False
try:
balls = int(sys.argv[1])
bins = int(sys.argv[2])
trials = int(sys.argv[3])
except ValueError:
print("Numbers of balls, bins and trials must be integers")
error = True
if not error and (balls <= 0 or bins <= 0 or trials <= 0):
if balls <= 1:
print("Number of balls must be greater than 0")
elif bins <= 1:
print("Number of bins must be greater than 0")
else:
print("Number of trials must be greater than 0")
error = True
if not error:
try:
process(balls, bins, trials)
except KeyboardInterrupt:
print("Cancelled")
else:
print("Usage: RandomDrop <number-of-balls> <number-of-bins> <number-of-trials>")

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=494&group=rec.puzzles#494

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:6214:528e:b0:4ac:d1bf:59b4 with SMTP id kj14-20020a056214528e00b004acd1bf59b4mr12310415qvb.3.1663531841658;
Sun, 18 Sep 2022 13:10:41 -0700 (PDT)
X-Received: by 2002:a05:620a:15e:b0:6ce:d179:1045 with SMTP id
e30-20020a05620a015e00b006ced1791045mr8163297qkn.59.1663531841526; Sun, 18
Sep 2022 13:10:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Sun, 18 Sep 2022 13:10:41 -0700 (PDT)
In-Reply-To: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=99.240.231.195; posting-account=q4H9owkAAAA7qKFiZGLslkOsPXsbTfvM
NNTP-Posting-Host: 99.240.231.195
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: ilan_no_...@hotmail.com (Ilan Mayer)
Injection-Date: Sun, 18 Sep 2022 20:10:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2183
 by: Ilan Mayer - Sun, 18 Sep 2022 20:10 UTC

On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> Have you encountered this number (63.2 %) some time earlier ?
> ( i may have, but if so, i had forgotten)
>
>
>
> and also ..........
>
>
> What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
>
>
> (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
>
>
>
> according to the simulations i've done...
>
> 100 ppl are randomly assigned to 100 rooms...
> ---> the Most crowded room is occupied by 5 people. (A)
>
> 1000 ppl are randomly assigned to 1000 rooms...
> ---> the Most crowded room is occupied by 5 people. (B)
>
> 10000 ppl are randomly assigned to 1000 rooms...
> ---> the Most crowded room is occupied by 22 people.
>
>
> ---------------- what are the theoretical values for (A) and (B) ?

The exact number for 100 people / 100 rooms is 4.23259523879579 (found by a C# program).

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<a9986dcf-7c1b-4286-a199-76fd4ccf0014n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=495&group=rec.puzzles#495

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:ac8:5a8c:0:b0:35b:b2f7:7e96 with SMTP id c12-20020ac85a8c000000b0035bb2f77e96mr12652015qtc.659.1663532134368;
Sun, 18 Sep 2022 13:15:34 -0700 (PDT)
X-Received: by 2002:ae9:e910:0:b0:6cd:a22f:38f1 with SMTP id
x16-20020ae9e910000000b006cda22f38f1mr10865800qkf.397.1663532134238; Sun, 18
Sep 2022 13:15:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Sun, 18 Sep 2022 13:15:34 -0700 (PDT)
In-Reply-To: <6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:5620:2f8:c595:9254:ed8:f3ac;
posting-account=q4H9owkAAAA7qKFiZGLslkOsPXsbTfvM
NNTP-Posting-Host: 2607:fea8:5620:2f8:c595:9254:ed8:f3ac
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<0d6adb99-0b59-4b90-b5ae-cefdd1f6d607n@googlegroups.com> <6e5b44a1-6061-40e8-a156-322ce92dccfbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a9986dcf-7c1b-4286-a199-76fd4ccf0014n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: ilan_no_...@hotmail.com (Ilan Mayer)
Injection-Date: Sun, 18 Sep 2022 20:15:34 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4662
 by: Ilan Mayer - Sun, 18 Sep 2022 20:15 UTC

On Thursday, September 15, 2022 at 9:15:35 PM UTC-4, henh...@gmail.com wrote:
> On Thursday, September 15, 2022 at 9:01:47 AM UTC-7, Ilan Mayer wrote:
> > On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > > Have you encountered this number (63.2 %) some time earlier ? ( i may have, but if so, i had forgotten)
> 100 ppl in 100 (random) rooms --> ~ 63.2 rooms get occupied
> > >
> > > and also ..........
> > >
> > >
> > > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> > >
> > >
> > > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> > >
> > >
> > >
> > > according to the simulations i've done...
> > >
> > > 100 ppl are randomly assigned to 100 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (A)
> > >
> > > 1000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (B)
> > >
> > > 10000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 22 people.
> > >
> > >
> > > ---------------- what are the theoretical values for (A) and (B) ?
>
>
> > 22 above seems to be wrong.
> really ? waht do you propose ?

Sorry, I misread as 10000 people / 10000 rooms. For 10000 people / 1000 rooms 22 is in agreement with my results.

> >
> > Analytic values for 1-4 rooms:
> > 1 --- 1
> > 2 --- 1.5 (3/2)
> > 3 --- 1.889 (17/9)
> > 4 --- 2.125 (17/8)
>
>
> 6 --------------- 2.408179012345679
>
> 8 -------------- 2.5972328186035156
>
> 10 ------------- 2.74868911 (exact number) ----------- a very close match with what you got !
> > Simulation approximate results for 10,100,1000,10000 rooms:
> > 10 2.75
> > 100 4.23
> > 1000 5.52
> > 10000 6.66
> >
> > Python program for simulation:
> >
> > #! python
> > import sys
> > import random
> >
> >
> > def process(bins, trials):
> > average = 0
> > counts = []
> > for n in range(bins):
> > counts.append(0)
> > random.seed(None)
> > for n in range(trials):
> > for m in range(bins):
> > counts[m] = 0
> > for m in range(bins):
> > counts[random.randint(0, bins - 1)] += 1
> > maximum = 0
> > for m in range(bins):
> > if counts[m] > maximum:
> > maximum = counts[m]
> > average += maximum
> > average /= trials
> > print("Average maximum bin occupation is " + str(average))
> >
> >
> > if len(sys.argv) == 3:
> > error = False
> > try:
> > bins = int(sys.argv[1])
> > trials = int(sys.argv[2])
> > except ValueError:
> > print("Number of bins and number of trials must be integers")
> > error = True
> > if not error and (bins <= 1 or trials <= 0):
> > if bins <= 1:
> > print("Number of bins must be greater than 1")
> > else:
> > print("Number of trials must be greater than 0")
> > error = True
> > if not error:
> > try:
> > process(bins, trials)
> > except KeyboardInterrupt:
> > print("Cancelled")
> > else:
> > print("Usage: RandomDrop <number-of-bins> <number-of-trials>")
> >
> > Please reply to ilanlmayer at gmail dot com
> >
> > __/\__
> > \ /
> > __/\\ //\__ Ilan Mayer
> > \ /
> > /__ __\ Toronto, Canada
> > /__ __\
> > ||

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=496&group=rec.puzzles#496

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:622a:ca:b0:35c:b8c3:ab05 with SMTP id p10-20020a05622a00ca00b0035cb8c3ab05mr12757881qtw.92.1663533481598;
Sun, 18 Sep 2022 13:38:01 -0700 (PDT)
X-Received: by 2002:a05:622a:105:b0:35c:d63e:3452 with SMTP id
u5-20020a05622a010500b0035cd63e3452mr10028168qtw.668.1663533481443; Sun, 18
Sep 2022 13:38:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Sun, 18 Sep 2022 13:38:01 -0700 (PDT)
In-Reply-To: <8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:6f70:0:0:0:a597;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:6f70:0:0:0:a597
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com> <8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Sun, 18 Sep 2022 20:38:01 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2954
 by: henh...@gmail.com - Sun, 18 Sep 2022 20:38 UTC

On Sunday, September 18, 2022 at 1:10:42 PM UTC-7, Ilan Mayer wrote:
> On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > Have you encountered this number (63.2 %) some time earlier ?
> > ( i may have, but if so, i had forgotten)
> >
> >
> >
> > and also ..........
> >
> >
> > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> >
> >
> > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> >
> >
> >
> > according to the simulations i've done...
> >
> > 100 ppl are randomly assigned to 100 rooms...
> > ---> the Most crowded room is occupied by 5 people. (A)
> >
> > 1000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 5 people. (B)
> >
> > 10000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 22 people.
> >
> >
> > ---------------- what are the theoretical values for (A) and (B) ?

> The exact number for 100 people / 100 rooms is 4.23259523879579 (found by a C# program).

How long is (was) the execution (run-time) for that program?

Less than 10 min. would be impressive , but it depends on how fast the PC is

i don't think i can do 1000 people / 1000+ rooms on my slow home PC

> > 1000 ppl are randomly assigned to 1000 rooms...
> > ---> the Most crowded room is occupied by 5 people. (B)

---------------- i'm starting to understand why young ppl omit the final periods
( seems too formal )

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<709ad694-b5c4-4d9d-891c-d4f804afdc08n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=497&group=rec.puzzles#497

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:6214:1c4b:b0:4aa:b3a6:976b with SMTP id if11-20020a0562141c4b00b004aab3a6976bmr12024215qvb.81.1663534818211;
Sun, 18 Sep 2022 14:00:18 -0700 (PDT)
X-Received: by 2002:ad4:5947:0:b0:4ad:1a49:b984 with SMTP id
eo7-20020ad45947000000b004ad1a49b984mr9058004qvb.87.1663534818015; Sun, 18
Sep 2022 14:00:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Sun, 18 Sep 2022 14:00:17 -0700 (PDT)
In-Reply-To: <456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:5620:2f8:c595:9254:ed8:f3ac;
posting-account=q4H9owkAAAA7qKFiZGLslkOsPXsbTfvM
NNTP-Posting-Host: 2607:fea8:5620:2f8:c595:9254:ed8:f3ac
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com> <456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <709ad694-b5c4-4d9d-891c-d4f804afdc08n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: ilan_no_...@hotmail.com (Ilan Mayer)
Injection-Date: Sun, 18 Sep 2022 21:00:18 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3272
 by: Ilan Mayer - Sun, 18 Sep 2022 21:00 UTC

On Sunday, September 18, 2022 at 4:38:02 PM UTC-4, henh...@gmail.com wrote:
> On Sunday, September 18, 2022 at 1:10:42 PM UTC-7, Ilan Mayer wrote:
> > On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > > Have you encountered this number (63.2 %) some time earlier ?
> > > ( i may have, but if so, i had forgotten)
> > >
> > >
> > >
> > > and also ..........
> > >
> > >
> > > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> > >
> > >
> > > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> > >
> > >
> > >
> > > according to the simulations i've done...
> > >
> > > 100 ppl are randomly assigned to 100 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (A)
> > >
> > > 1000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (B)
> > >
> > > 10000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 22 people.
> > >
> > >
> > > ---------------- what are the theoretical values for (A) and (B) ?
>
>
>
> > The exact number for 100 people / 100 rooms is 4.23259523879579 (found by a C# program).
> How long is (was) the execution (run-time) for that program?
>
> Less than 10 min. would be impressive , but it depends on how fast the PC is
>
>
It took about 8 minutes on a rather old laptop.
The time grows exponentially with the number of people/rooms, so for 1000/1000 it is not going to be feasible even on the fastest pc.
>
> i don't think i can do 1000 people / 1000+ rooms on my slow home PC
> > > 1000 ppl are randomly assigned to 1000 rooms...
> > > ---> the Most crowded room is occupied by 5 people. (B)
> ---------------- i'm starting to understand why young ppl omit the final periods
> ( seems too formal )

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<26fc1925-6cb1-4efc-9c26-b3ae39e5d26bn@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=502&group=rec.puzzles#502

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:ac8:5bcd:0:b0:35b:b56d:b5 with SMTP id b13-20020ac85bcd000000b0035bb56d00b5mr15846151qtb.462.1663607363127;
Mon, 19 Sep 2022 10:09:23 -0700 (PDT)
X-Received: by 2002:a05:622a:1a02:b0:35b:bb29:fb86 with SMTP id
f2-20020a05622a1a0200b0035bbb29fb86mr15855121qtb.456.1663607362929; Mon, 19
Sep 2022 10:09:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Mon, 19 Sep 2022 10:09:22 -0700 (PDT)
In-Reply-To: <709ad694-b5c4-4d9d-891c-d4f804afdc08n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:89b0:0:0:0:5daa;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:89b0:0:0:0:5daa
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com> <456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>
<709ad694-b5c4-4d9d-891c-d4f804afdc08n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <26fc1925-6cb1-4efc-9c26-b3ae39e5d26bn@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Mon, 19 Sep 2022 17:09:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3915
 by: henh...@gmail.com - Mon, 19 Sep 2022 17:09 UTC

On Sunday, September 18, 2022 at 2:00:19 PM UTC-7, Ilan Mayer wrote:
> On Sunday, September 18, 2022 at 4:38:02 PM UTC-4, henh...@gmail.com wrote:
> > On Sunday, September 18, 2022 at 1:10:42 PM UTC-7, Ilan Mayer wrote:
> > > On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail.com wrote:
> > > > Have you encountered this number (63.2 %) some time earlier ?
> > > > ( i may have, but if so, i had forgotten)
> > > >
> > > >
> > > >
> > > > and also ..........
> > > >
> > > >
> > > > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> > > >
> > > >
> > > > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> > > >
> > > >
> > > >
> > > > according to the simulations i've done...
> > > >
> > > > 100 ppl are randomly assigned to 100 rooms...
> > > > ---> the Most crowded room is occupied by 5 people. (A)
> > > >
> > > > 1000 ppl are randomly assigned to 1000 rooms...
> > > > ---> the Most crowded room is occupied by 5 people. (B)
> > > >
> > > > 10000 ppl are randomly assigned to 1000 rooms...
> > > > ---> the Most crowded room is occupied by 22 people.
> > > >
> > > >
> > > > ---------------- what are the theoretical values for (A) and (B) ?
> >
> >
> >
> > > The exact number for 100 people / 100 rooms is 4.23259523879579 (found by a C# program).
> > How long is (was) the execution (run-time) for that program?
> >
> > Less than 10 min. would be impressive , but it depends on how fast the PC is
> >
> >
> It took about 8 minutes on a rather old laptop.
> The time grows exponentially with the number of people/rooms, so for 1000/1000 it is not going to be feasible even on the fastest pc.
> >

-------- The time grows [exponentially] with the number of people/rooms, (my emphasis)

i don't want to seem Nit-picky
(but we're all Puzzle Nerds here, right ?)

where N= number of people/rooms
the relevant numbers (we're concerned about) grows proportional to N^N

is that called Super-Exponential or Supra--..... or something like that ?

z> > i don't think i can do 1000 people / 1000+ rooms on my slow home PC
> > > > 1000 ppl are randomly assigned to 1000 rooms...
> > > > ---> the Most crowded room is occupied by 5 people. (B)
> > ---------------- i'm starting to understand why young ppl omit the final periods
> > ( seems too formal )

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<64f705b5-f37b-465f-9882-1b4dd9887e27n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=503&group=rec.puzzles#503

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:ae9:ef4f:0:b0:6cb:d294:3333 with SMTP id d76-20020ae9ef4f000000b006cbd2943333mr15072467qkg.511.1663637705318;
Mon, 19 Sep 2022 18:35:05 -0700 (PDT)
X-Received: by 2002:ac8:7d90:0:b0:35b:afd3:20aa with SMTP id
c16-20020ac87d90000000b0035bafd320aamr16987551qtd.252.1663637705168; Mon, 19
Sep 2022 18:35:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Mon, 19 Sep 2022 18:35:04 -0700 (PDT)
In-Reply-To: <26fc1925-6cb1-4efc-9c26-b3ae39e5d26bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:5620:2f8:ed43:2c34:5f08:7153;
posting-account=q4H9owkAAAA7qKFiZGLslkOsPXsbTfvM
NNTP-Posting-Host: 2607:fea8:5620:2f8:ed43:2c34:5f08:7153
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com> <456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>
<709ad694-b5c4-4d9d-891c-d4f804afdc08n@googlegroups.com> <26fc1925-6cb1-4efc-9c26-b3ae39e5d26bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <64f705b5-f37b-465f-9882-1b4dd9887e27n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: ilan_no_...@hotmail.com (Ilan Mayer)
Injection-Date: Tue, 20 Sep 2022 01:35:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4647
 by: Ilan Mayer - Tue, 20 Sep 2022 01:35 UTC

On Monday, September 19, 2022 at 1:09:24 PM UTC-4, henh...@gmail.com wrote:
> On Sunday, September 18, 2022 at 2:00:19 PM UTC-7, Ilan Mayer wrote:
> > On Sunday, September 18, 2022 at 4:38:02 PM UTC-4, henh...@gmail.com wrote:
> > > On Sunday, September 18, 2022 at 1:10:42 PM UTC-7, Ilan Mayer wrote:
> > > > On Wednesday, September 14, 2022 at 5:42:33 PM UTC-4, henh...@gmail..com wrote:
> > > > > Have you encountered this number (63.2 %) some time earlier ?
> > > > > ( i may have, but if so, i had forgotten)
> > > > >
> > > > >
> > > > >
> > > > > and also ..........
> > > > >
> > > > >
> > > > > What's the formula that gives me the expected # of ppl in the Most crowded room ( 5, 5, 22 below) ?
> > > > >
> > > > >
> > > > > (is there a Web-page that explains it? ------ i couldn't find it in SE (StackExchange), etc.)
> > > > >
> > > > >
> > > > >
> > > > > according to the simulations i've done...
> > > > >
> > > > > 100 ppl are randomly assigned to 100 rooms...
> > > > > ---> the Most crowded room is occupied by 5 people. (A)
> > > > >
> > > > > 1000 ppl are randomly assigned to 1000 rooms...
> > > > > ---> the Most crowded room is occupied by 5 people. (B)
> > > > >
> > > > > 10000 ppl are randomly assigned to 1000 rooms...
> > > > > ---> the Most crowded room is occupied by 22 people.
> > > > >
> > > > >
> > > > > ---------------- what are the theoretical values for (A) and (B) ?
> > >
> > >
> > >
> > > > The exact number for 100 people / 100 rooms is 4.23259523879579 (found by a C# program).
> > > How long is (was) the execution (run-time) for that program?
> > >
> > > Less than 10 min. would be impressive , but it depends on how fast the PC is
> > >
> > >
> > It took about 8 minutes on a rather old laptop.
> > The time grows exponentially with the number of people/rooms, so for 1000/1000 it is not going to be feasible even on the fastest pc.
> > >
> -------- The time grows [exponentially] with the number of people/rooms, (my emphasis)
>
> i don't want to seem Nit-picky
> (but we're all Puzzle Nerds here, right ?)
>
> where N= number of people/rooms
> the relevant numbers (we're concerned about) grows proportional to N^N
>
> is that called Super-Exponential or Supra--..... or something like that ?
>

The program enumerates all the partitions and calculates the number of permutations of people/rooms for each partition, rather than going through all N^N combinations individually, so it is much less than O(N^N), but still run time grows too fast to go much beyond 100; the term "exponentially" was used loosely.

>
> z> > i don't think i can do 1000 people / 1000+ rooms on my slow home PC
> > > > > 1000 ppl are randomly assigned to 1000 rooms...
> > > > > ---> the Most crowded room is occupied by 5 people. (B)
> > > ---------------- i'm starting to understand why young ppl omit the final periods
> > > ( seems too formal )

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<20220923013414.245585d519f6a76f5cbc8f4a@gmail.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=511&group=rec.puzzles#511

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: anton....@gmail.com (Anton Shepelev)
Newsgroups: rec.puzzles
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Date: Fri, 23 Sep 2022 01:34:14 +0300
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <20220923013414.245585d519f6a76f5cbc8f4a@gmail.com>
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="952d3c513b8c83f07f47c5d6b903700e";
logging-data="2448053"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19M0JeD+9NOXWg3vkGm/m0z/kDqexPVk90="
Cancel-Lock: sha1:CZeaZ3QIH0EbsT3yRKjJDIL5Wbg=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
 by: Anton Shepelev - Thu, 22 Sep 2022 22:34 UTC

HH:

> What's the formula that gives me the expected # of ppl in
> the Most crowded room
>
> according to the simulations i've done...

Instead of simulation, you can compute the exact value.
Observe that allocations of p people in r rooms can be
expressed as the expanded terms of a multinomial of power p
with r terms. For example:

r p
1:2 (a)^2 = a^2
E(m) = 2 = 2

2:1 (a+b)^1 = a + b
E(m) = (1 + 1)/2 = 1

2:2 (a+b)^2 = a^2 + b^2 + ab + ba =>
E(m) = ( 2 + 2 1 + 1 )/4 = 1 1/2

3:2 (a+b)^3 = a^3 + b^3 + 3b^2a + 3ab^2
E(m) =( 3 + 3 + 3 *2 + 3 * 2)/8 = 2 1/4

2:3 (a+b+c)^2 = a^2 + b^2 + c^2 + 2 a b + 2 a c + 2 b c
E(m) = ( 2 + 2 + 2 + 2 * 1 + 2 * 1 + 2 * 1)/9 = 4/3

This is regular and easily computable by sequential
generation of the terms and their corresponding multinomial
coefficient.

--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<8a8d31eb-03a4-4bf9-8c7a-49b89249d4a4n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=518&group=rec.puzzles#518

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:6214:2264:b0:4ad:7187:a9ec with SMTP id gs4-20020a056214226400b004ad7187a9ecmr23137380qvb.40.1664315652312;
Tue, 27 Sep 2022 14:54:12 -0700 (PDT)
X-Received: by 2002:a9d:2f47:0:b0:65c:610:60e4 with SMTP id
h65-20020a9d2f47000000b0065c061060e4mr8616200otb.260.1664315651987; Tue, 27
Sep 2022 14:54:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Tue, 27 Sep 2022 14:54:11 -0700 (PDT)
In-Reply-To: <20220923013414.245585d519f6a76f5cbc8f4a@gmail.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:f450:0:0:0:c05b;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:f450:0:0:0:c05b
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com> <20220923013414.245585d519f6a76f5cbc8f4a@gmail.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8a8d31eb-03a4-4bf9-8c7a-49b89249d4a4n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Tue, 27 Sep 2022 21:54:12 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2512
 by: henh...@gmail.com - Tue, 27 Sep 2022 21:54 UTC

On Thursday, September 22, 2022 at 3:34:17 PM UTC-7, Anton Shepelev wrote:
> HH:
> > What's the formula that gives me the expected # of ppl in
> > the Most crowded room
> >
> > according to the simulations i've done...
> Instead of simulation, you can compute the exact value.
> Observe that allocations of p people in r rooms can be
> expressed as the expanded terms of a multinomial of power p
> with r terms. For example:
>
> r p
> 1:2 (a)^2 = a^2
> E(m) = 2 = 2
>
> 2:1 (a+b)^1 = a + b
> E(m) = (1 + 1)/2 = 1
>
> 2:2 (a+b)^2 = a^2 + b^2 + ab + ba =>
> E(m) = ( 2 + 2 1 + 1 )/4 = 1 1/2
>
> 3:2 (a+b)^3 = a^3 + b^3 + 3b^2a + 3ab^2
> E(m) =( 3 + 3 + 3 *2 + 3 * 2)/8 = 2 1/4
>
> 2:3 (a+b+c)^2 = a^2 + b^2 + c^2 + 2 a b + 2 a c + 2 b c
> E(m) = ( 2 + 2 + 2 + 2 * 1 + 2 * 1 + 2 * 1)/9 = 4/3
>
> This is regular and easily computable by sequential
> generation of the terms and their corresponding multinomial
> coefficient.
> --
> () ascii ribbon campaign - against html e-mail
> /\ www.asciiribbon.org - against proprietary attachments

really?

can we get the fraction (expected value) for 10 ppl in 10 rooms this way ?

( in the very beginning, i was thinking of something like this... )

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<20221007002827.05ba1df6a89075223d5c5701@gmail.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=555&group=rec.puzzles#555

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: anton....@gmail.com (Anton Shepelev)
Newsgroups: rec.puzzles
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Date: Fri, 7 Oct 2022 00:28:27 +0300
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <20221007002827.05ba1df6a89075223d5c5701@gmail.com>
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<20220923013414.245585d519f6a76f5cbc8f4a@gmail.com>
<8a8d31eb-03a4-4bf9-8c7a-49b89249d4a4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="dffca756f13445243cb4bdbb9af34135";
logging-data="3646789"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aSGnHyhjBcvsssRhS6zUeDR+ophU6c4k="
Cancel-Lock: sha1:trPEUxGZw7wKHkhs1KkK2dTugbY=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
 by: Anton Shepelev - Thu, 6 Oct 2022 21:28 UTC

henh... to Anton Shepelev:

> > Instead of simulation, you can compute the exact value.
> > Observe that allocations of p people in r rooms can be
> > expressed as the expanded terms of a multinomial of
> > power p with r terms. For example:
> > [...]
> > This is regular and easily computable by sequential
> > generation of the terms and their corresponding
> > multinomial coefficient.
>
> really?

State you doubts, if any.

> can we get the fraction (expected value) for 10 ppl in 10
> rooms this way ?

State your doubts, if any. I say we can, and my C program
reports:

1168918030 / 424490995 ~= 2.753693

Now, what is your result, if any?

> ( in the very beginning, i was thinking of something like
> this... )

And what was your conclusion, if any?

--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<ce746876-969e-446b-bf35-35196a216f95n@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=556&group=rec.puzzles#556

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:6214:518c:b0:4b1:88f8:b6a4 with SMTP id kl12-20020a056214518c00b004b188f8b6a4mr2030509qvb.0.1665092955862;
Thu, 06 Oct 2022 14:49:15 -0700 (PDT)
X-Received: by 2002:a05:6871:a6:b0:12b:8d8d:d7b with SMTP id
u38-20020a05687100a600b0012b8d8d0d7bmr6578367oaa.197.1665092955636; Thu, 06
Oct 2022 14:49:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Thu, 6 Oct 2022 14:49:15 -0700 (PDT)
In-Reply-To: <20221007002827.05ba1df6a89075223d5c5701@gmail.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:2760:0:0:0:8a85;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:2760:0:0:0:8a85
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<20220923013414.245585d519f6a76f5cbc8f4a@gmail.com> <8a8d31eb-03a4-4bf9-8c7a-49b89249d4a4n@googlegroups.com>
<20221007002827.05ba1df6a89075223d5c5701@gmail.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ce746876-969e-446b-bf35-35196a216f95n@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Thu, 06 Oct 2022 21:49:15 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2573
 by: henh...@gmail.com - Thu, 6 Oct 2022 21:49 UTC

On Thursday, October 6, 2022 at 2:28:32 PM UTC-7, Anton Shepelev wrote:
> henh... to Anton Shepelev:
> > > Instead of simulation, you can compute the exact value.
> > > Observe that allocations of p people in r rooms can be
> > > expressed as the expanded terms of a multinomial of
> > > power p with r terms. For example:
> > > [...]
> > > This is regular and easily computable by sequential
> > > generation of the terms and their corresponding
> > > multinomial coefficient.

> > can we get the fraction (expected value) for 10 ppl in 10
> > rooms this way ?

> State your doubts, if any. I say we can, and my C program
> reports:
>
> 1168918030 / 424490995 ~= 2.753693
>
> Now, what is your result, if any?

on Sept 15, i posted (in this thread) ...

6 --------------- 2.408179012345679

8 -------------- 2.5972328186035156

10 ------------- 2.74868911 (exact number) ----

(very early on) i think i deicided to go a diff. way... which is faster.

----------- i'm still wondering if there's a Really Fast way (algorithm) to compute these fractions.

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<20221008031830.252918657df0bbf2989ee899@gmail.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=557&group=rec.puzzles#557

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: anton....@gmail.com (Anton Shepelev)
Newsgroups: rec.puzzles
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Date: Sat, 8 Oct 2022 03:18:30 +0300
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <20221008031830.252918657df0bbf2989ee899@gmail.com>
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<20220923013414.245585d519f6a76f5cbc8f4a@gmail.com>
<8a8d31eb-03a4-4bf9-8c7a-49b89249d4a4n@googlegroups.com>
<20221007002827.05ba1df6a89075223d5c5701@gmail.com>
<ce746876-969e-446b-bf35-35196a216f95n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="f9883dba2f587d38ae5fe54431101c76";
logging-data="4151870"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e+hXUCVRD+2VAubPFmyN5kdQ473P8fbo="
Cancel-Lock: sha1:cLhFmAeYES6L9I7pXZEQYxmXgiQ=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
 by: Anton Shepelev - Sat, 8 Oct 2022 00:18 UTC

Anton Shepelev to henh...:

> > can we get the fraction (expected value) for 10 ppl in
> > 10 rooms this way ?
>
> State your doubts, if any. I say we can, and my C program
> reports:
>
> 1168918030 / 424490995 ~= 2.753693
>

Thanks to the analytic values by Ilan Mayer, I have found an
error in my program and fixed it. My corrected analytic
values for n people in n rooms are:

1: 1 / 1 = 1.000000000000000
2: 6 / 4 = 1.500000000000000
3: 51 / 27 ~ 1.888888888888889
4: 544 / 256 = 2.125000000000000
5: 7145 / 3125 = 2.286400000000000
6: 112356 / 46656 ~ 2.408179012345679
7: 2066323 / 823543 ~ 2.509065100425843
8: 43574336 / 16777216 ~ 2.597232818603516
9: 1036922769 / 387420489 ~ 2.676478912296247
10: 27486891100 / 10000000000 = 2.748689110000000
11: 803137535321 / 285311670611 ~ 2.814948065745319
12: 25642631336400 / 8916100448256 ~ 2.875991750565768
13: 888148407804853 / 302875106592253 ~ 2.932391564951315
14: 33165208812574216 / 11112006825558016 ~ 2.984628189418768

That is the precision limit of my C program. Futher values
are approximate:

15: 3.033122027793592
16: 3.078246797314360
17: 3.120336673764227
18: 3.159690951821744
19: 3.196575256074798
20: 3.231235911954644
21: 3.263840995156228
22: 3.294677258703217
23: 3.323501424317847
24: 3.351204745044710
25: 3.375940763093699
26: 3.400997883301979
27: 3.420098995014796
28: 3.442852016690488
29: 3.453774951545424
30: 3.474683387544387
31: 3.476040838397223

Perhaps a big-number library or more accurate implementation
could help...

My program confirms your "exact value" for 10-by-10. How
did *you* calculate it? Have you published your solution?

--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<20221012030243.3cdcbcae97eff8b48a601365@gmail.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=562&group=rec.puzzles#562

  copy link   Newsgroups: rec.puzzles
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: anton....@gmail.com (Anton Shepelev)
Newsgroups: rec.puzzles
Subject: Re: the Most crowded room --- (expected # of max. Birthday
collisions)
Date: Wed, 12 Oct 2022 03:02:43 +0300
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <20221012030243.3cdcbcae97eff8b48a601365@gmail.com>
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<8813aafe-ac2e-4038-8fc1-72f7b4cbf114n@googlegroups.com>
<456f3bf8-3b8b-46cd-92a2-868bd4383a0bn@googlegroups.com>
<709ad694-b5c4-4d9d-891c-d4f804afdc08n@googlegroups.com>
<26fc1925-6cb1-4efc-9c26-b3ae39e5d26bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="3ec5eff5b8d8b30941c8008e3bc5dde2";
logging-data="1283470"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tOYy+GTre4rbiTDZBhYHA65MSkFVWhYo="
Cancel-Lock: sha1:6pxJ/9wlQGPCRueUVTzmSL+9UFI=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
 by: Anton Shepelev - Wed, 12 Oct 2022 00:02 UTC

henh...:

> where N= number of people/rooms the relevant numbers
> (we're concerned about) grows proportional to N^N

N^N is the total number of terms in the expansion of:

(a_1 + ... + a_n)^n

But if you group compatible terms there will remain much
fewer summands, and then if you group terms with identical
power-sets (e.b. a^2 b and a b^2) the total number of unique
summands will futher decrease and become equal to the number
of partitions (OEIS A000041). The performance of my program
is roughly proportional to that number, but in fact a bit
worse because as the sheer numbers increase the calculation
of factorial ratios becomes harder. In the following table,
`n' is the number of rooms and people, `s' the number of
summands, `ms' calculation time in milliseconds, and `res'
the calculated answer:

n s ms s/ms res

1 1 0 0 1.000000
2 2 0 0 1.500000
3 3 0 0 1.888889
4 5 0 0 2.125000
5 7 0 0 2.286400
6 11 0 0 2.408179
7 15 0 0 2.509065
8 22 0 0 2.597233
9 30 0 0 2.676479
10 42 0 0 2.748689
......................................
30 5604 15 373 3.492990
31 6842 32 213 3.513329
32 8349 31 269 3.532941
33 10143 47 215 3.551881
34 12310 47 261 3.570201
35 14883 62 240 3.587945
36 17977 78 230 3.605155
37 21637 94 230 3.621868
38 26015 125 208 3.638117
39 31185 141 221 3.653932
40 37338 171 218 3.669340
41 44583 204 218 3.684366
42 53174 250 212 3.699032
43 63261 328 192 3.713357
44 75175 375 200 3.727360
45 89134 453 196 3.741058
46 105558 562 187 3.754466
47 124754 641 194 3.767597
48 147273 734 200 3.780465
49 173525 907 191 3.793081
50 204226 1062 192 3.805455
51 239943 1313 182 3.817597
52 281589 1578 178 3.829517
53 329931 1797 183 3.841223
54 386155 2125 181 3.852722
55 451276 2500 180 3.864022
56 526823 2921 180 3.875129
57 614154 3500 175 3.886051
58 715220 4094 174 3.896791
59 831820 4750 175 3.907358
60 966467 5547 174 3.917754
61 1121505 6547 171 3.927986
62 1300156 7719 168 3.938057
63 1505499 9609 156 3.947973
64 1741630 10891 159 3.957737
65 2012558 12500 161 3.967353
66 2323520 15187 152 3.976826
67 2679689 16625 161 3.986158
68 3087735 19235 160 3.995353
69 3554345 22484 158 4.004414
70 4087968 25953 157 4.013345
......................................
99 169229875 1321266 128 4.226524
100 190569292 1502828 126 4.232595

I wonder what is the sequence and formula for the number
of summands when the number of people is not equal to the
number of rooms...

--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments

Re: the Most crowded room --- (expected # of max. Birthday collisions)

<4e3719c0-a1c7-4047-a83e-dc0e545db5cbn@googlegroups.com>

  copy mid

https://novabbs.com/interests/article-flat.php?id=563&group=rec.puzzles#563

  copy link   Newsgroups: rec.puzzles
X-Received: by 2002:a05:620a:2844:b0:6b8:5f52:a6b5 with SMTP id h4-20020a05620a284400b006b85f52a6b5mr22511146qkp.351.1665620953632;
Wed, 12 Oct 2022 17:29:13 -0700 (PDT)
X-Received: by 2002:a4a:edc5:0:b0:480:88b6:4b9c with SMTP id
m5-20020a4aedc5000000b0048088b64b9cmr3425558ooh.54.1665620953384; Wed, 12 Oct
2022 17:29:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: rec.puzzles
Date: Wed, 12 Oct 2022 17:29:13 -0700 (PDT)
In-Reply-To: <20221008031830.252918657df0bbf2989ee899@gmail.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8601:23e0:0:0:0:26a0;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8601:23e0:0:0:0:26a0
References: <adc84fe6-eb0e-4e53-a6ea-9220c40d35e4n@googlegroups.com>
<20220923013414.245585d519f6a76f5cbc8f4a@gmail.com> <8a8d31eb-03a4-4bf9-8c7a-49b89249d4a4n@googlegroups.com>
<20221007002827.05ba1df6a89075223d5c5701@gmail.com> <ce746876-969e-446b-bf35-35196a216f95n@googlegroups.com>
<20221008031830.252918657df0bbf2989ee899@gmail.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4e3719c0-a1c7-4047-a83e-dc0e545db5cbn@googlegroups.com>
Subject: Re: the Most crowded room --- (expected # of max. Birthday collisions)
From: henha...@gmail.com (henh...@gmail.com)
Injection-Date: Thu, 13 Oct 2022 00:29:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3104
 by: henh...@gmail.com - Thu, 13 Oct 2022 00:29 UTC

On Friday, October 7, 2022 at 5:18:33 PM UTC-7, Anton Shepelev wrote:
> Anton Shepelev to henh...:
> > > can we get the fraction (expected value) for 10 ppl in
> > > 10 rooms this way ?
> >
> > State your doubts, if any. I say we can, and my C program
> > reports:
> >
> > 1168918030 / 424490995 ~= 2.753693
> >
> Thanks to the analytic values by Ilan Mayer, I have found an
> error in my program and fixed it. My corrected analytic
> values for n people in n rooms are:
>
> 1: 1 / 1 = 1.000000000000000
> 2: 6 / 4 = 1.500000000000000
> 3: 51 / 27 ~ 1.888888888888889
> 4: 544 / 256 = 2.125000000000000
> 5: 7145 / 3125 = 2.286400000000000
> 6: 112356 / 46656 ~ 2.408179012345679
> 7: 2066323 / 823543 ~ 2.509065100425843
> 8: 43574336 / 16777216 ~ 2.597232818603516
> 9: 1036922769 / 387420489 ~ 2.676478912296247
> 10: 27486891100 / 10000000000 = 2.748689110000000
> 11: 803137535321 / 285311670611 ~ 2.814948065745319
> 12: 25642631336400 / 8916100448256 ~ 2.875991750565768
> 13: 888148407804853 / 302875106592253 ~ 2.932391564951315
> 14: 33165208812574216 / 11112006825558016 ~ 2.984628189418768
>
> That is the precision limit of my C program. Futher values
> are approximate:
>
> 15: 3.033122027793592

thank you....

Pascal+ triangle+ (or Pyramid) for 3 rooms (or 3 variables X,Y,Z) (or trinomials (?)) looks nice.

building up a Pascal+ triangle+ from (1, 1, 1, ..., 1) (100 One's)
-- maybe this is a better way -- i'll think about it.

(The way i was doing it, (i think) it'd been hard to get Approximate values)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor