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

12-30-2012 , 08:23 PM
Quote:
Originally Posted by BruceZ
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.
But that's exactly what I want to determine! A positive ev
lottery probability Quote
12-30-2012 , 08:28 PM
Quote:
Originally Posted by Mirapep
But that's exactly what I want to determine! A positive ev
Your EV for a series of bets is simply the sum of the EVs for each bet. If each bet is negative EV, then all your bets will have negative EV no matter how you bet. Every lottery bet is -EV except in rare cases where the jackpot is very large because nobody won for awhile. No betting system can have +EV for the lottery when all the bets are -EV.
lottery probability Quote
12-30-2012 , 08:37 PM
Applied Mathematical Sciences, Vol. 3, 2009, no. 55, 2725 - 2738
"On the Maximal Distance between Consecutive
Choices in the Set of Winning Numbers in Lottery"
Konstantinos Drakakis
lottery probability Quote
12-30-2012 , 08:39 PM
Quote:
Originally Posted by Mirapep
Applied Mathematical Sciences, Vol. 3, 2009, no. 55, 2725 - 2738
"On the Maximal Distance between Consecutive
Choices in the Set of Winning Numbers in Lottery"
Konstantinos Drakakis
What does that have to do with +EV? You can't have +EV in the lottery since every bet is -EV. This is fundamental, and nothing will ever change that.
lottery probability Quote
12-30-2012 , 08:48 PM
Quote:
Originally Posted by BruceZ
Your EV for a series of bets is simply the sum of the EVs for each bet. If each bet is negative EV, then all your bets will have negative EV no matter how you bet. Every lottery bet is -EV except in rare cases where the jackpot is very large because nobody won for awhile. No betting system can have +EV for the lottery when all the bets are -EV.
Ahahahaha, Bruce're exceptional! Your mathematical rationality can not, and I understand it, accept speeches from different formulas. This is similar to the old discourse of money ............ after 100 runs of heads ...............
I respect your comments
Let's talk about algorithms?
lottery probability Quote
12-30-2012 , 09:05 PM
Quote:
Originally Posted by Mirapep
Ahahahaha, Bruce're exceptional! Your mathematical rationality can not, and I understand it, accept speeches from different formulas. This is similar to the old discourse of money ............ after 100 runs of heads ...............
I respect your comments
Let's talk about algorithms?
If you make 100 flips of a FAIR coin and get 100 heads, the probability that the next one is heads is 1/2. If you flip a REAL coin 100 times and get 100 heads, the probability that the next coin is heads is very high because there is almost certainly something wrong with either the coin or the flipper. That is a valid statistical conclusion. If you play a lottery with a FAIR drawing a certain way and win 100 times in a row, there is still no betting system that can give you a +EV as long as the drawing is FAIR. The only way that you can have a +EV is if the drawing was NOT FAIR, but you have to prove that it is not fair statistically. Either you have statistical proof, or you have knowledge of an unfair drawing, or you just have superstition. There are no other choices.


Quote:
Let's talk about algorithms?
There are no algorithms that can give you +EV in a -EV lottery. The goal can only be entertainment, not profit.
lottery probability Quote
12-30-2012 , 09:19 PM
If, in addition to the combinations that have k or more consecutives, I want to eliminate even those combinations with a range of breaks between z and v, this is possible?
A break occurs when there is a change in the combination of sign.
For example a combination of C (20.5): 10100010001100000000 has seven breaks
lottery probability Quote
01-07-2013 , 03:40 AM
The R code below runs 20-50% faster than what I posted before which was already quite fast. I used the byte compiler, an internal version of rep, and replaced a for loop with vectorization. Depending on inputs, it can run 50% faster than VBA under Excel. As you can see, using the byte compiler for time critical routines is simply a matter of using cmpfun and calling the compiled function. The largest speed improvement was noted when running 50 jobs in batch mode. For some unexplained reason, R slows down part way through those even though all the jobs are the same. It's like it gets tired. Perhaps it is due to garbage collection. With the new code, it does this less, and the speed increases even more than for individual jobs. I'll have more speed comparisons and optimization info in an upcoming thread.

Code:
require(compiler)

pconsec = function(n,k,r,...) nconsec(n,k,r,...) / choose(n,k)

nconsec = function(n,k,r,table) {
  if (n == k)
    s = 1
  else if (k < 2*r)
    s = choose(n-r,k-r) + (n-r)*choose(n-r-1,k-r) 
  else {
    ctable = make_ctable(n,k,r)
    if (missing(table)) {table = make_tableb(n,k,r,ctable)}
    s = recurseb(n,k,r,ctable,table)
  }
  s
}
  

make_ctable = function(n,k,r) {
  ctable = matrix(rep(0,(n-r+1)*(k-r+1)),nrow=(n-r+1))
  ctable = choose(row(ctable)-1,col(ctable)-1)
  ctable
}


