oda.krell
Legendary
Offline
Activity: 1470
Merit: 1007
|
|
November 25, 2013, 04:36:46 PM |
|
Umm... you're right in the first part, but to the last paragraph I could add: given any fully specified Martingale (odds, betting size progression, ending conditions), I can construct an equivalent single bet strategy. The only reason to employ a Martingale over a single bet strategy is that the former seems easier to risk-manage intuitively for the human mind.
I disagree, but will allow you to prove me wrong... Suppose I have 127 BTC and want 128. I propose betting 1 BTC at 49.5% (2x payout). If it wins, stop, else double and repeat until it wins. So bet: 1, 2, 4, 8, 16, 32, 64 until one of them wins. If none wins, I've lost all 127 BTC. If any wins, I've got the 128 BTC I wanted. This strategy will work so long as any one of the maximum of 7 bets wins. ie. unless all 7 lose. The probability of all 7 losing is 0.505^7 = 0.008376, so I have a 100 * (1 - 0.008376) = 99.1624% chance of success. It's pretty likely that I'll end up betting less than the full 127 BTC. My expected total stake is less than 127. So my expected loss is less than 1.27 BTC. What's your equivalent single bet strategy? How much does it expect to risk? How much does it expect to lose? Jup. You're right. The equivalence only holds for betting without an edge. If there's an edge against the player, Martingale is slightly more favourable than a single bet with equal profit.
|
Not sure which Bitcoin wallet you should use? Get Electrum!Electrum is an open-source lightweight client: fast, user friendly, and 100% secure. Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
|
|
|
|
|
|
"In a nutshell, the network works like a distributed
timestamp server, stamping the first transaction to spend a coin. It
takes advantage of the nature of information being easy to spread but
hard to stifle." -- Satoshi
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
nicolaennio
Member
Offline
Activity: 99
Merit: 10
|
|
November 26, 2013, 12:32:49 AM |
|
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?
|
▶▶ UR TOKEN ◀◀ ═══━┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈━═══ ⓄⓄ UNIVERSAL RECOGNITION TOKEN ⓄⓄ █ █ █
|
|
|
filharvey
|
|
November 26, 2013, 01:07:18 AM |
|
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
|
|
|
|
nimda
|
|
November 26, 2013, 02:39:14 AM |
|
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.
|
|
|
|
drawingthesun
Legendary
Offline
Activity: 1176
Merit: 1015
|
|
November 26, 2013, 03:00:14 AM |
|
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?
|
|
|
|
nimda
|
|
November 26, 2013, 03:27:07 AM |
|
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.
|
|
|
|
moderate
Member
Offline
Activity: 98
Merit: 10
nearly dead
|
|
November 26, 2013, 03:53:53 AM |
|
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.
|
|
|
|
dooglus (OP)
Legendary
Offline
Activity: 2940
Merit: 1330
|
|
November 26, 2013, 06:56:05 AM |
|
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.
|
Just-Dice | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | Play or Invest | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | 1% House Edge |
|
|
|
organofcorti
Donator
Legendary
Offline
Activity: 2058
Merit: 1007
Poor impulse control.
|
|
November 26, 2013, 08:28:10 AM |
|
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.
|
|
|
|
Rannasha
|
|
November 26, 2013, 08:55:45 AM |
|
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).
|
|
|
|
dooglus (OP)
Legendary
Offline
Activity: 2940
Merit: 1330
|
|
November 26, 2013, 10:15:35 AM |
|
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://bitcointalk.org/index.php?topic=242962.msg3687257#msg3687257
|
Just-Dice | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | Play or Invest | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | 1% House Edge |
|
|
|
organofcorti
Donator
Legendary
Offline
Activity: 2058
Merit: 1007
Poor impulse control.
|
|
November 26, 2013, 10:22:19 AM |
|
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). 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.
|
|
|
|
|
dooglus (OP)
Legendary
Offline
Activity: 2940
Merit: 1330
|
|
November 26, 2013, 05:47:25 PM |
|
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://bitcointalk.org/index.php?topic=347248.msg3724240#msg3724240
|
Just-Dice | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | Play or Invest | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | 1% House Edge |
|
|
|
nicolaennio
Member
Offline
Activity: 99
Merit: 10
|
|
November 26, 2013, 07:34:55 PM |
|
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?
|
▶▶ UR TOKEN ◀◀ ═══━┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈━═══ ⓄⓄ UNIVERSAL RECOGNITION TOKEN ⓄⓄ █ █ █
|
|
|
dooglus (OP)
Legendary
Offline
Activity: 2940
Merit: 1330
|
|
November 26, 2013, 08:09:37 PM |
|
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.
|
Just-Dice | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | Play or Invest | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | 1% House Edge |
|
|
|
tucenaber
|
|
November 27, 2013, 12:23:22 AM |
|
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)
|
|
|
|
dooglus (OP)
Legendary
Offline
Activity: 2940
Merit: 1330
|
|
November 27, 2013, 01:04:22 AM |
|
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?
|
Just-Dice | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | Play or Invest | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | 1% House Edge |
|
|
|
tucenaber
|
|
November 27, 2013, 01:36:19 AM |
|
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)
|
|
|
|
blockage
Member
Offline
Activity: 100
Merit: 10
Vires in numeris.
|
|
November 27, 2013, 04:11:38 AM |
|
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.
|
|
|
|
|