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

HELP! Macro to eliminate 5 match numbers

Topic closed. 20 replies. Last post 6 years ago by RJOh.

Page 1 of 2
PrintE-mailLink
Avatar
New Member
Nairobi
Kenya
Member #93075
June 21, 2010
16 Posts
Offline
Posted: October 23, 2010, 3:46 am - IP Logged

My local game is a pick 6 (6/49) game and so far it has 385 draws.

Taking the latest draw


17/10/2010 12 14 16 31 34 35

it has
12,14,16,31,34
12,14,16,31,35
12,14,16,34,35
12,14,31,34,35
12,16,31,34,35
14,16,31,34,35

How do I write a macro to eliminate all the above from possible 13,983,816 and then for all the remaining draws?

looping each draw then each of 13,983,816 looking for a 5 match number takes too long to compute.

Thank you

    Avatar

    United States
    Member #41846
    June 23, 2006
    459 Posts
    Offline
    Posted: October 23, 2010, 7:07 pm - IP Logged

    While it would be possible to remove these from a master list, it would be too time consuming.  at some point you will generate a list of  comb you want to consider. remove 5# matches from this list. the code below makes the following assumptions: 

     1.  col 1 thru 4 starting in line 1 has all of the previous draws

     2.  col 10-15 starting with line 1 has comb that you want to check for 5 # matches

     3.  if a match is found the entire comb is removed from the list

    as writen this code will only look at 1000 past draws and 1000 combinations to consider, easily changed however.

    the comments should give you the info you need to modify this anyway you would want. From your question I assume you know how to use a macro.

     

    Sub remove_5_no_comb()

    'outside loop through all previous draws col 1-6

    ' inner loop through potential comb col 10-15

    'if 5 # match reject/ remove comb

    Dim ol(49), il(49) ' dimensions two arrays to be used in program

    'start of outer loop

    For x = 1 To 1000 'make the high number much larger than your database

    For z = 1 To 49: ol(z) = 0: Next z ' reset this array to 0

    For t = 1 To 6: a = Cells(x, t): If a = z Then GoTo doneol ' out of data terminate outer loop

    ol(a) = 1: Next t ' this array has a 1 to represent each draw #

    'start the inner loop

    For y = 1 To 1000 ' make this exacly the number of possible comb or much higher

    For z = 1 To 49: il(z) = 0: Next z ' reset this array to 0 after every comb

    For t = 10 To 15: a = Cells(y, t): If a = 0 Then GoTo doneil ' out of data terminate loop

    il(a) = 1: Next t ' this array has a 1 to represent each draw #

    ' compare the two loops do 5 match?

    mt = 0: For z = 1 To 49: If ol(z) = 1 And il(z) = 1 Then mt = mt + 1' add 1 for each # that matches

    Next z: If mt > 4 Then Cells(y, 9) = 1 ' if mt is 5 or 6 then put a 1 in col 9 to be used later

    Next y ' next inner loop

    doneil:

    Next x ' next outer loop

    doneol:

    'remove possible comb that were marked

    For y = 1 To 1000: a = Cells(y, 9)

    If a = 1 Then GoSub rem_comb

    Next y

     

    Exit Sub

    rem_comb: ' remove cells 9-16 and shift everything up

    Range(Cells(y, 9), Cells(y, 16)).Select

    Selection.Delete Shift:=xlUp

    Return

    End Sub


      United States
      Member #93947
      July 10, 2010
      2180 Posts
      Offline
      Posted: October 23, 2010, 10:00 pm - IP Logged

      My local game is a pick 6 (6/49) game and so far it has 385 draws.

      Taking the latest draw


      17/10/2010 12 14 16 31 34 35

      it has
      12,14,16,31,34
      12,14,16,31,35
      12,14,16,34,35
      12,14,31,34,35
      12,16,31,34,35
      14,16,31,34,35

      How do I write a macro to eliminate all the above from possible 13,983,816 and then for all the remaining draws?

      looping each draw then each of 13,983,816 looking for a 5 match number takes too long to compute.

      Thank you

      Why would you want to eliminate any possible draws in the future?

      Just because they've been drawn once, doesn't mean they won't be drawn again.

      If not, I'd sure like to know why!

      Even if your lottery had a policy to reject all draws that have already been drawn,

      with millions of possibilities, have you figured out how old you would be before that

      policy would become a significant factor?  Smiley


        Avatar
        New Member
        Nairobi
        Kenya
        Member #93075
        June 21, 2010
        16 Posts
        Offline
        Posted: October 24, 2010, 5:56 am - IP Logged

        Thank you for your reply Phileight and Jimmy4164.

        Let me have a close look on the macro.

          RJOh's avatar - chipmunk
          mid-Ohio
          United States
          Member #9
          March 24, 2001
          19830 Posts
          Offline
          Posted: October 24, 2010, 7:09 pm - IP Logged

          Why would you want to eliminate any possible draws in the future?

          Just because they've been drawn once, doesn't mean they won't be drawn again.

          If not, I'd sure like to know why!

          Even if your lottery had a policy to reject all draws that have already been drawn,

          with millions of possibilities, have you figured out how old you would be before that

          policy would become a significant factor?  Smiley


          He wouldn't be just eliminating any possible draws in the future but the most unlikely draws in the future.  If you checked the history of any 6/49 game you'll find combinations of five seldom repeat so with each combinations of six, you can eliminate over 250 other combinations of sixes that are unlikely to be drawn and be right over 90% of the time.  However that's a small drop in the bucket when you consider the fact that there are almost 14 millions possible combinations.

           * you don't need to buy more tickets, just buy a winning ticket * 
             
                       Evil Looking       


            United States
            Member #93947
            July 10, 2010
            2180 Posts
            Offline
            Posted: October 24, 2010, 11:31 pm - IP Logged

            He wouldn't be just eliminating any possible draws in the future but the most unlikely draws in the future.  If you checked the history of any 6/49 game you'll find combinations of five seldom repeat so with each combinations of six, you can eliminate over 250 other combinations of sixes that are unlikely to be drawn and be right over 90% of the time.  However that's a small drop in the bucket when you consider the fact that there are almost 14 millions possible combinations.

            RJOh,

            "...the most unlikely draws..."

            "...unlikely to be drawn..."

            Why?

            --Jimmy4164

              RJOh's avatar - chipmunk
              mid-Ohio
              United States
              Member #9
              March 24, 2001
              19830 Posts
              Offline
              Posted: October 25, 2010, 1:16 am - IP Logged

              RJOh,

              "...the most unlikely draws..."

              "...unlikely to be drawn..."

              Why?

              --Jimmy4164

              I checked the 557 drawings of Ohio Classic Lotto (6/49) and found only 3 combinations of five had repeated and when I combined those drawings with those of the old Ohio Super Lotto game, only 10 combination of five had repeated in those 1131 drawings. 

              That was more than I expected since the odds of matching 5of6 in a 649 game are 1:54,201 but never the less it showed the chances of matching a combination of five more than once had been 10:1131 or less than 1:100 thus my conclusion was it was unlikely to happen 90% of the time in the immediate future.

               * you don't need to buy more tickets, just buy a winning ticket * 
                 
                           Evil Looking       


                United States
                Member #93947
                July 10, 2010
                2180 Posts
                Offline
                Posted: October 25, 2010, 11:50 am - IP Logged

                I checked the 557 drawings of Ohio Classic Lotto (6/49) and found only 3 combinations of five had repeated and when I combined those drawings with those of the old Ohio Super Lotto game, only 10 combination of five had repeated in those 1131 drawings. 

                That was more than I expected since the odds of matching 5of6 in a 649 game are 1:54,201 but never the less it showed the chances of matching a combination of five more than once had been 10:1131 or less than 1:100 thus my conclusion was it was unlikely to happen 90% of the time in the immediate future.

                (Assuming the generally accepted definitions of "unlikely" and "immediate,")

                The way you stated it, "unlikely to happen 90% of the time in the immediate future" is true.

                However, ON ANY GIVEN DAY, the chances that one of the 6 combos of 5 on your (6,49) ticket

                matching one of the 6 determined by what the lottery draws, is STILL, 1:54,201.

                  RJOh's avatar - chipmunk
                  mid-Ohio
                  United States
                  Member #9
                  March 24, 2001
                  19830 Posts
                  Offline
                  Posted: October 26, 2010, 6:26 pm - IP Logged

                  (Assuming the generally accepted definitions of "unlikely" and "immediate,")

                  The way you stated it, "unlikely to happen 90% of the time in the immediate future" is true.

                  However, ON ANY GIVEN DAY, the chances that one of the 6 combos of 5 on your (6,49) ticket

                  matching one of the 6 determined by what the lottery draws, is STILL, 1:54,201.

                  ON ANY GIVEN DAY,  any of the nearly 14 millions combinations could come up.  If you're only playing a few lines then you aren't trying to cover every possible result but only a few of the most likely results.

                   * you don't need to buy more tickets, just buy a winning ticket * 
                     
                               Evil Looking       


                    United States
                    Member #93947
                    July 10, 2010
                    2180 Posts
                    Offline
                    Posted: October 26, 2010, 10:37 pm - IP Logged

                    ON ANY GIVEN DAY,  any of the nearly 14 millions combinations could come up.  If you're only playing a few lines then you aren't trying to cover every possible result but only a few of the most likely results.

                    RJOh,

                    When you write  "...only a few of the most likely results,"  you reveal the mode of thinking which is hampering your ability to clearly see the impossibility of knowing WHICH few are more likely, OR if ANY are more likely.  This might help you to see what I'm driving at:

                    http://en.wikipedia.org/wiki/Clustering_illusion

                    --Jimmy4164

                    P.S.  I've alluded to AND pointed to this phenomenon in several other posts, but no one has engaged with it.  I hope you will be the first.

                      RJOh's avatar - chipmunk
                      mid-Ohio
                      United States
                      Member #9
                      March 24, 2001
                      19830 Posts
                      Offline
                      Posted: October 27, 2010, 9:32 am - IP Logged

                      When I said likely, I simply meant that they weren't part of the unlikely group that would match four of previous drawn combinations which I observed only came up 1% of the time in a 649 game.  As I said before those combinations are just a drop in the bucket when you consider there are almost 14 millions possible combinations even though there are 13545 possible combinations that would match4 for every combination of 6 drawn.

                      When dealing that many possible combinations, there are always going to be some assumptions which is probably why so many players prefer pick3 games with only a 1000 possible combinations.

                       * you don't need to buy more tickets, just buy a winning ticket * 
                         
                                   Evil Looking       


                        United States
                        Member #93947
                        July 10, 2010
                        2180 Posts
                        Offline
                        Posted: October 27, 2010, 6:07 pm - IP Logged

                        When I said likely, I simply meant that they weren't part of the unlikely group that would match four of previous drawn combinations which I observed only came up 1% of the time in a 649 game.  As I said before those combinations are just a drop in the bucket when you consider there are almost 14 millions possible combinations even though there are 13545 possible combinations that would match4 for every combination of 6 drawn.

                        When dealing that many possible combinations, there are always going to be some assumptions which is probably why so many players prefer pick3 games with only a 1000 possible combinations.

                        RJOh,

                        "None of us really likes to admit being wrong. One of the most seductive ways to avoid that is to change our opinions retroactively. We say, 'No, no, you just misunderstood, you thought I was saying X when I really said Y.' Or, even worse, sometimes we just stubbornly refuse to acknowledge the evidence in front of us."

                        Dean Esmay,  April 17, 2002

                        http://www.deanesmay.com/posts/000656.html

                        --Jimmy4164

                          RJOh's avatar - chipmunk
                          mid-Ohio
                          United States
                          Member #9
                          March 24, 2001
                          19830 Posts
                          Offline
                          Posted: October 28, 2010, 12:06 am - IP Logged

                          RJOh,

                          "None of us really likes to admit being wrong. One of the most seductive ways to avoid that is to change our opinions retroactively. We say, 'No, no, you just misunderstood, you thought I was saying X when I really said Y.' Or, even worse, sometimes we just stubbornly refuse to acknowledge the evidence in front of us."

                          Dean Esmay,  April 17, 2002

                          http://www.deanesmay.com/posts/000656.html

                          --Jimmy4164

                          If you noticed the prediction board this evening, you saw I put into practice what I've been saying in my posts in my predictions for Ohio Classic Lotto with 10 lines. 

                          The winning numbers for 10/27 were  29 31 34 36 45 47

                          I posted:

                           27 29 30 34 39 48
                           18 23 32 33 36 44
                           19 25 31 42 45 47
                           14 20 26 30 31 49
                           05 11 26 30 33 36
                           13 14 25 33 36 43
                           27 31 32 39 46 49
                           10 13 14 34 42 44
                           18 26 27 45 46 49
                           25 26 29 34 42 47

                          Everyone of those lines had at least one winning number in it, but I couldn't get more than three of them together in one line, but I'm getting better with my so called illusions.  With a little luck or more lines, I could have had a big winner.  Results say more than a bunch of words.

                           * you don't need to buy more tickets, just buy a winning ticket * 
                             
                                       Evil Looking       


                            United States
                            Member #93947
                            July 10, 2010
                            2180 Posts
                            Offline
                            Posted: October 28, 2010, 1:32 am - IP Logged

                            If you noticed the prediction board this evening, you saw I put into practice what I've been saying in my posts in my predictions for Ohio Classic Lotto with 10 lines. 

                            The winning numbers for 10/27 were  29 31 34 36 45 47

                            I posted:

                             27 29 30 34 39 48
                             18 23 32 33 36 44
                             19 25 31 42 45 47
                             14 20 26 30 31 49
                             05 11 26 30 33 36
                             13 14 25 33 36 43
                             27 31 32 39 46 49
                             10 13 14 34 42 44
                             18 26 27 45 46 49
                             25 26 29 34 42 47

                            Everyone of those lines had at least one winning number in it, but I couldn't get more than three of them together in one line, but I'm getting better with my so called illusions.  With a little luck or more lines, I could have had a big winner.  Results say more than a bunch of words.

                            RJOh,

                            "With a little luck  or more lines, I could have had a big winner."

                            Me too!

                            --Jimmy4164

                            P.S.  Do you really think the results of 10 lines in one draw in a game with this many possibilities is of any significance?  If you had matched all six it would have proved no more than that your ship came in.  I don't think you read very carefully the "bunch of words" I referred you to.



                              RL-RANDOMLOGIC's avatar - usafce

                              United States
                              Member #59354
                              March 13, 2008
                              3972 Posts
                              Offline
                              Posted: November 1, 2010, 3:27 pm - IP Logged

                              If you noticed the prediction board this evening, you saw I put into practice what I've been saying in my posts in my predictions for Ohio Classic Lotto with 10 lines. 

                              The winning numbers for 10/27 were  29 31 34 36 45 47

                              I posted:

                               27 29 30 34 39 48
                               18 23 32 33 36 44
                               19 25 31 42 45 47
                               14 20 26 30 31 49
                               05 11 26 30 33 36
                               13 14 25 33 36 43
                               27 31 32 39 46 49
                               10 13 14 34 42 44
                               18 26 27 45 46 49
                               25 26 29 34 42 47

                              Everyone of those lines had at least one winning number in it, but I couldn't get more than three of them together in one line, but I'm getting better with my so called illusions.  With a little luck or more lines, I could have had a big winner.  Results say more than a bunch of words.

                              RJOH

                              I once read in the Bible that God caused a ass to speak. I though it was fable but now think it could

                              be Quite true.  My wife has a system of hitting 2 or 3 numbers on one line with about 75%  hit rate.

                              The odds for any one drawing are for selecting a set at random,  does this mean that if the set is not

                              selected at random the odds do not apply?  Way back, when I first studied statistics it was used by

                              applying certian data to the masses.  If it is used to calculate a single event or small sample  then it is

                              very often missleading.  A simple coin toss can explain this. The odds are 50/50 not counting the

                              chance that it could land on it's edge, but it is quite possible for 10 heads up to appear in 10 tosses. 

                              Given that each toss has a 50/50 chance and that the expected average for 10 tosses would be 50%

                              heads and 50% tails +/- some deviation then 10 straight heads would lead me to think that some

                              sort of unknown exist within the method of tossing the coin.  This could easily be explained away by

                              using probability but the exact cause could never be proven.  The number of unknown variables that

                              could effect the outcome of the toss could never be known.   However these same unknown variables

                              creat a bias for one outcome verses the other.  Certain people do not understand what they think they

                              know so well.  I like the Wikipedia definition of Probability  "A way of expressing knowledge or belief

                              that an event will or has occurred.  To draw conclusions about the likelihood of potential events and the

                              underlying mechanics of complex systems."   The words "Belief and likelihood" are the kickers here.  The

                              only true measure of any method would be if the outcome beats the predicted odds for the event.  The

                              results you posted have done this.  This would be the end of the story for most but not for those fooled 

                              by the "fooled by randomness"  joke.   Just as probability was meant to be used as a tool to help give

                              some idea of an event happening, the fooled by randomness is a poor excuse that is used when the

                              results don't match the expected outcome.  Ping pong balls bouncing off one another and air being

                              used to blow the balls around have nothing to do with selecting the numbers for the next drawing.  The

                              balls have no memory but who cares as it has nothing to with selecting numbers.  I have seen numbers

                              go more then 100 draws without hitting.  We that pick or own numbers are not predicting what will 

                              happen but rather play what we think or beleive will happen.  Those that beleive that they can predict

                              that the numbers we play will fail are the ones that should take a good look at just what they are saying

                              and how two faced it really is. 

                               

                              RL

                              Working on my Ph.D.  "University of hard Knocks"

                              I will consider the opinion that my winnings are a product of chance if you are willing to consider

                              they are not.  Many great discoveries come while searching for something else

                              USAF https://en.wikipedia.org/wiki/Prime_Base_Engineer_Emergency_Force

                                US Flag Trump / 2016 & 2020