Re: A simple dice rolling problem
- From: "Reef Fish" <large_nassua_grouper@xxxxxxxxx>
- Date: 16 Aug 2006 15:46:32 -0700
Lou Thraki wrote:
Reef Fish wrote:
Lou Thraki wrote:
Reef Fish wrote:
Lou Thraki wrote:
Reef Fish wrote:
You have a fair die, with probability 1/6 of getting one of the spots 1
to 6.
What is the probability that you'll get 150 or less 6's in 1000 rolls ?
How would YOU find this probability?
So the problem you are heading at is to calculate
sum_{l=0}^{k} binom(n,l)*x^l*(1-x)^(n-l)
for large values of n and k (your example n=1000, k=150, x=1/6).
I'd introduce the numbers a[l]=(n-l)*x/l/(1-x) and calculate
y[k] = 1 + a[k]
y[k-1] = 1/y[k] + a[k-1]
y[k-2] = 1/y[k-1]/y[k] + a[k-2]
etc
Then
y[1]*y[2]*...*y[k] = 1 + a[1]*(1 + a[2]*(1 + ...*(1+a[k])...))
= sum_{l=0}^{k} binom(n,l)*x^l*(1-x)^(-l)
and the probability is given by
exp( n*log(1-x) + log(y[1]) + log(y[2]) + ... + log(y[k]) )
Something like that.
I know, but I was looking for a NUMBER for the probability. So, carry
on
with your "something like that" and show us the probability.
I made a mistake: you should use a(l)=(n-l+1)*x/l/(1-x)
I find 0.0836887473, didn't bother to check the precision.
Actually that's very good! The only correct answer, to all the
digits. :-)
But look how hard you had to work to get it.
When I posed the problem, it was immediately after I gave the
identity of a Binomial tail to the F-tail, just to see if anybody reads
it. :)
Using the identity, it would be F (.888235294; 1700, 302) and it is
.08368874727 which was what you had.
The "exact" cumulative sum (to 20 sig digits) is
.083688747270625217842.
If I change my "write(*,*)"-statement in "write(*,'(d24.16)')" in my
little fortran-program, I get 0.8368874727062917E-01
So 13 digits.
In double-precision arithmetic, and for the summation of that many
terms, that's about all the precision you're going to get, assuming you
enter the 1/6 as .1666666666666666 to as many digits you input
can accommodate.
Actually, the F formula is more bothersome in terms of roundoff. I
don't think many programs can calculate the F for this problem beyond
7 or 8 significant digits.
Thanks for playing the game. Perhaps you'll use the F next time.
For n and k too large the algorithm I came up with
will not be of practical use anymore of course.
I chose the n and k just large enough that most people can't do it
by hand or use any of the conventional Binomial tables. :-)
-- Reef Fish Bob.
.
- References:
- A simple dice rolling problem
- From: Reef Fish
- Re: A simple dice rolling problem
- From: Lou Thraki
- Re: A simple dice rolling problem
- From: Reef Fish
- Re: A simple dice rolling problem
- From: Lou Thraki
- Re: A simple dice rolling problem
- From: Reef Fish
- Re: A simple dice rolling problem
- From: Lou Thraki
- A simple dice rolling problem
- Prev by Date: Re: A simple dice rolling problem
- Next by Date: Re: A simple dice rolling problem
- Previous by thread: Re: A simple dice rolling problem
- Next by thread: Re: A simple dice rolling problem
- Index(es):
Relevant Pages
|