Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: RandomDirichlet? Date: Tue, 01 Nov 2011 20:23:28 -0400 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <6hrva7h1irrei62sm79ntmsr803c0np907@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 2 Nov 2011 00:26:43 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="f8igmItKsWs6nM5YanFxAA"; logging-data="15504"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/48wUzd7fLWZEZzZLilGbH" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <6hrva7h1irrei62sm79ntmsr803c0np907@4ax.com> Cancel-Lock: sha1:QyQHhc/0+7NoWXTJ42IvwX8EBaM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9350 On 11/1/2011 9:11 AM, Roedy Green wrote: > [...] > I would love to figure this out to create a recipe for arbitrary > distrtibutions for http://mindprod.com/jgloss/peudorandom.html The completely general approach is to find the cumulative distribution function F(x) = P(X < x), then find its inverse F[-1], then evaluate X = F[-1](R) for a uniformly distributed R. The rest is "just numerical analysis" ... > I have a vaguely related little problem in my todo list. > Canada has 308 members of parliament. If there were no bias toward > males or females, what could you say to a novice about how far from > 50/50 it could it stray and still be accounted for by random > variation, not bias? Presumably using the 19 times of 20 beloved of > pollsters. Google "chi-squared". -- Eric Sosman esosman@ieee-dot-org.invalid