Author

Topic: SatoshiDICE.com - The World's Most Popular Bitcoin Game - page 244. (Read 495688 times)

hero member
Activity: 566
Merit: 500
http://satoshidice.com/full.php?tx=d582ff596e5768b817542ca95b9968a10f9ba9b8e0b18c32807843a993328e78

What's up with this? I win, but win less than I put in? Check the math on this one... lol

EDIT:

doh! stupid tx fee on the return...
sr. member
Activity: 364
Merit: 252
I hope we are not derailing satoshidice's thread here Tongue
for a table containing 65 numbers I would use FF not FFFF Wink

I will pm dooglus and discuss further.
Dooglus you are welcome to share anything technical I discuss with you in PM - I just dont want to spam the SD thread to much Wink
legendary
Activity: 2940
Merit: 1333
Even with this updated code as fireduck pointed out some numbers have a slightly higher distribution (1 more than those that do not for every 65535). Which results in some numbers having a 0.02% edge over others.

Wouldn't the edge then be 1/65535 (or 1/65536, but it makes little difference for this calculation), which is 0.000015 or 0.0015%?
legendary
Activity: 2940
Merit: 1333
   $number = int(( (($number - 1) / 65535) * 38) + 1);

If I cannot resolve this satisfactorily I will build a new roulette table that has 65 numbers (FF).

You're still dividing by 65535.  That's still wrong.

And 65 doesn't divide into 65536 any better than 38 does.  You need powers of 2.  May I suggest 32.  Or 64.
sr. member
Activity: 364
Merit: 252
Code:
sub get_result
{
my $tx = shift;
my $number = Digest::SHA::hmac_sha512_hex($tx, $main::secret);
$number =~ s/^(.{4}).*$/$1/;
$number = hex($number);

#$number = int((($number / 65535) * 38) + 1);
$number = int(( (($number - 1) / 65535) * 38) + 1);

#print "lucky number: $number\n";

return $number;
}

Seems to result in a very fair distribution for odd/even red/black 18-19/19-36 1st/2nd/3rd col and 1st,2nd,3rd group of 12.

Even with this updated code as fireduck pointed out some numbers have a slightly higher distribution (1 more than those that do not for every 65535). Which results in some numbers having a 0.02% edge over others.
It seems to be negated by using a hash when I run my simulations.

If I cannot resolve this satisfactorily I will build a new roulette table that has 65 numbers (FF).

Thanks for the helpful discussion everyone Smiley
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
$number = int(1+(($number / 65535) * 38));

if $number is 65535 then the result of the above is 39.  37 and 38 are 0 and 00.  What's 39?

You should divide by 65536, not 65535.

Better would be a simple: $number = ($number % 38) + 1

You still have 1724/65536 chance of getting some numbers and 1725/65536 chance of getting others, but there's not much difference between the two.
... i.e. still not correct ...
legendary
Activity: 2940
Merit: 1333
$number = int(1+(($number / 65535) * 38));

if $number is 65535 then the result of the above is 39.  37 and 38 are 0 and 00.  What's 39?

You should divide by 65536, not 65535.

Better would be a simple: $number = ($number % 38) + 1

You still have 1724/65536 chance of getting some numbers and 1725/65536 chance of getting others, but there's not much difference between the two.
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
Id like to thank satoshidice for being the direct inspiration of my site: http://satoshiroulette.com/

I unashamedly admit I did my best to clone their payout system as I think it could revolutionize gambling.
That is cool, roulette was always my favorite game in casinos.  I liked not having to talk to the croupier about anything and being able to pick the odds and payout by choosing different positions on the board.

Also, I need 0-00.

Reading your FAQ, are you absolutely certain that this is evenly distributed?

# convert 0-65535 to 1-38
$number = int(1+(($number / 65535) * 38));

Since 65536 is not evenly divisible by 38, it is impossible for your distribution of ball landings to be even.

I recommend reading and understanding the implementation of a good random int function.  Example:
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)

The math is kinda strange, but it is absolutely crucial for what you are doing.  Good luck!


thanks and a good catch, Id tip you bit I feel I have already tipped satoshidice heavily.

The FAQ is also a test, the simulation results did show a fairly even distribution but I need to get a larger sample size (currently only ~30k).
I shall return to running further simulations Smiley
It's simply a case of end conditions making certain bets have a better edge since they are more likely due to modular arithmetic when the modulo number is not a factor of the whole number (in this case 65536)
sr. member
Activity: 392
Merit: 251

thanks and a good catch, Id tip you bit I feel I have already tipped satoshidice heavily.

The FAQ is also a test, the simulation results did show a fairly even distribution but I need to get a larger sample size (currently only ~30k).
I shall return to running further simulations Smiley

In this case, as only 0-65535 are allowed values you don't need to sample, just use each possible input number once and see if the output numbers are all exactly even.
sr. member
Activity: 364
Merit: 252
Id like to thank satoshidice for being the direct inspiration of my site: http://satoshiroulette.com/

