In article <[EMAIL PROTECTED]>,
        "J. Riley Bryant" <[EMAIL PROTECTED]> writes:
> Probability = PR(1,8,(1-(n!-1)/n!)^1e6)
> 
> = (1-(0/1)^1e6) *
>   (1-(1/2)^1e6) *
>   (1-(5/6)^1e6) *
>   (1-(23/24)^1e6) *
>   (1-(119/120)^1e6) *
>   (1-(719/720)^1e6) *
>   (1-(5039/5040)^1e6) *
>   (1-(40319/40320)^1e6)
> 
> And herein lies my problem. I have yet to find a
> calculator which is capable of handling any of
> the above given calculations (with the exception
> of the first and last two expressions. (in fact on
> a certain TI calculator all expressions evaluate
> to 1!)

lim n-> inf  of (1+1/n)**n = e
so (1+1/n)**m = (1+1/n)**n**(m/n) ~ e**(m/n)

This approximation is very good very soon.
   perl -wle 'print +(1+1/1000)**2000'
   7.381675653556145
versus:
   perl -wle 'print exp 2'
   7.38905609893065023

I don't trust your formula by the way.

> 
> Now the pertinent question:
> 
> Does a solution with this probability *really* violate rule #3?
> I would wager that it's more likely that our "perfect" computer
> would get struck by lightening than our output not being correct.
> And what if we were able to generate permutations 1e100 times?
> 
Yes, it violates rule 3. Rejecting this kind of programs is the
actual reason why rule 3 exists.

The "perfect computer" was introduced so that extremely long running
programs don't have to worry about hardware failures.

But "always" was written there EXACTLY so that random based programs
always MUST give the right solution, they are not allowed to fail
extremely rarely.

Also notice that rule 2 speaks about *average* runtimes, again because
of programs using rand().

Reply via email to