Re: Probability Problem

2006-04-25 Thread Tim Peters
[Elliot Temple] > I think I got it. I noticed my code is essentially the same as Tim > Peter's (plus the part of the problem he skipped). I read his code 20 > minutes before recreating mine from Alex's hints. Thanks! > > def main(): > ways = ways_to_roll() > total_ways = float(101**10) >

Re: Probability Problem

2006-04-25 Thread Peter Tillotson
I had a possibly similar problem calculating probs related to premium bond permutation. With 10^12 memory ran out v quickly. In the end I got round it by writing a recursive function and quantising the probability density function. Elliot Temple wrote: > Problem: Randomly generate 10 integers from

Re: Probability Problem

2006-04-25 Thread Elliot Temple
I think I got it. I noticed my code is essentially the same as Tim Peter's (plus the part of the problem he skipped). I read his code 20 minutes before recreating mine from Alex's hints. Thanks! def main(): ways = ways_to_roll() total_ways = float(101**10) running_total = 0

Re: Probability Problem

2006-04-24 Thread Tim Peters
[Alex Martelli] >> ... >> You can compute the requested answer exactly with no random number >> generation whatsoever: compute the probability of each result from >> 0 to 1000, then sum the probabilities of entries that are exactly 390 >> apart. [Elliot Temple] > That was the plan, but how do I ge

Re: Probability Problem

2006-04-24 Thread Alex Martelli
Elliot Temple <[EMAIL PROTECTED]> wrote: > On Apr 24, 2006, at 8:24 PM, Alex Martelli wrote: > > > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > > > >> In article <[EMAIL PROTECTED]>, > >> Elliot Temple <[EMAIL PROTECTED]> wrote: > >> > >>> Problem: Randomly generate 10 integers from 0-100 in

Re: Probability Problem

2006-04-24 Thread Elliot Temple
On Apr 24, 2006, at 8:24 PM, Alex Martelli wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >> In article <[EMAIL PROTECTED]>, >> Elliot Temple <[EMAIL PROTECTED]> wrote: >> >>> Problem: Randomly generate 10 integers from 0-100 inclusive, and sum >>> them. Do that twice. What is the pro

Re: Probability Problem

2006-04-24 Thread Alex Martelli
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Elliot Temple <[EMAIL PROTECTED]> wrote: > > >Problem: Randomly generate 10 integers from 0-100 inclusive, and sum > >them. Do that twice. What is the probability the two sums are 390 apart? > > I think the sum w

Re: Probability Problem

2006-04-24 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Elliot Temple <[EMAIL PROTECTED]> wrote: >Problem: Randomly generate 10 integers from 0-100 inclusive, and sum >them. Do that twice. What is the probability the two sums are 390 apart? I think the sum would come close to a normal distribution. -- http://mail.py