Re: A simple dice rolling problem




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.

.



Relevant Pages

  • Re: Precision of Calculations
    ... As you have noticed Excel handles only 15 digits of precision. ... the spreadsheet calculates a probability>>using the following formula >>=1-NORMSDISTThis produces a number in cell H17. ...
    (microsoft.public.excel.misc)
  • Re: What is the probability of this?
    ... If you start adding the digits of your cellphone number, ... There is another approximative procedure to estimate the probability ... the sum of 11 random digits looks ... That makes a normal distribution with mean 49.5 ...
    (sci.stat.math)
  • Re: Probability in an infinite sample space
    ... I do NOT claim to have a way of generating a uniform distribution over N, ... I DO claim that I have a uniform distribution over terminating decimals, ... as only the first digits in the ... probability zero, but is not impossible. ...
    (sci.math)
  • Re: What is the probability of this?
    ... What is the probability of these three sets of 11 random numbers all equalling 49??? ... If you start adding the digits of your cellphone number, ... the sum of 11 random digits looks ... That makes a normal distribution with mean 49.5 ...
    (sci.stat.math)
  • Re: fair coin (randomness definition) question
    ... amount of fluctuations or an abnormal one. ... correct distribution of fluctuations from probability theory. ... so just one p-value of 0.995 isn't too surprising. ... with the decimal digits of sqrt, ...
    (sci.math)