Pages:
Author

Topic: Just-Dice.com : Invest in 1% House Edge Dice Game - page 67. (Read 435353 times)

newbie
Activity: 33
Merit: 0
Is there a mathematician in the house?

How do I analyse the odds of this strategy working?



He bets at 66%, which pays out 1.5x.  He starts at 0.06 BTC (this first bet is not shown in the screenshot), doubles on loss, halves on win, never halves below 0.06.

So it's a random walk, which makes a net profit of 0.03 BTC each time it gets back to betting 0.06.  Steps down are about twice as likely as steps up, so it seems unlikely to reach max bet and bust very quickly.

But the question is how do I calculate the probability of such a progression busting, given that he can afford to go N steps up the random walk?

Is it a Markov Chain thing?  Or how do I analyse it?

I can't analyze this but I can run a simulation.

My simulation:
  edge = 0.01
  probability of winning a bet = 0.66
  First Bet = 1.0
  startingBank = 100.0
  Goal = desiredBank / startingBank.

  Bet firstBet
  do
    If win bet max(previousBet/2, firstBet)
    If lose bet min(bank, previousBet*2.0)
  until Bank = goal * startingBank  or bank = 0.0.


The simulation calculates the results over 100,000 tries.  It shows the ratio of reaching the goal to losing the bank.

Goal      Wins ratio     Equivalent House Edge
1.01        0.988            0.0012
1.1          0.8904          0.0195
2.0          0.423            0.153

The house edge for a single bet is 0.01.
member
Activity: 100
Merit: 10
Vires in numeris.
One thing I was wondering, is how random is a hash which is generated? Has anyone compared the randomness of a hash to a random number generator?

Just been thinking about this in relation to just dice.

Phil

We looked at it a little and think it's OK. It failed a couple of the dieharder tests, but it remains to be seen whether that can be put to practical use (i.e. overcoming the 1% edge). I doubt it.

I also looked at it and also ran the dieharder testsuite. I only took the MSB of the HMAC-SHA512 output. With about 10 GB of data I had the OPSO on OQSO tests failing constantly while other tests only failed now and then. I reran it twice on a bigger chunk of data ~200 GB. During the first run it passed the complete suite.

Note that SD also uses HMAC-SHA512. I think more people have looked into this in depth. I haven't done any further investigation, but at the moment I feel that my investment is safe.
sr. member
Activity: 337
Merit: 252
The characteristic equation is simply something that follows from the recurrence equation when you assume a solution on the form x^k. Substitute x^k for P{k} and you get :
x^k=px^(k+1)+(1-p)x^(k-1). Dividing by x^(k-1) gives you the characteristic equation.

c and d are just some constants which are determined by the conditions P{1}=1 and P{-N}=0.

When p=0.5 you get a different solution since the characteristic equation has a double root at 1. The solution is then given by c+dk, for some constants c and d. Calculating c and d gives us P{k}=(N+k)/(N+1) and so P{0}=N/(N+1)
legendary
Activity: 2940
Merit: 1333
The characterisic equation x=px^2+(1-p) has solutions 1 and (1-p)/p (call it r), so then P{k}=c+dr^k=(r^(N+k)-1)/(r^(1+N)-1).

The answer is then given by  P{0}=(r^N-1)/(r^(1+N)-1)

That's great.  I'm going to have to read up on what "characteristic equation" means - I think I learned about it long ago.

Also, when p is 0.5, r is 1, and (r^(1+N)-1) is zero, causing a division by zero.  What are c and d?
sr. member
Activity: 337
Merit: 252
Is there a mathematician in the house?

How do I analyse the odds of this strategy working?



He bets at 66%, which pays out 1.5x.  He starts at 0.06 BTC (this first bet is not shown in the screenshot), doubles on loss, halves on win, never halves below 0.06.

So it's a random walk, which makes a net profit of 0.03 BTC each time it gets back to betting 0.06.  Steps down are about twice as likely as steps up, so it seems unlikely to reach max bet and bust very quickly.

But the question is how do I calculate the probability of such a progression busting, given that he can afford to go N steps up the random walk?

Is it a Markov Chain thing?  Or how do I analyse it?

I think you can solve it like this. Consider the number of times the bet has been doubled as a simple random walk starting at zero. If we reach 1 we win and if we reach -N we have busted. Let P{k} be the conditional probability of reaching 1, given that we start at k. Then P{k}=pP{k+1}+(1-p)P{k-1} and we know that P{1}=1 and P{-N}=0. p is the chance of winning each bet (=0.66)
The characterisic equation x=px^2+(1-p) has solutions 1 and (1-p)/p (call it r), so then P{k}=c+dr^k=(r^(N+k)-1)/(r^(1+N)-1).

