m=: 3 : '+/1+#&>(f t){.t=. part 2e4'"0 i.5e4
<./m
6697
>./m
15689
(+/%#) m
10414.7
I am curious about how you did your simulation. What language? How much
code?
On Tue, Sep 11, 2012 at 9:38 AM, Pierpaolo Bernardi <[email protected]>wrote:
> On Tue, Sep 11, 2012 at 6:31 PM, Jordan Tirrell <[email protected]>
> wrote:
> > So after looking back at my computation, I noticed that I had forgotten a
> > final step: dividing by 100. Now it looks like we're all in the 1e4
> > ballpark.
> >
> > My computation is pretty short to write, but it will be hard to
> understand
> > if you aren't familiar with generating functions.
> >
> > G=: (1+i.99)&(*/@:((**:)%(1-99*])*1-*))
> > (*(G D. 1)) %100
> > 10423.2
> >
> > Pierpaolo's estimate is incredibly close to my computation.
>
> 8^)
>
> Here's what I get with my simulation (alas, not written in J):
>
> > (test 100 ; number of prisoners
> 10000 ; number of experiments
> )
>
> 10418.0462 ; average number of days
> 7222.0 ; minimum number of days occurred
> 14522.0 ; maximum = = = =
>
>
> Cheers
> P.
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm