Utilizing Synthetic Intelligence Strategies And SQL To Optimize A Lottery Utility

Synthetic Intelligence or “AI” might be outlined because the “capacity of a system to be taught from earlier expertise in an try and predict future occasions”. Whereas this might sound a forlorn hope in making lottery predictions, let’s have a look at if this may be doable.

The massive downside in analysing lottery outcomes is the massive variety of doable mixtures. In a typical “40 x 6” ball sport there are three,838,380 traces to select from.

Producing A Beginning Level For A Lotto AI System

It is smart to scale back the doable quantity pool earlier than we implement any AI prospects. I am going to use the “Prime” chance system which assumes there shall be 2 primes, 1 odd and three even numbers in every profitable line.

We’ll attempt to use AI to group the prime outcomes into some sort of sample after they do happen.

For instance, the final 6 weeks outcomes of NZ Lotto have been:







The numbers in outcomes 2,three,four and 6 meet the prime system standards so we solely wish to have a look at these traces. If we will set up a sample inside the prime outcomes then we will drastically scale back our mixtures for when the prime system numbers come up.

We’ll use the Structured Question Language Prediksi Togel, or SQL, to question the prime system database of all doable lottery mixtures; a complete 575,586 traces of 6 numbers.

The construction of the database is as follows:

Quantity sorts: prime,prime,odd,even,even,even

Column title: n1,n2,n3,n4,n5,n6

For instance:


Utilizing A SQL Question To Acknowledge The Lottery Sample

What I am going to do is create a SQL question that selects every line of profitable prime system numbers. We are able to then mix the queries in an “and/or” assertion to cowl the completely different eventualities.

On this means, we will be taught the commonalities between the completely different outcomes, identical to an actual life AI software.

Many of the prime outcomes above contained at the least one quantity divisible by four. We are able to cowl that situation with this question:

n4percent4=zero or n5percent4=zero or n6percent4=zero
Data returned: 525,690

The % image is a particular code in SQL which provides us the rest from dividing the 2 numbers.

Every prime line seems to have at the least two numbers inside four of one another. We’ll cowl that chance like this:



Data returned: 305,316

We are able to now mix the queries with the next command:

(n4percent4=zero or n5percent4=zero or n6percent4=zero)







The mixed question returned 276,210 mixtures, a discount of round 40%, which is pretty spectacular.

I seen the primary even quantity was at all times equal to or lower than 14 and once I factored that parameter in, the mixtures returned have been 165,726.

In future weeks I am going to have a look at different widespread elements, for instance excluding numbers from latest outcomes.


This text explored the opportunity of utilizing AI methods and SQL to scale back doable mixtures. By analysing outcomes that meet sure parameters it must be doable to scale back line numbers and enhance our lottery probabilities.

Leave a Reply

Your email address will not be published. Required fields are marked *