Welcome Guest
Log In | Register )
You last visited December 6, 2016, 9:00 am
All times shown are
Eastern Time (GMT-5:00)

If you had 10 bucks to bet...

Topic closed. 132 replies. Last post 6 years ago by JADELottery.

Page 7 of 9
55
PrintE-mailLink

What do you think is the better bet?

1 Play / 10 Draws [ 58 ]  [64.44%]
10 Plays / 1 Draw [ 32 ]  [35.56%]
Total Valid Votes [ 90 ]  
Discarded Votes [ 3 ]  

United States
Member #75358
June 1, 2009
5345 Posts
Offline
Posted: April 12, 2011, 3:55 pm - IP Logged

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

    JADELottery's avatar - MeAtWork 03.PNG
    The Quantum Master
    West Concord, MN
    United States
    Member #21
    December 7, 2001
    3675 Posts
    Online
    Posted: April 12, 2011, 4:59 pm - IP Logged

    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.

    Eek

    Presented 'AS IS' and for Entertainment Purposes Only.
    Any gain or loss is your responsibility.
    Use at your own risk.

    Order is a Subset of Chaos
    Knowledge is Beyond Belief
    Wisdom is Not Censored
    Douglas Paul Smallish
    Jehocifer

      truecritic's avatar - PirateTreasure
      Michigan
      United States
      Member #22395
      September 24, 2005
      1583 Posts
      Offline
      Posted: April 12, 2011, 5:30 pm - IP Logged

      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?

        rdgrnr's avatar - walt
        Way back up in them dadgum hills, son!
        United States
        Member #73904
        April 28, 2009
        14903 Posts
        Offline
        Posted: April 12, 2011, 5:36 pm - IP Logged

        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.   Naughty


                                                     
                             
                                                 

         

         

         

         

                                                                                                           

        "The only thing necessary for evil to triumph is for good men to do nothing"

                                                                                                    --Edmund Burke

         

         

          tiggs95's avatar - Lottery-036.jpg

          United States
          Member #47420
          November 4, 2006
          3930 Posts
          Offline
          Posted: April 12, 2011, 6:06 pm - IP Logged

          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


            United States
            Member #75358
            June 1, 2009
            5345 Posts
            Offline
            Posted: April 12, 2011, 7:59 pm - IP Logged

            All famous celebrities do that!

            The question: is it better to have 10 people saying "we" or one person saying "we," 10 times?

            Green laugh

            Like I said before, i believe 10 people saying "WE" at once is better....

            I think he has a mouse in his pocket...lol


              United States
              Member #93947
              July 10, 2010
              2180 Posts
              Offline
              Posted: April 13, 2011, 12:48 am - IP Logged

              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.

                JADELottery's avatar - MeAtWork 03.PNG
                The Quantum Master
                West Concord, MN
                United States
                Member #21
                December 7, 2001
                3675 Posts
                Online
                Posted: April 13, 2011, 7:22 am - IP Logged

                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.

                Presented 'AS IS' and for Entertainment Purposes Only.
                Any gain or loss is your responsibility.
                Use at your own risk.

                Order is a Subset of Chaos
                Knowledge is Beyond Belief
                Wisdom is Not Censored
                Douglas Paul Smallish
                Jehocifer

                  truecritic's avatar - PirateTreasure
                  Michigan
                  United States
                  Member #22395
                  September 24, 2005
                  1583 Posts
                  Offline
                  Posted: April 13, 2011, 9:02 pm - IP Logged

                  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!  ROFL

                    JADELottery's avatar - MeAtWork 03.PNG
                    The Quantum Master
                    West Concord, MN
                    United States
                    Member #21
                    December 7, 2001
                    3675 Posts
                    Online
                    Posted: April 13, 2011, 10:10 pm - IP Logged

                    Looks great!

                    Just so you know: It is visible to me and I am not an Administrator!  ROFL

                    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.

                    Presented 'AS IS' and for Entertainment Purposes Only.
                    Any gain or loss is your responsibility.
                    Use at your own risk.

                    Order is a Subset of Chaos
                    Knowledge is Beyond Belief
                    Wisdom is Not Censored
                    Douglas Paul Smallish
                    Jehocifer

                      JADELottery's avatar - MeAtWork 03.PNG
                      The Quantum Master
                      West Concord, MN
                      United States
                      Member #21
                      December 7, 2001
                      3675 Posts
                      Online
                      Posted: April 13, 2011, 10:30 pm - IP Logged

                      Ok, 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.

                      Presented 'AS IS' and for Entertainment Purposes Only.
                      Any gain or loss is your responsibility.
                      Use at your own risk.

                      Order is a Subset of Chaos
                      Knowledge is Beyond Belief
                      Wisdom is Not Censored
                      Douglas Paul Smallish
                      Jehocifer

                        JADELottery's avatar - MeAtWork 03.PNG
                        The Quantum Master
                        West Concord, MN
                        United States
                        Member #21
                        December 7, 2001
                        3675 Posts
                        Online
                        Posted: April 13, 2011, 10:34 pm - IP Logged

                        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

                        _______________________________

                        Presented 'AS IS' and for Entertainment Purposes Only.
                        Any gain or loss is your responsibility.
                        Use at your own risk.

                        Order is a Subset of Chaos
                        Knowledge is Beyond Belief
                        Wisdom is Not Censored
                        Douglas Paul Smallish
                        Jehocifer

                          Avatar
                          Milwaukee, WI
                          United States
                          Member #3131
                          December 27, 2003
                          665 Posts
                          Offline
                          Posted: April 13, 2011, 11:14 pm - IP Logged

                          He said it right.....

                          IF I has 10 dollars!

                            rdgrnr's avatar - walt
                            Way back up in them dadgum hills, son!
                            United States
                            Member #73904
                            April 28, 2009
                            14903 Posts
                            Offline
                            Posted: April 13, 2011, 11:33 pm - IP Logged

                            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.   Stretch


                                                                         
                                                 
                                                                     

                             

                             

                             

                             

                                                                                                                               

                            "The only thing necessary for evil to triumph is for good men to do nothing"

                                                                                                                        --Edmund Burke

                             

                             

                              tiggs95's avatar - Lottery-036.jpg

                              United States
                              Member #47420
                              November 4, 2006
                              3930 Posts
                              Offline
                              Posted: April 14, 2011, 12:41 am - IP Logged

                              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