make_table = function(n,k,r,ctable) {
  table = matrix(rep(0,(n-r-1)*(k-r)),nrow=(n-r-1))
  table[row(table)==col(table)] = 1
  m = matrix(c(rep(r:(n-r-1),each=(k-2*r+1)),rep.int(r:(k-r),(n-2*r))),ncol=2)
  m = m[which(m[,1]>m[,2]),]
  for (i in 1:(length(m)/2)) table[m[i,1],m[i,2]] = recurseb(m[i,1],m[i,2],r,ctable,table)
  table
}
make_tableb = cmpfun(make_table)


make_table_once = function(n,k,r) {
  ctable = make_ctable(n,k,r)
  make_tableb(n,k,r,ctable)
}


recurse = function(n,k,r,ctable,table) {
  s = ctable[n-r+1,k-r+1] + (n-r)*ctable[n-r,k-r+1]
  if (k >= 2*r) {
    i = rep(0:(k-2*r),each=(n-k))
    m1 = matrix(c(rep.int(r:(n-k+r-1),k-2*r+1)+i,r+i),ncol=2)
    m2 = matrix(c(rep.int((n-2*r):(k-2*r+1),k-2*r+1)-i,k-2*r+1-i),ncol=2)
    s = s - sum(table[m1]*ctable[m2])
  }
  s
}
recurseb = cmpfun(recurse)

Last edited by BruceZ; 01-17-2013 at 03:09 PM. Reason: Added require(compiler) to code
lottery probability Quote
01-08-2013 , 08:08 AM
I had a complication on your previous algorithm. It is correct and fast.
However, as you will have understood, its application is necessary for the calculation of the progressive bets. If I want to win at least 5 bets of 20 with a maximum of 4 consecutive wins, the function nconsec (20,5,5,0) to nconsec (20,20,5,0) eliminates rightly, all combinations with more than 4 gambles consecutively. Below is the vb code so that you can better understand what I mean:

x1 = Val (Text2.Text) '---------- = N (number of total bets)
x2 = Val (Text3.Text) '---------- = K (betting to win)
x3 = Val (Text4.Text) '---------- = Q (fee paid by boockmaker)
x4 = Val (Text5.Text) '---------- = R (maximum bets won consecutively)
x5 = Val (Text6.Text) '---------- = C (available money)

x4 = x4 + 1

For a = x2 to x1
colc = 0
If x4> 0 And x2> = x4 Then
colc = nconsec(x1, a, x4, 0)
End If
If a = x2 And colc = Binomial (x1, a) Then
MsgBox "It 's been selected consecutiveness" + vbLf + _
"Too low for the system" + vbLf + vbLf + _
"", _
vbExclamation, _
"Consecutive wrong"
Exit Sub
End If
If x4> x2 Then
MsgBox "It 's been selected consecutiveness" + vbLf + _
"Too high for the system" + vbLf + vbLf + _
"", _
vbExclamation, _
"Consecutive wrong"
Exit Sub
End If
y = y + (Binomial (x1, a) - colc) * ((1 / x3) ^ a) * (1 - (1 / x3)) ^ (x1 -a)
Next

For a = x2 To x1 - 1
colc = 0
If x4> 0 And x2> = x4 Then
colc = nconsec(x1 - 1, a, x4, 0)
End If
y1 = y1 + (Binomial (x1 - 1, a) - colc) * ((1 / x3) ^ a) * (1 - (1 / x3)) ^ ((x1 - 1) - a)
Next

e = 1 / y '-------------- (System Efficiency)
e1 = 1 / y1

bet = (1 - (e / e1)) * C '---------- (money for the first bet)
Now, with the function nconsec so set, for example, is rightly eliminated also the following combination:
11011111111111111111
This fact, with Q = 1.5 for each N, determines e= 2.84 approximately. This is great, but I would like to close the betting:
110111
that is, to win the fifth bet. However, in this way, would remain still 14 possibility of obtaining more than 4 consecutive and, therefore, for e = 2.84 should continue betting.
Instead, accepting combinations as in the example
11011111111111111111
is determined e= 1.25 approximately and the system is winner with 110111

I know I'm asking a lot of your time and continue to give further complications such as the following:

In some cases bet = (1 - (e/ e1)) * C, is negative. In trading this applies to the extent you can bet on the event otherwise. Now I ask you:
It is possible to set up this system to bet on just 1, not 0 and e= 1.25 remain unchanged?
lottery probability Quote
01-08-2013 , 06:38 PM
To better understand, the condition on the maximum consecutive wins must be respected until it reaches the wins allowed.

11111011111111111111 is not accepted in C (20,19)
11110111111111111111 is accepted in C (20,19)
11101111111111111111 is accepted in C (20,19)
11011111111111111111 is accepted in C (20,19)
10111111111111111111 is accepted in C (20,19)
01111111111111111111 is not accepted in C (20,19)

Currently, as in the example proposed, all combinations C (20,19) are eliminated in the application of the function nconsec

Last edited by Mirapep; 01-08-2013 at 06:41 PM. Reason: error
lottery probability Quote

      
m