I unashamedly admit I did my best to clone their payout system as I think it could revolutionize gambling.
That is cool, roulette was always my favorite game in casinos.  I liked not having to talk to the croupier about anything and being able to pick the odds and payout by choosing different positions on the board.

Also, I need 0-00.

Reading your FAQ, are you absolutely certain that this is evenly distributed?

# convert 0-65535 to 1-38
$number = int(1+(($number / 65535) * 38));

Since 65536 is not evenly divisible by 38, it is impossible for your distribution of ball landings to be even.

I recommend reading and understanding the implementation of a good random int function.  Example:
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)

The math is kinda strange, but it is absolutely crucial for what you are doing.  Good luck!


thanks and a good catch, Id tip you bit I feel I have already tipped satoshidice heavily.

The FAQ is also a test, the simulation results did show a fairly even distribution but I need to get a larger sample size (currently only ~30k).
I shall return to running further simulations Smiley
sr. member
Activity: 392
Merit: 251
Id like to thank satoshidice for being the direct inspiration of my site: http://satoshiroulette.com/

I unashamedly admit I did my best to clone their payout system as I think it could revolutionize gambling.
That is cool, roulette was always my favorite game in casinos.  I liked not having to talk to the croupier about anything and being able to pick the odds and payout by choosing different positions on the board.

Also, I need 0-00.

Reading your FAQ, are you absolutely certain that this is evenly distributed?

# convert 0-65535 to 1-38
$number = int(1+(($number / 65535) * 38));

Since 65536 is not evenly divisible by 38, it is impossible for your distribution of ball landings to be even.

I recommend reading and understanding the implementation of a good random int function.  Example:
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)

The math is kinda strange, but it is absolutely crucial for what you are doing.  Good luck!
sr. member
Activity: 364
Merit: 252
Id like to thank satoshidice for being the direct inspiration of my site: http://satoshiroulette.com/

I unashamedly admit I did my best to clone their payout system as I think it could revolutionize gambling.
sr. member
Activity: 392
Merit: 251
donator
Activity: 2058
Merit: 1007
Poor impulse control.
now that there have been three quarter million bets, i would be curious to see the a chart of the results of the distribution of lucky numbers,

are there any ranges that have been beating the odds?

The cumulative probability distribution table you want is here: https://bitcointalksearch.org/topic/m.1047760
legendary
Activity: 2940
Merit: 1333
I had the same problem with gox, but I was using the android wallet app and copied the wrong address.

lost 2btc

If you lost the 2 btc because you won the bet but Gox didn't credit it to your account, you'll probably find that they'll credit it back to you eventually.

If you lost it because your SatoshiDice bet lost, then I would guess you're out of luck.
hero member
Activity: 695
Merit: 502
PGP: 6EBEBCE1E0507C38
I have a situation,

I accidentally withdrew some funds directly from my mtgox account to a satoshi dice game, funnily the bet won and the funds were sent from satoshi to the originating address. I have been in touch with MTGOX and they claim that the address that my withdrawal request was paid from was not one from mtgox's wallet. I find it hard to understand how that is possible. And so now they claim the coins that were returned is not in their possession. Is that possible ? What are your views guys ?

I had the same problem with gox, but I was using the android wallet app and copied the wrong address.

lost 2btc
legendary
Activity: 2940
Merit: 1333
now that there have been three quarter million bets, i would be curious to see the a chart of the results of the distribution of lucky numbers,

are there any ranges that have been beating the odds?

https://bitcointalksearch.org/topic/m.1047173 has a table of the results so far.  If you compare the 'should win' column with the number in brackets in the 'win' column you'll see that lots of the bets have been beating the odds.

For example, you would only expect "lessthan 64" bets to win 1 in 1024 bets, but of 5178 bets so far, 7 have won.  We would expect only 5 to have won so far.  Despite this, "lessthan 64" is currently the most profitable bet for the house, relative to the amount bet on it (other than the ones which nobody has won yet, i.e. lessthan 16, 8, 4, 2, and 1).  It has only paid back 58.146% of payments received.  It must be that the losing bets were on average bigger than the winning ones.

The 3 new bets are performing badly for players, all giving back less that expected.  Particularly the "lessthan 56000" bet, which should pay out 85.449% of the time, but so far in 99 bets has only paid out 76.768% of the time, resulting in an effective 25 house edge!  "lessthan 52000" has actually paid out more often than lessthan 56000", despite being easier to win.

But I don't have a distribution chart.  I'd have to make a web query for every bet to get that since the lucky number doesn't get into the blockchain.
legendary
Activity: 1008
Merit: 1023
Democracy is the original 51% attack
perhaps here is as good a place as any to warn people about the fake site, satoshidice.net  <-- don't send your coins here


Yeah thanks Payb.tc.   SatoshiDice.NET is a scam site. Make sure to only use SatoshiDice.com
hero member
Activity: 812
Merit: 1000
perhaps here is as good a place as any to warn people about the fake site, satoshidice.net  <-- don't send your coins here
legendary
Activity: 873
Merit: 1000
now that there have been three quarter million bets, i would be curious to see the a chart of the results of the distribution of lucky numbers,

are there any ranges that have been beating the odds?
Jump to: