Post
Topic
Board Beginners & Help
Topic OP
50%-50% probablity calculation
by
davidshrugged
on 23/02/2013, 04:28:12 UTC
My first post  Grin!!!!

We just released a flipping coin game for bitcoins [our twist: with chained flips] http://www.mangofuzz.com/ and we are using the following method to simulate the 50&-50% chance of tossing a coin.

In C++ we :
  • seed it with the current time stamp
  • get a number between 0 and 1 like this: rand()/((double)RAND_MAX + 1

If such number is less than 0.5, the user wins.

We will use R instead of C in the next incarnation.

Thoughts on this simple approach?