Author

Topic: 50%-50% probablity calculation (Read 513 times)

newbie
Activity: 7
Merit: 0
February 23, 2013, 01:17:51 AM
#2
The gold standard in Bitcoin is provably secure randomness, such as what SatoshiDice does. They generate a list of secret keys, one for each day, and publish the hashes ahead of time. They then use that secret to determine your random number, and they publish the plaintext secrets for previous days after the fact so that results can be verified.
newbie
Activity: 11
Merit: 0
February 22, 2013, 11:28:12 PM
#1
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?
Jump to: