- Home
- Premium Memberships
- Lottery Results
- Forums
- Predictions
- Lottery Post Videos
- News
- Search Drawings
- Search Lottery Post
- Lottery Systems
- Lottery Charts
- Lottery Wheels
- Worldwide Jackpots
- Quick Picks
- On This Day in History
- Blogs
- Online Games
- Premium Features
- Contact Us
- Whitelist Lottery Post
- Rules
- Lottery Book Store
- Lottery Post Gift Shop
The time is now 12:33 am
You last visited
April 23, 2024, 8:31 pm
All times shown are
Eastern Time (GMT-5:00)
If you had 10 bucks to bet...Prev TopicNext Topic
What do you think is the better bet?
-
Quote: Originally posted by JADELottery on Apr 12, 2011
We will do the program first and come back to your reply later.
It's an easier test and less costly.
Keep talking amongst yourselves... we'll be back in a bit.
Why do you always refer to "We"? Not trying to be a smartass, but I've been wanting to ask that question for a while now....lol
-
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineQuote: Originally posted by joker17 on Apr 12, 2011
Why do you always refer to "We"? Not trying to be a smartass, but I've been wanting to ask that question for a while now....lol
We cannot answer that question at this point in time.
Someone else here might know part of the answer, but it's not quite what you might think it is... close but a variant.
Do some research on it and you might find a very eye opening answer to it.
The One Over None
I Know... -
Quote: Originally posted by joker17 on Apr 12, 2011
Why do you always refer to "We"? Not trying to be a smartass, but I've been wanting to ask that question for a while now....lol
All famous celebrities do that!
The question: is it better to have 10 people saying "we" or one person saying "we," 10 times?
-
100The Hall Of The Mountain Kings Tennessee
United States
Member #73,902
April 28, 2009
15,378 Posts
OfflineQuote: Originally posted by truecritic on Apr 12, 2011
All famous celebrities do that!
The question: is it better to have 10 people saying "we" or one person saying "we," 10 times?
Ten French wimmins saying oui oui at the same time.
-
tiggs has always wondered why people talk like that..We this we that..tiggs will never understand that..ridge please explain it to tiggs will yah..tiggs will be back tiggs is out and tiggs thank's you..from tiggs...
Pure luck
-
Quote: Originally posted by truecritic on Apr 12, 2011
All famous celebrities do that!
The question: is it better to have 10 people saying "we" or one person saying "we," 10 times?
Like I said before, i believe 10 people saying "WE" at once is better....
I think he has a mouse in his pocket...lol
-
Quote: Originally posted by dr65 on Apr 12, 2011
Unless you've won a jackpot prize using either of these methods..you will never know which one was the
better play 1/10 or 10/1...even if you won, you would only be able to say playing 1 set for 10 days or 10
sets for one day was good only for the day you won. Do it again and I might be impressed, do it yearly
and hey you might have a believer.
But just toss it around without being able to get to the point and I wonder what you are after.
JADELottery are you reeling people into something...do you need attention...do you need help or do you
need answers to your poll to show yourself (yourselves?) that what you are thinking is proper thinking?
ie, read: Validation, confirmation, ???.
Your posts are posts of a person holding an answer. You seem to know the answer yet string people
along letting them guess at some great mystery.
What I know is this...5 plays at 7 days is good enough...1 play for 26 draws is boring....and unless you
have a few jp wins to back up this string along post, then please get to the point without all the mystery
and delay.
Someone compared jackpot games to pick 3 games....different can of worms, sts.
Why don't you throw your opinion of what the better play is out there?
Why not play more numbers sets for one draw than play one number set for 10 draws? Or why
even separate the two of them?
The chances that your winning number set is in 10 lines with one drawing are as good as your one
line of numbers being the winner in 10 drawings.
"Unless you've won a jackpot prize using either of these methods..you will never know which one was the better play 1/10 or 10/1...even if you won, you would only be able to say playing 1 set for 10 days or 10 sets for one day was good only for the day you won. Do it again and I might be impressed, do it yearly and hey you might have a believer."
In that case, when he shows you the results of doing it (playing it, not winning it) 15,000,000 times, you should surely have what you need to make a firm decision.
-
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineWe have the basic layout to display the results.
Now we have to setup the code for both different tests.
Below is a screen shot of what it will look like.
Each test will run 15,000,000 draws.
The One Over None
I Know... -
Quote: Originally posted by JADELottery on Apr 13, 2011
We have the basic layout to display the results.
Now we have to setup the code for both different tests.
Below is a screen shot of what it will look like.
Each test will run 15,000,000 draws.
Looks great!
Just so you know: It is visible to me and I am not an Administrator!
-
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineQuote: Originally posted by truecritic on Apr 13, 2011
Looks great!
Just so you know: It is visible to me and I am not an Administrator!
We've got the Pick 5 Pick 6 part running now.
We are testing it and will post when we are done with that part so everyone can try.
Early test show though, this program runs pretty slow because of the large number of combinations.
We'll get back to you when we are done testing the program for any bugs.
Also, some of the data layout may be a little different, but the overall layout is the same.
The One Over None
I Know... -
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineOk, the Pick 5 and Pick 6 tests are coded.
You can try the test yourself and yes, we made it so it's visible to all.
Link - http://www.jadexcode.com/SpecialTest.aspx
We will be working on the Pick 3 and Pick 4 part.
The One Over None
I Know... -
Native American Eagle SunMN
United States
Member #21
December 7, 2001
4,811 Posts
OfflineBelow is the code for the Pick 5 and Pick 6 part.
_______________________________________
Public Class Pick5Pick6Tests
Public Class StatusUpdate
Public ProgressPercentage As Integer
Public ProgressIndex As Integer
Public ProgressInformation As String
End Class
Public N, R, W As Integer
Const IndexMax As Integer = 12
Private Numbers(IndexMax, 12) As Byte 'Draw - Numbers(0, x) , 1 Play - Numbers(1, x) , 10 Plays - Numbers(2 to 11, x)
Public Sub RunThePick5Pick6Test(ByVal worker As System.ComponentModel.BackgroundWorker, ByVal e As System.ComponentModel.DoWorkEventArgs)
Dim UpdateStatus As New StatusUpdate
UpdateStatus.ProgressPercentage = 0
UpdateStatus.ProgressIndex = -1
UpdateStatus.ProgressInformation = "Testing"
worker.ReportProgress(0, UpdateStatus)
Randomize(Timer)
Dim TotalLotteryCombinations As Integer = Comb(N, R)
For a As Integer = 0 To 12
For b As Integer = 0 To 12
Numbers(a, b) = &H0
Next
Next
For TestIndex As Integer = 0 To 9
'Reset Count for each test
Dim Total_1P_10D_Wins As Integer = 0
Dim Total_10P_1D_Wins As Integer = 0
For DrawIndex As Integer = 1 To 15000000
'Cancel Thread
If worker.CancellationPending Then
e.Cancel = True
Exit Sub
End If
'Loads random combinations for 1 Play and 10 Plays once every 10 Draws
If Modulus(DrawIndex, 10) = 1 Then
For a = 1 To 11
'Clears the Numbers played
For b As Integer = 0 To 12
Numbers(a, b) = &H0
Next
WriteCombination(a, Index2Combin(N, R, RandomLowerUpper(1, TotalLotteryCombinations)), WriteCombin.Add)
Next
End If
'Clears the Lottery Drawing Numbers and Draws New Numbers
For a As Integer = 0 To 12
Numbers(0, a) = &H0
Next
WriteCombination(0, Index2Combin(N, R, RandomLowerUpper(1, TotalLotteryCombinations)), WriteCombin.Add)
'Compare and Count 10 Plays to 1 Draw only once every 10 Draws
If Modulus(DrawIndex, 10) = 1 Then
For a = 2 To 11
If CompareCombination(0, ReadCombination(a, N, ReadCombin.GetStoredNumbers)) >= W Then
Total_10P_1D_Wins += 1
End If
Next
End If
'Compare and Count 1 Play to 10 Draws
If CompareCombination(0, ReadCombination(1, N, ReadCombin.GetStoredNumbers)) >= W Then
Total_1P_10D_Wins += 1
End If
If Modulus(DrawIndex, 15000) = 0 Then
UpdateStatus.ProgressPercentage = Int(DrawIndex / 150000)
UpdateStatus.ProgressIndex = TestIndex
UpdateStatus.ProgressInformation = Total_1P_10D_Wins.ToString & " | " & Total_10P_1D_Wins.ToString & " | "
If Total_1P_10D_Wins = Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "None | 0"
End If
If Total_1P_10D_Wins > Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "1P 10D | " & Math.Abs(Total_1P_10D_Wins - Total_10P_1D_Wins).ToString
End If
If Total_1P_10D_Wins < Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "10P 1D | " & Math.Abs(Total_1P_10D_Wins - Total_10P_1D_Wins).ToString
End If
worker.ReportProgress(0, UpdateStatus)
End If
Next
Next
UpdateStatus.ProgressPercentage = 0
UpdateStatus.ProgressIndex = -1
UpdateStatus.ProgressInformation = "Complete"
worker.ReportProgress(0, UpdateStatus)
End Sub
Enum WriteCombin
Add = True
Remove = False
End Enum
Enum ReadCombin
GetStoredNumbers = True
GetNotStoredNumbers = False
End Enum
Enum BitState As Byte
ClrBit = 0
SetBit = 1
TogBit = 2
ExmBit = 3
End Enum
Function Modulus(ByVal a As Double, ByVal b As Double) As Long
Modulus = a - b * Int(a / b)
End Function
Function RandomLowerUpper(ByVal L As Long, ByVal U As Long) As Long
RandomLowerUpper = Int(Rnd() * (U - (L - 1))) + L
End Function
Function Fact(ByVal N As Integer) As Double
If (N <= 1) Then
Fact = 1
Else
Fact = N * Fact(N - 1)
End If
End Function
Function Perm(ByVal N As Integer, ByVal R As Integer) As Double
Dim a As Integer
Dim b As Double
b = 1
If (N < R) Then
Perm = 0
Else
For a = (N - (R - 1)) To N
b = b * a
Next a
Perm = b
End If
End Function
Function Comb(ByVal N As Integer, ByVal R As Integer) As Long
If (N < R) Then
Comb = 0
Else
Comb = Perm(N, R) / Fact(R)
End If
End Function
Function Cdist(ByVal N As Integer, ByVal R As Integer, ByVal C As Integer, ByVal Z As Integer) As Long
If ((Z < C) Or (Z > (N - (R - C))) Or (Z > N) Or (C > R) Or (N < 1) Or (R < 1) Or (C < 1) Or (Z < 1)) Then
Cdist = 0
Else
Cdist = Comb((Z - 1), (C - 1)) * Comb((N - Z), (R - C))
End If
End Function
Function fColumnSum(ByVal N As Integer, ByVal R As Integer, ByVal Z As Integer) As Long
Dim a As Integer
Dim ColumnSum As Double
If (Z < 1) Then
fColumnSum = 0
ElseIf ((Z >= 1) And (Z < (N - (R - 1)))) Then
ColumnSum = 0
For a = 1 To Z
ColumnSum = ColumnSum + Cdist(N, R, 1, a)
Next a
fColumnSum = ColumnSum
ElseIf (Z >= (N - (R - 1))) Then
fColumnSum = Comb(N, R)
End If
End Function
Function Index2Combin(ByVal N As Integer, ByVal R As Integer, ByVal I As Long) As String
Dim a, Combination(), Z As Integer
Dim J As Double
ReDim Combination(R)
Dim tmpString As String
Dim NumberFound As Boolean
tmpString = ""
J = I
J = J - 1
Z = 0
For a = 1 To R
If ((I >= 1) And (I <= Comb(N, R))) Then
If (a = 1) Then
Combination(a) = 1
Else
Combination(a) = Combination(a - 1) + 1
End If
NumberFound = False
Do
Select Case (J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1))))
Case Is < 0
Combination(a) = Combination(a) - 1
NumberFound = True
Case Is = 0
NumberFound = True
Case Is > 0
Combination(a) = Combination(a) + 1
End Select
Loop Until NumberFound
J = J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1)))
Z = Combination(a)
Else
Combination(a) = 0
End If
tmpString = tmpString & Format(Combination(a), "00 ")
Next a
Index2Combin = tmpString
End Function
Function Combin2Index(ByVal N As Integer, ByVal R As Integer, ByVal Combination As String) As Long
Dim a As Integer
Dim fSum As Double
fSum = 1
For a = 1 To R
If (a = 1) Then
fSum = fSum + fColumnSum(N, R, (Val(Mid(Combination, 3 * a - 2, 2)) - 1))
Else
fSum = fSum + fColumnSum((N - Val(Mid(Combination, 3 * (a - 1) - 2, 2))), (R - (a - 1)), (Val(Mid(Combination, 3 * a - 2, 2)) - (Val(Mid(Combination, 3 * (a - 1) - 2, 2)) + 1)))
End If
Next a
Combin2Index = fSum
End Function
Sub WriteCombination(ByVal I As Integer, ByVal Combination As String, ByVal Add As Boolean)
Dim bytPos As Integer
Dim bitPos As Byte
Dim R As Integer
Dim Z As Integer
R = Int(Len(Combination) / 3)
If R <> 0 Then
For a As Integer = 1 To R
Z = CInt(Val(Mid(Combination, 3 * a - 2, 2)))
bytPos = CInt(IntPart(CDbl(Z) / 8))
bitPos = CByte(8 * DecPart(CDbl(Z) / 8))
If Add Then
Numbers(I, bytPos) = CSTEBit(BitState.SetBit, Numbers(I, bytPos), bitPos)
Else
Numbers(I, bytPos) = CSTEBit(BitState.ClrBit, Numbers(I, bytPos), bitPos)
End If
Next
End If
End Sub
Function ReadCombination(ByVal I As Integer, ByVal N As Integer, ByVal GetStoredValues As Boolean) As String
Dim tmpText As String = ""
Dim bytPos As Integer
Dim bitPos As Byte
For a As Byte = 1 To N
bytPos = CInt(IntPart(CDbl(a) / 8))
bitPos = CByte(8 * DecPart(CDbl(a) / 8))
If GetStoredValues Then
If CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos) = 1 Then
tmpText &= Format(a, "00 ")
End If
Else
If CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos) = 0 Then
tmpText &= Format(a, "00 ")
End If
End If
Next
ReadCombination = tmpText
End Function
Function CompareCombination(ByVal I As Integer, ByVal Combination As String) As Integer
Dim T As Integer = 0
Dim bytPos As Integer
Dim bitPos As Byte
For a As Integer = 1 To Int(Len(Combination) / 3)
bytPos = CInt(IntPart(CDbl(Val(Mid(Combination, 3 * a - 2, 2))) / 8))
bitPos = CByte(8 * DecPart(CDbl(Val(Mid(Combination, 3 * a - 2, 2))) / 8))
T += CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos)
Next
CompareCombination = T
End Function
Public Function CSTEBit(ByVal CSTE As Byte, ByVal Byt As Byte, ByVal Bit As Byte) As Byte
If Bit < 8 Then
Dim Mask As Byte = 2 ^ Bit
Select Case CSTE
Case BitState.ClrBit
Return Byt And Not Mask
Case BitState.SetBit
Return Byt Or Mask
Case BitState.TogBit
Return Byt Xor Mask
Case BitState.ExmBit
If ((Byt And Mask) > 0) Then
Return 1
Else
Return 0
End If
Case Else
Return Byt
End Select
Else
Return Byt
End If
End Function
Function IntPart(ByVal n As Double) As Integer
Select Case Math.Sign(n)
Case -1
Return Math.Ceiling(n)
Case 0
Return 0
Case 1
Return Math.Floor(n)
End Select
End Function
Function DecPart(ByVal n As Double) As Double
Select Case Math.Sign(n)
Case -1
Return (n - Math.Ceiling(n))
Case 0
Return 0
Case 1
Return (n - Math.Floor(n))
End Select
End Function
End Class_______________________________
The One Over None
I Know... -
He said it right.....
IF I has 10 dollars!
-
100The Hall Of The Mountain Kings Tennessee
United States
Member #73,902
April 28, 2009
15,378 Posts
OfflineQuote: Originally posted by JADELottery on Apr 13, 2011
Below is the code for the Pick 5 and Pick 6 part.
_______________________________________
Public Class Pick5Pick6Tests
Public Class StatusUpdate
Public ProgressPercentage As Integer
Public ProgressIndex As Integer
Public ProgressInformation As String
End Class
Public N, R, W As Integer
Const IndexMax As Integer = 12
Private Numbers(IndexMax, 12) As Byte 'Draw - Numbers(0, x) , 1 Play - Numbers(1, x) , 10 Plays - Numbers(2 to 11, x)
Public Sub RunThePick5Pick6Test(ByVal worker As System.ComponentModel.BackgroundWorker, ByVal e As System.ComponentModel.DoWorkEventArgs)
Dim UpdateStatus As New StatusUpdate
UpdateStatus.ProgressPercentage = 0
UpdateStatus.ProgressIndex = -1
UpdateStatus.ProgressInformation = "Testing"
worker.ReportProgress(0, UpdateStatus)
Randomize(Timer)
Dim TotalLotteryCombinations As Integer = Comb(N, R)
For a As Integer = 0 To 12
For b As Integer = 0 To 12
Numbers(a, b) = &H0
Next
Next
For TestIndex As Integer = 0 To 9
'Reset Count for each test
Dim Total_1P_10D_Wins As Integer = 0
Dim Total_10P_1D_Wins As Integer = 0
For DrawIndex As Integer = 1 To 15000000
'Cancel Thread
If worker.CancellationPending Then
e.Cancel = True
Exit Sub
End If
'Loads random combinations for 1 Play and 10 Plays once every 10 Draws
If Modulus(DrawIndex, 10) = 1 Then
For a = 1 To 11
'Clears the Numbers played
For b As Integer = 0 To 12
Numbers(a, b) = &H0
Next
WriteCombination(a, Index2Combin(N, R, RandomLowerUpper(1, TotalLotteryCombinations)), WriteCombin.Add)
Next
End If
'Clears the Lottery Drawing Numbers and Draws New Numbers
For a As Integer = 0 To 12
Numbers(0, a) = &H0
Next
WriteCombination(0, Index2Combin(N, R, RandomLowerUpper(1, TotalLotteryCombinations)), WriteCombin.Add)
'Compare and Count 10 Plays to 1 Draw only once every 10 Draws
If Modulus(DrawIndex, 10) = 1 Then
For a = 2 To 11
If CompareCombination(0, ReadCombination(a, N, ReadCombin.GetStoredNumbers)) >= W Then
Total_10P_1D_Wins += 1
End If
Next
End If
'Compare and Count 1 Play to 10 Draws
If CompareCombination(0, ReadCombination(1, N, ReadCombin.GetStoredNumbers)) >= W Then
Total_1P_10D_Wins += 1
End If
If Modulus(DrawIndex, 15000) = 0 Then
UpdateStatus.ProgressPercentage = Int(DrawIndex / 150000)
UpdateStatus.ProgressIndex = TestIndex
UpdateStatus.ProgressInformation = Total_1P_10D_Wins.ToString & " | " & Total_10P_1D_Wins.ToString & " | "
If Total_1P_10D_Wins = Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "None | 0"
End If
If Total_1P_10D_Wins > Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "1P 10D | " & Math.Abs(Total_1P_10D_Wins - Total_10P_1D_Wins).ToString
End If
If Total_1P_10D_Wins < Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "10P 1D | " & Math.Abs(Total_1P_10D_Wins - Total_10P_1D_Wins).ToString
End If
worker.ReportProgress(0, UpdateStatus)
End If
Next
Next
UpdateStatus.ProgressPercentage = 0
UpdateStatus.ProgressIndex = -1
UpdateStatus.ProgressInformation = "Complete"
worker.ReportProgress(0, UpdateStatus)
End Sub
Enum WriteCombin
Add = True
Remove = False
End Enum
Enum ReadCombin
GetStoredNumbers = True
GetNotStoredNumbers = False
End Enum
Enum BitState As Byte
ClrBit = 0
SetBit = 1
TogBit = 2
ExmBit = 3
End Enum
Function Modulus(ByVal a As Double, ByVal b As Double) As Long
Modulus = a - b * Int(a / b)
End Function
Function RandomLowerUpper(ByVal L As Long, ByVal U As Long) As Long
RandomLowerUpper = Int(Rnd() * (U - (L - 1))) + L
End Function
Function Fact(ByVal N As Integer) As Double
If (N <= 1) Then
Fact = 1
Else
Fact = N * Fact(N - 1)
End If
End Function
Function Perm(ByVal N As Integer, ByVal R As Integer) As Double
Dim a As Integer
Dim b As Double
b = 1
If (N < R) Then
Perm = 0
Else
For a = (N - (R - 1)) To N
b = b * a
Next a
Perm = b
End If
End Function
Function Comb(ByVal N As Integer, ByVal R As Integer) As Long
If (N < R) Then
Comb = 0
Else
Comb = Perm(N, R) / Fact(R)
End If
End Function
Function Cdist(ByVal N As Integer, ByVal R As Integer, ByVal C As Integer, ByVal Z As Integer) As Long
If ((Z < C) Or (Z > (N - (R - C))) Or (Z > N) Or (C > R) Or (N < 1) Or (R < 1) Or (C < 1) Or (Z < 1)) Then
Cdist = 0
Else
Cdist = Comb((Z - 1), (C - 1)) * Comb((N - Z), (R - C))
End If
End Function
Function fColumnSum(ByVal N As Integer, ByVal R As Integer, ByVal Z As Integer) As Long
Dim a As Integer
Dim ColumnSum As Double
If (Z < 1) Then
fColumnSum = 0
ElseIf ((Z >= 1) And (Z < (N - (R - 1)))) Then
ColumnSum = 0
For a = 1 To Z
ColumnSum = ColumnSum + Cdist(N, R, 1, a)
Next a
fColumnSum = ColumnSum
ElseIf (Z >= (N - (R - 1))) Then
fColumnSum = Comb(N, R)
End If
End Function
Function Index2Combin(ByVal N As Integer, ByVal R As Integer, ByVal I As Long) As String
Dim a, Combination(), Z As Integer
Dim J As Double
ReDim Combination(R)
Dim tmpString As String
Dim NumberFound As Boolean
tmpString = ""
J = I
J = J - 1
Z = 0
For a = 1 To R
If ((I >= 1) And (I <= Comb(N, R))) Then
If (a = 1) Then
Combination(a) = 1
Else
Combination(a) = Combination(a - 1) + 1
End If
NumberFound = False
Do
Select Case (J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1))))
Case Is < 0
Combination(a) = Combination(a) - 1
NumberFound = True
Case Is = 0
NumberFound = True
Case Is > 0
Combination(a) = Combination(a) + 1
End Select
Loop Until NumberFound
J = J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1)))
Z = Combination(a)
Else
Combination(a) = 0
End If
tmpString = tmpString & Format(Combination(a), "00 ")
Next a
Index2Combin = tmpString
End Function
Function Combin2Index(ByVal N As Integer, ByVal R As Integer, ByVal Combination As String) As Long
Dim a As Integer
Dim fSum As Double
fSum = 1
For a = 1 To R
If (a = 1) Then
fSum = fSum + fColumnSum(N, R, (Val(Mid(Combination, 3 * a - 2, 2)) - 1))
Else
fSum = fSum + fColumnSum((N - Val(Mid(Combination, 3 * (a - 1) - 2, 2))), (R - (a - 1)), (Val(Mid(Combination, 3 * a - 2, 2)) - (Val(Mid(Combination, 3 * (a - 1) - 2, 2)) + 1)))
End If
Next a
Combin2Index = fSum
End Function
Sub WriteCombination(ByVal I As Integer, ByVal Combination As String, ByVal Add As Boolean)
Dim bytPos As Integer
Dim bitPos As Byte
Dim R As Integer
Dim Z As Integer
R = Int(Len(Combination) / 3)
If R <> 0 Then
For a As Integer = 1 To R
Z = CInt(Val(Mid(Combination, 3 * a - 2, 2)))
bytPos = CInt(IntPart(CDbl(Z) / 8))
bitPos = CByte(8 * DecPart(CDbl(Z) / 8))
If Add Then
Numbers(I, bytPos) = CSTEBit(BitState.SetBit, Numbers(I, bytPos), bitPos)
Else
Numbers(I, bytPos) = CSTEBit(BitState.ClrBit, Numbers(I, bytPos), bitPos)
End If
Next
End If
End Sub
Function ReadCombination(ByVal I As Integer, ByVal N As Integer, ByVal GetStoredValues As Boolean) As String
Dim tmpText As String = ""
Dim bytPos As Integer
Dim bitPos As Byte
For a As Byte = 1 To N
bytPos = CInt(IntPart(CDbl(a) / 8))
bitPos = CByte(8 * DecPart(CDbl(a) / 8))
If GetStoredValues Then
If CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos) = 1 Then
tmpText &= Format(a, "00 ")
End If
Else
If CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos) = 0 Then
tmpText &= Format(a, "00 ")
End If
End If
Next
ReadCombination = tmpText
End Function
Function CompareCombination(ByVal I As Integer, ByVal Combination As String) As Integer
Dim T As Integer = 0
Dim bytPos As Integer
Dim bitPos As Byte
For a As Integer = 1 To Int(Len(Combination) / 3)
bytPos = CInt(IntPart(CDbl(Val(Mid(Combination, 3 * a - 2, 2))) / 8))
bitPos = CByte(8 * DecPart(CDbl(Val(Mid(Combination, 3 * a - 2, 2))) / 8))
T += CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos)
Next
CompareCombination = T
End Function
Public Function CSTEBit(ByVal CSTE As Byte, ByVal Byt As Byte, ByVal Bit As Byte) As Byte
If Bit < 8 Then
Dim Mask As Byte = 2 ^ Bit
Select Case CSTE
Case BitState.ClrBit
Return Byt And Not Mask
Case BitState.SetBit
Return Byt Or Mask
Case BitState.TogBit
Return Byt Xor Mask
Case BitState.ExmBit
If ((Byt And Mask) > 0) Then
Return 1
Else
Return 0
End If
Case Else
Return Byt
End Select
Else
Return Byt
End If
End Function
Function IntPart(ByVal n As Double) As Integer
Select Case Math.Sign(n)
Case -1
Return Math.Ceiling(n)
Case 0
Return 0
Case 1
Return Math.Floor(n)
End Select
End Function
Function DecPart(ByVal n As Double) As Double
Select Case Math.Sign(n)
Case -1
Return (n - Math.Ceiling(n))
Case 0
Return 0
Case 1
Return (n - Math.Floor(n))
End Select
End Function
End Class_______________________________
Holy Moly.
I'm gonna be hittin the sauce tonight.
-
Quote: Originally posted by JADELottery on Apr 13, 2011
Below is the code for the Pick 5 and Pick 6 part.
_______________________________________
Public Class Pick5Pick6Tests
Public Class StatusUpdate
Public ProgressPercentage As Integer
Public ProgressIndex As Integer
Public ProgressInformation As String
End Class
Public N, R, W As Integer
Const IndexMax As Integer = 12
Private Numbers(IndexMax, 12) As Byte 'Draw - Numbers(0, x) , 1 Play - Numbers(1, x) , 10 Plays - Numbers(2 to 11, x)
Public Sub RunThePick5Pick6Test(ByVal worker As System.ComponentModel.BackgroundWorker, ByVal e As System.ComponentModel.DoWorkEventArgs)
Dim UpdateStatus As New StatusUpdate
UpdateStatus.ProgressPercentage = 0
UpdateStatus.ProgressIndex = -1
UpdateStatus.ProgressInformation = "Testing"
worker.ReportProgress(0, UpdateStatus)
Randomize(Timer)
Dim TotalLotteryCombinations As Integer = Comb(N, R)
For a As Integer = 0 To 12
For b As Integer = 0 To 12
Numbers(a, b) = &H0
Next
Next
For TestIndex As Integer = 0 To 9
'Reset Count for each test
Dim Total_1P_10D_Wins As Integer = 0
Dim Total_10P_1D_Wins As Integer = 0
For DrawIndex As Integer = 1 To 15000000
'Cancel Thread
If worker.CancellationPending Then
e.Cancel = True
Exit Sub
End If
'Loads random combinations for 1 Play and 10 Plays once every 10 Draws
If Modulus(DrawIndex, 10) = 1 Then
For a = 1 To 11
'Clears the Numbers played
For b As Integer = 0 To 12
Numbers(a, b) = &H0
Next
WriteCombination(a, Index2Combin(N, R, RandomLowerUpper(1, TotalLotteryCombinations)), WriteCombin.Add)
Next
End If
'Clears the Lottery Drawing Numbers and Draws New Numbers
For a As Integer = 0 To 12
Numbers(0, a) = &H0
Next
WriteCombination(0, Index2Combin(N, R, RandomLowerUpper(1, TotalLotteryCombinations)), WriteCombin.Add)
'Compare and Count 10 Plays to 1 Draw only once every 10 Draws
If Modulus(DrawIndex, 10) = 1 Then
For a = 2 To 11
If CompareCombination(0, ReadCombination(a, N, ReadCombin.GetStoredNumbers)) >= W Then
Total_10P_1D_Wins += 1
End If
Next
End If
'Compare and Count 1 Play to 10 Draws
If CompareCombination(0, ReadCombination(1, N, ReadCombin.GetStoredNumbers)) >= W Then
Total_1P_10D_Wins += 1
End If
If Modulus(DrawIndex, 15000) = 0 Then
UpdateStatus.ProgressPercentage = Int(DrawIndex / 150000)
UpdateStatus.ProgressIndex = TestIndex
UpdateStatus.ProgressInformation = Total_1P_10D_Wins.ToString & " | " & Total_10P_1D_Wins.ToString & " | "
If Total_1P_10D_Wins = Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "None | 0"
End If
If Total_1P_10D_Wins > Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "1P 10D | " & Math.Abs(Total_1P_10D_Wins - Total_10P_1D_Wins).ToString
End If
If Total_1P_10D_Wins < Total_10P_1D_Wins Then
UpdateStatus.ProgressInformation &= "10P 1D | " & Math.Abs(Total_1P_10D_Wins - Total_10P_1D_Wins).ToString
End If
worker.ReportProgress(0, UpdateStatus)
End If
Next
Next
UpdateStatus.ProgressPercentage = 0
UpdateStatus.ProgressIndex = -1
UpdateStatus.ProgressInformation = "Complete"
worker.ReportProgress(0, UpdateStatus)
End Sub
Enum WriteCombin
Add = True
Remove = False
End Enum
Enum ReadCombin
GetStoredNumbers = True
GetNotStoredNumbers = False
End Enum
Enum BitState As Byte
ClrBit = 0
SetBit = 1
TogBit = 2
ExmBit = 3
End Enum
Function Modulus(ByVal a As Double, ByVal b As Double) As Long
Modulus = a - b * Int(a / b)
End Function
Function RandomLowerUpper(ByVal L As Long, ByVal U As Long) As Long
RandomLowerUpper = Int(Rnd() * (U - (L - 1))) + L
End Function
Function Fact(ByVal N As Integer) As Double
If (N <= 1) Then
Fact = 1
Else
Fact = N * Fact(N - 1)
End If
End Function
Function Perm(ByVal N As Integer, ByVal R As Integer) As Double
Dim a As Integer
Dim b As Double
b = 1
If (N < R) Then
Perm = 0
Else
For a = (N - (R - 1)) To N
b = b * a
Next a
Perm = b
End If
End Function
Function Comb(ByVal N As Integer, ByVal R As Integer) As Long
If (N < R) Then
Comb = 0
Else
Comb = Perm(N, R) / Fact(R)
End If
End Function
Function Cdist(ByVal N As Integer, ByVal R As Integer, ByVal C As Integer, ByVal Z As Integer) As Long
If ((Z < C) Or (Z > (N - (R - C))) Or (Z > N) Or (C > R) Or (N < 1) Or (R < 1) Or (C < 1) Or (Z < 1)) Then
Cdist = 0
Else
Cdist = Comb((Z - 1), (C - 1)) * Comb((N - Z), (R - C))
End If
End Function
Function fColumnSum(ByVal N As Integer, ByVal R As Integer, ByVal Z As Integer) As Long
Dim a As Integer
Dim ColumnSum As Double
If (Z < 1) Then
fColumnSum = 0
ElseIf ((Z >= 1) And (Z < (N - (R - 1)))) Then
ColumnSum = 0
For a = 1 To Z
ColumnSum = ColumnSum + Cdist(N, R, 1, a)
Next a
fColumnSum = ColumnSum
ElseIf (Z >= (N - (R - 1))) Then
fColumnSum = Comb(N, R)
End If
End Function
Function Index2Combin(ByVal N As Integer, ByVal R As Integer, ByVal I As Long) As String
Dim a, Combination(), Z As Integer
Dim J As Double
ReDim Combination(R)
Dim tmpString As String
Dim NumberFound As Boolean
tmpString = ""
J = I
J = J - 1
Z = 0
For a = 1 To R
If ((I >= 1) And (I <= Comb(N, R))) Then
If (a = 1) Then
Combination(a) = 1
Else
Combination(a) = Combination(a - 1) + 1
End If
NumberFound = False
Do
Select Case (J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1))))
Case Is < 0
Combination(a) = Combination(a) - 1
NumberFound = True
Case Is = 0
NumberFound = True
Case Is > 0
Combination(a) = Combination(a) + 1
End Select
Loop Until NumberFound
J = J - fColumnSum((N - Z), (R - (a - 1)), (Combination(a) - (Z + 1)))
Z = Combination(a)
Else
Combination(a) = 0
End If
tmpString = tmpString & Format(Combination(a), "00 ")
Next a
Index2Combin = tmpString
End Function
Function Combin2Index(ByVal N As Integer, ByVal R As Integer, ByVal Combination As String) As Long
Dim a As Integer
Dim fSum As Double
fSum = 1
For a = 1 To R
If (a = 1) Then
fSum = fSum + fColumnSum(N, R, (Val(Mid(Combination, 3 * a - 2, 2)) - 1))
Else
fSum = fSum + fColumnSum((N - Val(Mid(Combination, 3 * (a - 1) - 2, 2))), (R - (a - 1)), (Val(Mid(Combination, 3 * a - 2, 2)) - (Val(Mid(Combination, 3 * (a - 1) - 2, 2)) + 1)))
End If
Next a
Combin2Index = fSum
End Function
Sub WriteCombination(ByVal I As Integer, ByVal Combination As String, ByVal Add As Boolean)
Dim bytPos As Integer
Dim bitPos As Byte
Dim R As Integer
Dim Z As Integer
R = Int(Len(Combination) / 3)
If R <> 0 Then
For a As Integer = 1 To R
Z = CInt(Val(Mid(Combination, 3 * a - 2, 2)))
bytPos = CInt(IntPart(CDbl(Z) / 8))
bitPos = CByte(8 * DecPart(CDbl(Z) / 8))
If Add Then
Numbers(I, bytPos) = CSTEBit(BitState.SetBit, Numbers(I, bytPos), bitPos)
Else
Numbers(I, bytPos) = CSTEBit(BitState.ClrBit, Numbers(I, bytPos), bitPos)
End If
Next
End If
End Sub
Function ReadCombination(ByVal I As Integer, ByVal N As Integer, ByVal GetStoredValues As Boolean) As String
Dim tmpText As String = ""
Dim bytPos As Integer
Dim bitPos As Byte
For a As Byte = 1 To N
bytPos = CInt(IntPart(CDbl(a) / 8))
bitPos = CByte(8 * DecPart(CDbl(a) / 8))
If GetStoredValues Then
If CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos) = 1 Then
tmpText &= Format(a, "00 ")
End If
Else
If CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos) = 0 Then
tmpText &= Format(a, "00 ")
End If
End If
Next
ReadCombination = tmpText
End Function
Function CompareCombination(ByVal I As Integer, ByVal Combination As String) As Integer
Dim T As Integer = 0
Dim bytPos As Integer
Dim bitPos As Byte
For a As Integer = 1 To Int(Len(Combination) / 3)
bytPos = CInt(IntPart(CDbl(Val(Mid(Combination, 3 * a - 2, 2))) / 8))
bitPos = CByte(8 * DecPart(CDbl(Val(Mid(Combination, 3 * a - 2, 2))) / 8))
T += CSTEBit(BitState.ExmBit, Numbers(I, bytPos), bitPos)
Next
CompareCombination = T
End Function
Public Function CSTEBit(ByVal CSTE As Byte, ByVal Byt As Byte, ByVal Bit As Byte) As Byte
If Bit < 8 Then
Dim Mask As Byte = 2 ^ Bit
Select Case CSTE
Case BitState.ClrBit
Return Byt And Not Mask
Case BitState.SetBit
Return Byt Or Mask
Case BitState.TogBit
Return Byt Xor Mask
Case BitState.ExmBit
If ((Byt And Mask) > 0) Then
Return 1
Else
Return 0
End If
Case Else
Return Byt
End Select
Else
Return Byt
End If
End Function
Function IntPart(ByVal n As Double) As Integer
Select Case Math.Sign(n)
Case -1
Return Math.Ceiling(n)
Case 0
Return 0
Case 1
Return Math.Floor(n)
End Select
End Function
Function DecPart(ByVal n As Double) As Double
Select Case Math.Sign(n)
Case -1
Return (n - Math.Ceiling(n))
Case 0
Return 0
Case 1
Return (n - Math.Floor(n))
End Select
End Function
End Class_______________________________
Wow this is great..Just what tiggs has been looking for..Now on to bed and will study this in the AM..if tiggs wakes up...and if tiggs isen't lucky to wake up so be it..no more lotto tickets to worry about..to the end of the line tiggs....
Pure luck