POV-Ray : Newsgroups : povray.off-topic : Coin game : Re: Coin game Server Time
6 Sep 2024 17:23:58 EDT (-0400)
  Re: Coin game  
From: Warp
Date: 8 Jan 2009 11:28:02
Message: <49662992@news.povray.org>
scott <sco### [at] scottcom> wrote:
> >> I simulated this game in C++ and after 1e6 goes the average win-per-go 
> >> settles down quite nicely to $8.09 and stays there up to 1e8 goes.
> > 
> >  How did you implement it? What type of integers did you use to count the
> > amount of money? (Note that a 32-bit integer will overflow after only 32
> > tosses of the coin, which is perfectly within the realm of possibility.)

> I used 32bit and then 64bit integers, but the result was the same.

  Did you at least put an assert() to check that no more than 31 (or 63)
tosses were ever made?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.