Author

Topic: Satoshi Dice - need some explanations (Read 1072 times)

member
Activity: 105
Merit: 10
February 07, 2013, 09:02:05 AM
#13
In fact the problem is here
Code:
self.df['BalanceVar'] = np.where(self.df['TossResults']>0, self.df['Size']*price_multiplier, -self.df['Size']+0.005 * self.df['Size'])

I should be :
Code:
self.df['BalanceVar'] = np.where(self.df['TossResults']>0, self.df['Size']*(price_multiplier-1), -self.df['Size']+0.005 * self.df['Size'])

Because if you bet 1BTC and win you will earn 8 BTC (price_multiplier*size)
but you ever spend 1BTC so balance variation is 7 BTC !!!

That's why there is a price_multiplier-1

I tried it with very big tosses number 65536*500=32'768'000 and calculated experimental house_percent
and it was very close from 1.9%

so that's ok !

Code is here http://pastebin.com/LvCU1gag
member
Activity: 105
Merit: 10
February 07, 2013, 08:09:54 AM
#12
I think I'm still wrong

see
http://pastebin.com/pyDB3wiN

I changed
Code:
self.df['BalanceVar'] = np.where(self.df['TossResults']>0, self.df['Size']*price_multiplier, -self.df['Size'])
for
Code:
self.df['BalanceVar'] = np.where(self.df['TossResults']>0, self.df['Size']*price_multiplier, -self.df['Size']+0.005 * self.df['Size'])
But I don't understand why... but after 60000 tosses I always win (around 60BTC) !

I probably did a mistake... but I don't know what mistake I did !!!

Any help is welcome (you will need Python 2.7, Numpy and Pandas)
member
Activity: 105
Merit: 10
February 07, 2013, 07:24:27 AM
#11
Thanks a lot for your explanations.
I will try to improve my script to reflect that.

I would like to try to make some martingale experiments (I know that it is a desperate and suicidal strategy
that's just for fun ;-) )
I would also like to try cautious technics such as Kelly criterion.

Anyway winner is always the casino ;-)
legendary
Activity: 3472
Merit: 4801
February 07, 2013, 03:18:45 AM
#10
. . . Satoshidice pays out losers too . . .

1. If you lose, your bet is returned times 0.005 (0.5% for losers) . . .
Ah ha! I hadn't realized that they ever paid more than 0.00000001 on a loser.  Now the math works out.

Play 1 BTC 65536 times.  Assume that each possible value comes up once.
Total bets = 65,536 * 1 BTC = 65,536 BTC in bets placed.
8,000 wins = 8,000 * 8 * 1 = 64,000 BTC returned on winning bets
57,536 losses = 57,536 * 0.005 * 1 = 287.68 BTC returned on losing bets
65,536 BTC received - (64,000 BTC + 287.68 BTC) paid = 1,248.32 BTC in profits for "the house"

8,000 wins / 65,536 plays = 12.2070% Win Odds
Satoshi Dice advertises 12.2070% Win Odds, so this looks good

1248.32 BTC / 65,536 BTC = house edge of 1.9048%
Satoshi Dice advertises 1.9% House Percent, so this looks good too.
legendary
Activity: 1512
Merit: 1036
February 07, 2013, 02:45:15 AM
#9
Expected income IS negative
it MUST BE negative
otherwise the casino always ends up close !
that's why there is a "house_percent"

I'm not yet sure where my mistake is...

Satoshidice pays out losers too, and you pay the transaction fee back to yourself:

1. If you lose, your bet is returned times 0.005 (0.5% for losers)
2. On a win or a lose a transaction fee of 0.0005 is subtracted from the payment amount. If this makes the payment amount zero or less the payment is set to 0.00000001.

https://bitcointalksearch.org/topic/m.1022610
legendary
Activity: 3472
Merit: 4801
February 07, 2013, 01:01:14 AM
#8
Expected income IS negative
it MUST BE negative
otherwise the casino always ends up close !
that's why there is a "house_percent"

I'm not yet sure where my mistake is, but there has to be something wrong with my math. Here's whay I came up with looking at "lessthan 8000":

Play 0.01 BTC 65536 times.  Assume that each possible value comes up once.
Total bets = 65,536 * 0.01 BTC = 655.36 BTC in bets placed.
8,000 wins = 8,000 * 8 * 0.01 = 640 BTC in winnings
655.36 BTC - 640 BTC = 15.36 BTC in profits for "the house"

8,000 wins / 65,536 plays = 12.2070% Win Odds
Satoshi Dice advertises 12.2070% Win Odds, so this looks good

15.36 BTC / 655.36 BTC = house edge of 2.34%
Satoshi Dice advertises 1.9% House Percent, this is where I must be making a mistake.  My calculated house edge seems higher than the actual house edge.
member
Activity: 105
Merit: 10
February 07, 2013, 12:14:58 AM
#7
Expected income IS negative
it MUST BE negative
otherwise the casino always ends up close !
that's why there is a "house_percent"
newbie
Activity: 22
Merit: 0
February 06, 2013, 06:50:13 PM
#6
Why negative?

Your expected income needs to be positive. Your earnings will be negative (that's what you get if you do 0.01-0.0098)
member
Activity: 105
Merit: 10
February 06, 2013, 02:57:28 PM
#5
In fact my problem is mathematics...

Let's have a look at "less than 8000".

win odds = 8000/65535 = 12.2%
(and lose odds = 87.8%)

According to website multiplier is 8 and house percent is 1.9%

Let's imagine that I'm paying 0.1BTC for this game.

Expected value is :
0.1 * 8 * 12.2 + (-0.1) * 87.8

The problem with this formula is that I get a positive expected value
> 0.1*8*12.2/100-0.1*87.8/100
0.0098

I should get a negative value !
hero member
Activity: 504
Merit: 500
WTF???
February 06, 2013, 02:37:42 PM
#4
Because I did a mistake and when I click to alert moderator the forum says that I had to wait 360 seconds !

You can edit your post. They look identical just different subjects.

If you're just looking for the edge that the house maintains, they post that on their site http://satoshidice.com/

It is 1.9% with the exception of less than 1 which is 1.844, which no one has ever won.
member
Activity: 105
Merit: 10
February 06, 2013, 02:34:04 PM
#3
Because I did a mistake and when I click to alert moderator the forum says that I had to wait 360 seconds ! and after waiting I get this message
An Error Has Occurred!
You can't report your own post to the moderator, that doesn't make sense!
hero member
Activity: 504
Merit: 500
WTF???
February 06, 2013, 01:24:45 PM
#2
Why did you post the same thing twice?

https://bitcointalksearch.org/topic/--141588
member
Activity: 105
Merit: 10
February 06, 2013, 01:21:36 PM
#1
Hello,

I need some explanations about Satoshi Dice betting game.

I did a little Python script (with Numpy and Pandas) in order to test differents "strategies"
(I know it 's a negative expected value game so I don't expect a lot from this ;-) ).

see
http://pastebin.com/sMikS4xG

but I don't know what I should do with "house_percent" variable.

I think I did a mistake here :
Code:
self.df['BalanceVar'] = np.where(self.df['TossResults']>0, self.df['Size']*price_multiplier, -self.df['Size'])

but I don't know how this variable (house_percent) should intervene.

Kind regards
Jump to: