Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: What is the probability that random integers sum to a given value?
Date: Wed, 1 Jul 2009 11:16:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 27
Message-ID: <h2fghh$n6c$1@fred.mathworks.com>
References: <h2de1d$sgb$1@fred.mathworks.com> <h2dvi2$sn3$1@fred.mathworks.com> <h2e02t$4bt$1@fred.mathworks.com> <h2e16h$hfr$1@fred.mathworks.com> <h2eur9$db8$1@fred.mathworks.com> <h2f1l9$4fo$1@fred.mathworks.com> <h2f4om$s57$1@fred.mathworks.com> <h2f5s9$bnl$1@fred.mathworks.com> <p5G2m.8$AX1.0@newsfe20.ams2> <h2fdpe$ed9$1@fred.mathworks.com> <h2ffc1$1t0$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246446961 23756 172.30.248.38 (1 Jul 2009 11:16:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 1 Jul 2009 11:16:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:551950


"David Heslop" <david_heslop@xyz.com> wrote in message <h2ffc1$1t0$1@fred.mathworks.com>...
> Dear All,
> It is an interesting point that the replacement will have little effect given a large enough value of N. As Tristram mentioned the main influence will be in the tails of the distribution, unfortunately the tails are the most important issue for me because I&#8217;m trying to determine critical values for a statistical test. It may be that overall the solutions you have offered are still an improvement over a MC derived distribution which respects the replacement issue.
> Thanks for your help,
> Dave

I'll claim that for a population of 500, with samples
of size 50 taken without replacement, that the
normal approximation will be far better than
Monte Carlo, even if you look into the tails of
the distribution. 

How many hits do we expect to see if we sample
with replacement?

X = sort(ceil(rand(100000,50)*500),2);

mean(sum(diff(X,[],2)==0,2))
ans =
       2.3659

Given that the exact distribution will be quite
difficult to compute for the case without
replacement, I'd be strongly tempted to use the
central limit theorem here.

John