Open Side Menu Go to the Top
Register
lottery probability lottery probability

12-30-2012 , 01:42 PM
Continues to give me # VALUE
lottery probability Quote
12-30-2012 , 01:54 PM
I ran it ok in Excel 2007. For 100,50,5 I got prob =0.84289 in a blink of the eye.

One thing you might do is put the code in a module, not in the Worksheet. I seem to recall that functions should be in modules.
lottery probability Quote
12-30-2012 , 02:13 PM
Yes I have done this. I have to check well, you may consider that my excel is obviously in Italian
lottery probability Quote
12-30-2012 , 03:19 PM
ok in excel
lottery probability Quote
12-30-2012 , 03:19 PM
Quote:
Originally Posted by statmanhal
I ran it ok in Excel 2007. For 100,50,5 I got prob =0.84289 in a blink of the eye.

One thing you might do is put the code in a module, not in the Worksheet. I seem to recall that functions should be in modules.
I inserted it in a module. The With WorksheetFunction command just makes the functions like .Combin and .Min available.
lottery probability Quote
12-30-2012 , 04:45 PM
I also tried in vb6 compiled. The functions are very fast.
You saved 69 years!!
Too much to ask if you want to further complicate the process?
lottery probability Quote
12-30-2012 , 04:49 PM
Quote:
Originally Posted by Mirapep
I also tried in vb6 compiled. The functions are very fast.
You saved 69 years!!
How fast? Find one that takes say 30 seconds. Do that either by increasing n, or increasing the ratio of k to r.
lottery probability Quote
12-30-2012 , 05:46 PM
Therefore, about 20 seconds to draw by nconsec (100,50,5,0) to nconsec (100,100,5,0)
lottery probability Quote
12-30-2012 , 07:21 PM
I asked you if you are willing to complicate the process a bit.
So, imagine that you work in the stock market. You buy and sell shares following a decision-making model of entry and exit from the market to make a profit. We affirm that you are winning an average of 8 times out of 20 operations, but for added security you want to make a profit to five success. So, set your money management in 20 events total and at least 5 winners. At least this is important, then explain
lottery probability Quote
12-30-2012 , 07:24 PM
Quote:
Originally Posted by Mirapep
Therefore, about 20 seconds to draw by nconsec (100,50,5,0) to nconsec (100,100,5,0)
How long does it take you to do that in R? Please enter this and time.

x = rep(0,100)
for (i in 50:100) x[i] = nconsec(100,i,5)
x

Last edited by BruceZ; 12-30-2012 at 07:29 PM.
lottery probability Quote
12-30-2012 , 07:34 PM
Quote:
Originally Posted by Mirapep
I asked you if you are willing to complicate the process a bit.
So, imagine that you work in the stock market. You buy and sell shares following a decision-making model of entry and exit from the market to make a profit. We affirm that you are winning an average of 8 times out of 20 operations, but for added security you want to make a profit to five success. So, set your money management in 20 events total and at least 5 winners. At least this is important, then explain
You win 5 or more 94.9% of the time, assuming they are independent. From the binomial distribution:

> 1-pbinom(4,20,8/20)
[1] 0.949048
lottery probability Quote
12-30-2012 , 07:40 PM
55 seconds

> x = rep(0,100)
> for (i in 50:100) x[i] = nconsec(100,i,5)
> x
[1] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[6] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[11] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[16] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[21] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[26] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[31] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[36] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[41] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[46] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 8.504029e+28
[51] 8.618353e+28 8.355751e+28 7.752073e+28 6.883886e+28 5.852561e+28
[56] 4.765027e+28 3.716172e+28 2.776700e+28 1.988101e+28 1.364185e+28
[61] 8.971215e+27 5.653993e+27 3.414511e+27 1.975479e+27 1.094580e+27
[66] 5.805940e+26 2.946646e+26 1.430070e+26 6.632368e+25 2.937220e+25
[71] 1.241083e+25 4.998812e+24 1.917353e+24 6.995748e+23 2.425193e+23
[76] 7.977608e+22 2.486527e+22 7.332067e+21 2.041841e+21 5.359834e+20
[81] 1.323416e+20 3.066451e+19 6.650135e+18 1.345861e+18 2.533385e+17
[86] 4.418694e+16 7.110542e+15 1.050421e+15 1.416298e+14 1.731031e+13
[91] 1.902232e+12 1.860879e+11 1.600756e+10 1.192052e+09 7.528752e+07
[96] 3.921225e+06 1.617000e+05 4.950000e+03 1.000000e+02 1.000000e+00
>
lottery probability Quote
12-30-2012 , 07:45 PM
So we c (20.5) ways to be successful. Denote by 1 on success and 0 on failure. The combination:
11111000000000000000
is winning
Now, back to our system. We want to eliminate some combinations
lottery probability Quote
12-30-2012 , 07:45 PM
How old is your computer? What kind of processor/clock speed?
lottery probability Quote
12-30-2012 , 07:47 PM
One can understand what I'm writing?
lottery probability Quote
12-30-2012 , 07:48 PM
Quote:
Originally Posted by Mirapep
One can understand what I'm writing?
What combinations do you want to eliminate?
lottery probability Quote
12-30-2012 , 07:51 PM
is at least 6 years old. I keep it for xp and vb6
lottery probability Quote
12-30-2012 , 07:54 PM
I'm trying to explain the system money management
lottery probability Quote
12-30-2012 , 07:57 PM
So maybe you'd be more interested in continuing. I can insert an image excel in the post?
lottery probability Quote
12-30-2012 , 08:06 PM
Optimal Kelly fraction f of bankroll to bet is

f = 1 - q/b

where q = 12/20 and b is the payoff in bets. That grows bankroll fastest but with high volatility, so you may want to play a fraction of that like 0.5*f. You can choose a fraction to balance volatility and bankroll growth.

If you bet a fixed amount, the risk of ruin is approximately r^n where r is the solution to

r = 12/20 + 8/20*r^(1+b/B)

where B is your bankroll. That's if you play forever. Less if short term, and it is approximate if you can have money left over that you can't bet, so for that it is best to simulate those, but there are formulas for those too.

That's really all you need to know about money management for fixed payoffs. Everything else is basically nonsense.

Last edited by BruceZ; 12-30-2012 at 09:18 PM.
lottery probability Quote
12-30-2012 , 08:08 PM
Continuous. If your daily trading observe certain situations consolidated over time, you may apply some constraints. Consecutive breaks etc. .....
lottery probability Quote
12-30-2012 , 08:13 PM
Wait Bruce. This system is different and you can improve
lottery probability Quote
12-30-2012 , 08:14 PM
Quote:
Continuous. If your daily trading observe certain situations consolidated over time, you may apply some constraints. Consecutive breaks etc. .....
No, that's nonsense.

Oh, and if your EV is negative, your risk of ruin is 100% long term. Of course if you bet small enough, you won't ever get to long term before you die.
lottery probability Quote
12-30-2012 , 08:19 PM
Here you determine the cash that you want to risk, based on the total events and those who think you can win, in our example 20:05, we calculated each time the bet to do to get the profit
lottery probability Quote
12-30-2012 , 08:23 PM
Quote:
Originally Posted by Mirapep
Here you determine the cash that you want to risk, based on the total events and those who think you can win, in our example 20:05, we calculated each time the bet to do to get the profit
If you have different probabilities for each event, then there is an optimal way to bet to maximize growth rate by maximizing the expected value of the log of your bankroll.

Last edited by BruceZ; 12-30-2012 at 09:20 PM.
lottery probability Quote

      
m