Bitcoin Forum
June 25, 2018, 02:09:15 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Satoshi Dice - need some explanations  (Read 979 times)
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 06, 2013, 06: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

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
1529935755
Hero Member
*
Offline Offline

Posts: 1529935755

View Profile Personal Message (Offline)

Ignore
1529935755
Reply with quote  #2

1529935755
Report to moderator
1529935755
Hero Member
*
Offline Offline

Posts: 1529935755

View Profile Personal Message (Offline)

Ignore
1529935755
Reply with quote  #2

1529935755
Report to moderator
1529935755
Hero Member
*
Offline Offline

Posts: 1529935755

View Profile Personal Message (Offline)

Ignore
1529935755
Reply with quote  #2

1529935755
Report to moderator
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529935755
Hero Member
*
Offline Offline

Posts: 1529935755

View Profile Personal Message (Offline)

Ignore
1529935755
Reply with quote  #2

1529935755
Report to moderator
wtfvanity
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500


WTF???


View Profile
February 06, 2013, 06:24:45 PM
 #2

Why did you post the same thing twice?

https://bitcointalk.org/index.php?topic=141588.msg1508155#msg1508155

          WTF!     Don't Click Here              
          .      .            .            .        .            .            .          .        .     .               .            .             .            .            .           .            .     .               .         .              .           .            .            .            .     .      .     .    .     .          .            .          .            .            .           .              .     .            .            .           .            .               .         .            .     .            .            .             .            .              .            .            .      .            .            .            .            .            .            .             .          .
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 06, 2013, 07: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!

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
wtfvanity
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500


WTF???


View Profile
February 06, 2013, 07: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.

          WTF!     Don't Click Here              
          .      .            .            .        .            .            .          .        .     .               .            .             .            .            .           .            .     .               .         .              .           .            .            .            .     .      .     .    .     .          .            .          .            .            .           .              .     .            .            .           .            .               .         .            .     .            .            .             .            .              .            .            .      .            .            .            .            .            .            .             .          .
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 06, 2013, 07: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 !

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
Envite
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
February 06, 2013, 11: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)
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 07, 2013, 05: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"

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1360



View Profile
February 07, 2013, 06: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.

deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1000



View Profile WWW
February 07, 2013, 07: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://bitcointalk.org/index.php?topic=80312.msg1022610#msg1022610
DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1360



View Profile
February 07, 2013, 08: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.

c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 07, 2013, 12:24:27 PM
 #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 ;-)

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 07, 2013, 01:09:54 PM
 #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)

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
February 07, 2013, 02:02:05 PM
 #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

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!