The answer is then given by  P{0}=(r^N-1)/(r^(1+N)-1)
legendary
Activity: 2940
Merit: 1333
Great! I was fearing you were in the gambler's fallacy :-)

May I ask you why you are so interested in the busting probability of funny martingales?

You can ask, but I don't know what to tell you.

I'm interested in mathematics, and this seems like it should have a neat solution.

I don't know that you can call it a "martingale" by the way, since it doesn't reset on a win.
member
Activity: 99
Merit: 10
Is it somehow clear?

Yes, and it's simpler than that:  every bet has an expected return of 99%, so the sum of all bets has an expected return of 99%, however you bet.

It's easy enough to run a simulation and find an approximation for a particular p and N.  I'm looking for an analytical answer.

Great! I was fearing you were in the gambler's fallacy :-)

May I ask you why you are so interested in the busting probability of funny martingales?
legendary
Activity: 2940
Merit: 1333
I tried to explain to this gambler that Just-Dice is his best option.

Can someone help? He continues to think this other game where 33% pays out 2x is worth it...

https://bitcointalksearch.org/topic/china-making-bitcoins-for-the-world-347248

I don't think he thinks his game is worth it.  I think he's just trying to scam people.  Far too many alarm bells went off reading that post.

My reply:

https://bitcointalksearch.org/topic/m.3724240
legendary
Activity: 1176
Merit: 1015
I tried to explain to this gambler that Just-Dice is his best option.

Can someone help? He continues to think this other game where 33% pays out 2x is worth it...

https://bitcointalksearch.org/topic/china-making-bitcoins-for-the-world-347248
donator
Activity: 2058
Merit: 1007
Poor impulse control.
Shouldn't that be "add 1/p to x"? Otherwise you induce drift and the mean hitting time will no longer be infinite.

Nah, dooglus' model is a random walk starting at the origin where you step left (winning a bet) with probability 1-p and step right (losing a bet) with probability p. The walk ends if you end up 1 step left of the origin (= you won a roll at your base bet, at which point the strategy resets) or if you end up at N steps left of the origin (you've busted).


Shouldn't that be "add 1/p to x"? Otherwise you induce drift and the mean hitting time will no longer be infinite.

No, see https://bitcointalksearch.org/topic/m.3687257

I should have read your example a bit more closely. Anyway, I don't have an analytical solution, but there are examples online somewhere. It is a Markov chain thing.

You can use the inverse gaussian distribution make an continuous approximation model, which is what I've done when I've modelled "busting times" in the past - it agrees quite well with simulations.
legendary
Activity: 2940
Merit: 1333
Shouldn't that be "add 1/p to x"? Otherwise you induce drift and the mean hitting time will no longer be infinite.

No, see https://bitcointalksearch.org/topic/m.3687257
hero member
Activity: 728
Merit: 500
Is it somehow clear?

Yes, and it's simpler than that:  every bet has an expected return of 99%, so the sum of all bets has an expected return of 99%, however you bet.

I'm not suggesting that Rick has found a winning strategy; I don't believe there is one.

I was just asking whether anyone can find the probability of his strategy busting, given that he can afford to double N times.

To make it more abstract:

a. start with x=0
b. add 1 to x (with probability p) or subtract 1 from x (with probability (1-p))
c. if x is negative, stop - you've won
d. if x is N, stop - you've lost
e. go to b.

You will eventually stop at c. (won) or d. (lose).  What is the probability of stopping at d?  Show your working!

It's easy enough to run a simulation and find an approximation for a particular p and N.  I'm looking for an analytical answer.

Shouldn't that be "add 1/p to x"? Otherwise you induce drift and the mean hitting time will no longer be infinite.

Nah, dooglus' model is a random walk starting at the origin where you step left (winning a bet) with probability 1-p and step right (losing a bet) with probability p. The walk ends if you end up 1 step left of the origin (= you won a roll at your base bet, at which point the strategy resets) or if you end up at N steps left of the origin (you've busted).
donator
Activity: 2058
Merit: 1007
Poor impulse control.
Is it somehow clear?

Yes, and it's simpler than that:  every bet has an expected return of 99%, so the sum of all bets has an expected return of 99%, however you bet.

I'm not suggesting that Rick has found a winning strategy; I don't believe there is one.

I was just asking whether anyone can find the probability of his strategy busting, given that he can afford to double N times.

To make it more abstract:

a. start with x=0
b. add 1 to x (with probability p) or subtract 1 from x (with probability (1-p))
c. if x is negative, stop - you've won
d. if x is N, stop - you've lost
e. go to b.

