General Discussions

Discuss any topics that are not product-specific here.

Lottery Frequency

sammyb84
8 - Asteroid

I am trying to play a set of numbers within a lottery game of my state and would like to try my luck at highest frequency set (combination) of numbers.

I have tried to sort each column of separate numbers but this doesn't capture those set of numbers that have a different sequence and therefore fall in a different column.

I then tried to concatenate everything and use parsing to identify highest frequency of 2,3 and 4 sets(if available) of combinations.

 

I attached the same data set as below as a picture so you could see the highlighted pairs.

 

Thanks for looking and Best of luck of your playing the lottery :) 

 
 
DateNum1Num2 Num3Num4
5/14/20242436462
5/9/20245101423
5/7/2024711346
5/5/20249215
5/3/202411421469
4/8/20243638269
5/13/20241131820
4/27/20241714201
4/25/202419693335
4/23/202421122325
4/21/2024231415
4/19/202425162931
4/17/2024271815
4/19/202425211323
 

Ideal Output:

 

Num1Num2 Num3Num4Frequency
236  2
113  2
15  3
212325 2
9 REPLIES 9
KGT
8 - Asteroid

What you're looking for here is Transpose. You can then sort the data however you want and use multi-row to assign a new ID ([Row-1:Field]+1) grouping by your date. Then cross tab back using the assigned ID as the column headers will put it in the right order. Take a look at the attached

 

I'm not sure how the lottery works where you are, but a lot of the time there is a jackpot prize, and whoever gets the right numbers splits the prize with whoever else got the numbers. Hence, the ONLY real strategy in that scenario is to try split it with the least people, so pick combinations that few people pick.

 

As an example, I remember when the multiples of 7 came out as the 6 balls in the Australian lotto (back in the '90's), 44 people split a couple mill. Getting 5 numbers paid $26. This was because many people had those multiples (and it used to only be from 40 balls, and so a lot of people had 7,14,21,28,35 + a random number that they played for years).

 

Best of luck with it! Half the fun is the working it out!

sammyb84
8 - Asteroid

@KGT Thanks for this.  I think this was as far as I was able to get but how do we get the #'s to line up in the same columns that dont have the same sequence?

For example 1, 13 may fall in columns 1 and 2 but the next drawing sequence could have a middle number that separates the combination even though those 2 numbers were a winning combination.

Hope that makes sense.  And totally with you that, its all fun!  Thanks for your knowledge share

KGT
8 - Asteroid

Gotcha, missed the 2,3,4 combinations piece. Take a look at the attached for sets of 3, obviously sets of 2 can just be taken off before this. For small combos like this, this method works easy enough.

 

There are other methods (Batch macros, other sorting methods) to scale easier if you wanted more combos, but it gets unnecessarily complicated for this analysis.

Yoshiro_Fujimori
15 - Aurora

Hi @sammyb84 , @KGT ,

 

Please let me join the fun event :)

I tried a batch macro solution as below.

(It may be able to make it more flexible so that it can deal with any number of sets, but I would save it for later.)

 

Main

1272826_Main.png

Macro for 2 sets

1272826_Macro_2sets.png

Output for 2 sets

ValueFrequency
1,53

 

Macro for 3 sets

1272826_Macro_3sets.png

Output for 3 sets

ValueFrequency
14,23,52
21,23,252
sammyb84
8 - Asteroid

@Yoshiro_Fujimori Thank you for taking the time for this and welcome to the party.  This seems to give me the output I am looking for.  I need to study up more on Macros but essentially it seems you are reordering the numbers so that matching combinations could be identified.  I didn't even notice that 5,14,23 had a matching combination. Can you tell me why you didn't do the same macro for 4 sets? Does the filter not work as in Num1 < Num2 and Num2 < Num3 and Num3 < Num4?

sammyb84
8 - Asteroid

Hey @KGT ,

I am a bit confused with the output, I wasn't sure how I could use it.  Thanks for all your feedback on this.

Yoshiro_Fujimori
15 - Aurora

Hi @sammyb84 ,

 

 

Re your question:

> Can you tell me why you didn't do the same macro for 4 sets?

 

When we select 2 numbers from one row (which has 4 distinct numbers), there are 6 combinations (4C2 = 6).

When we select 3 numbers, there are 4 combinations (4C3 = 4).

So I needed to generate one row for each combination with the batch macro.

 

When we select 4 numbers , there is only one combination (naturally because we select all numbers).

So I do not need to generate rows separately. I can simply use the original row.

The numbers are sorted in ascending order with the Sort Tool right before the Summarize Tool.

 

I hope this answered your question.

 

KGT
8 - Asteroid

I didn't put the summarise on the end. You may need to summarise by everything except ComboID to essentially unique any combos. and then you can summarise just the groups of numbers with count to see which are most common.

 

My answer and @Yoshiro_Fujimori answer are very similar, except his is more polished.

sammyb84
8 - Asteroid

Yes @Yoshiro_Fujimori , makes sense.  Thank you for the explanation and education. :) 

Be blessed.

Labels