You will eventually stop at c. (won) or d. (lose).  What is the probability of stopping at d?  Show your working!

It's easy enough to run a simulation and find an approximation for a particular p and N.  I'm looking for an analytical answer.

Shouldn't that be "add 1/p to x"? Otherwise you induce drift and the mean hitting time will no longer be infinite.
legendary
Activity: 2940
Merit: 1333
Is it somehow clear?

Yes, and it's simpler than that:  every bet has an expected return of 99%, so the sum of all bets has an expected return of 99%, however you bet.

I'm not suggesting that Rick has found a winning strategy; I don't believe there is one.

I was just asking whether anyone can find the probability of his strategy busting, given that he can afford to double N times.

To make it more abstract:

a. start with x=0
b. add 1 to x (with probability p) or subtract 1 from x (with probability (1-p))
c. if x is negative, stop - you've won
d. if x is N, stop - you've lost
e. go to b.

You will eventually stop at c. (won) or d. (lose).  What is the probability of stopping at d?  Show your working!

It's easy enough to run a simulation and find an approximation for a particular p and N.  I'm looking for an analytical answer.
member
Activity: 98
Merit: 10
nearly dead
We looked at it a little and think it's OK. It failed a couple of the dieharder tests, but it remains to be seen whether that can be put to practical use (i.e. overcoming the 1% edge). I doubt it.

If it fails some of the "tests" doesn't this mean you are uncovering a potential flaw in SHA that might one day be an attack vector?

It could be if the outcome was based on the entire result given by SHA, it is not. The guy picks a subset of it, and that is it.

I also don't know how these tests were conducted, and what were the expectations. If it is not obvious enough, the possible outcomes here doesn't require 32 bits, and dieharder expects numbers in 32 bits. Again, obviously enough, using ~20 bits for something that expects 32 bits has no chance to appear as random input.
hero member
Activity: 784
Merit: 1000
0xFB0D8D1534241423
We looked at it a little and think it's OK. It failed a couple of the dieharder tests, but it remains to be seen whether that can be put to practical use (i.e. overcoming the 1% edge). I doubt it.

If it fails some of the "tests" doesn't this mean you are uncovering a potential flaw in SHA that might one day be an attack vector?

Nope. An imperfect distribution doesn't imply any advantage in reversibility.
legendary
Activity: 1176
Merit: 1015
We looked at it a little and think it's OK. It failed a couple of the dieharder tests, but it remains to be seen whether that can be put to practical use (i.e. overcoming the 1% edge). I doubt it.

If it fails some of the "tests" doesn't this mean you are uncovering a potential flaw in SHA that might one day be an attack vector?
hero member
Activity: 784
Merit: 1000
0xFB0D8D1534241423
One thing I was wondering, is how random is a hash which is generated? Has anyone compared the randomness of a hash to a random number generator?

Just been thinking about this in relation to just dice.

Phil

We looked at it a little and think it's OK. It failed a couple of the dieharder tests, but it remains to be seen whether that can be put to practical use (i.e. overcoming the 1% edge). I doubt it.
hero member
Activity: 866
Merit: 1001
One thing I was wondering, is how random is a hash which is generated? Has anyone compared the randomness of a hash to a random number generator?

Just been thinking about this in relation to just dice.

Phil
member
Activity: 99
Merit: 10
Is there a mathematician in the house?

How do I analyse the odds of this strategy working?



He bets at 66%, which pays out 1.5x.  He starts at 0.06 BTC (this first bet is not shown in the screenshot), doubles on loss, halves on win, never halves below 0.06.

So it's a random walk, which makes a net profit of 0.03 BTC each time it gets back to betting 0.06.  Steps down are about twice as likely as steps up, so it seems unlikely to reach max bet and bust very quickly.

But the question is how do I calculate the probability of such a progression busting, given that he can afford to go N steps up the random walk?

Is it a Markov Chain thing?  Or how do I analyse it?

I will try to give another way to see why any martingale cannot work. It is just a partial answer to the actual question and it is like discovering hot water, still it can be a benefit since the gambler's fallacy lurks behind.

Consider a martingale strategy which make a walk over a finite set of values {a,b,c,d, etc.} such that after the last value the martingale is busted. It does not matter the actual way of going from one value to the other. Now consider a huge list of all possible outcomes of this martingale (each outcome is a serie of played values), last ones being the busting ones. Then just collect all the reached values in columns and see that for every column, like for example the value "a", there is an expected loss of -0.001*a. This holds for "b" etc, so the final expected value must be negative.

The gambler's fallacy is thus in thinking that the "order" of plays would give a positive outcome, but of course it does not matter if I play my bets within an order or not.

Is it somehow clear?

Pages:
Jump to: