The Lottery and Chaotic Systems - OfficinaTurini

Go to content
The Italian Lotto: 155 years of numbers under examination
The Lottery and Chaotic Systems
This small article about the Italian Lotto came about, so to speak, through a rather unlikely chain of events.


People who know me also know that I work intensively with artificial-intelligence systems. Sooner or later the inevitable question had to arrive: “What can AI do with the Lotto?” The unspoken meaning was just as clear: could it finally find the formula, the method or the “solution” that reveals the numbers of the next draw?


My first answer was very simple: absolutely nothing. If the draw is genuinely random and independent, artificial intelligence has no magic shortcut that can turn chance into information about the future. A sophisticated model can discover structure when structure exists; it cannot manufacture information that the generating process does not contain.


So yes, I gave him five numbers—which obviously won't come up—but the question shifted to something else: if AI cannot be used to predict the Lotto, can it be used to study it seriously?


That is where this project began. Searching for the archives, building the software, checking the data, designing the statistical tests and generating the reports became a small experiment in which AI was used as a working tool, not as an oracle. The discovery of a draw archive spanning 1871 to 2026 made the opportunity far too interesting to ignore.


I am not a Lotto player, although I can understand its appeal. The beautiful goddess Fortune suddenly deciding to kiss you is certainly an attractive image. But for many years of my professional life I have repeatedly run into randomness, noise and chaos; the possibility of putting such a long sequence of numbers under the microscope inevitably caught my curiosity.

Mathematics and statistics are hardly the public's favourite subjects. Yet the Lotto seems to push things to the opposite extreme: connections appear everywhere, from Gödel to Freud, overdue numbers, dates, anniversaries, dreams and number traditions. Culturally this is fascinating; scientifically it is also ideal ground for turning a coincidence into a rule and a suggestion into pseudoscience.

Paradoxically, a request born from the hope that artificial intelligence might predict the future therefore turned into something I find much more interesting: using data, mathematics, statistics and open code to test what the past actually allows us to say.


Are the draws regular, or are they rigged?

Statistics cannot certify in an absolute sense that a system is “not rigged”. It can, however, look for fingerprints that an irregular process would tend to leave behind: distorted frequencies, temporal dependence, correlations between wheels, anomalies in extraction positions, delays incompatible with theory, or persistent changes in specific periods. The testable scientific question therefore becomes: are the observed data compatible with uniform and independent draws?


A little history

The Italian Lotto traces its roots to sixteenth-century Genoa, where bets were placed on the names that would be drawn for public offices. Over time the game spread throughout the Italian states and became a cultural phenomenon as well as a source of public revenue.

For our archive, the wheel chronology matters. In 1871 the data contain Florence, Milan, Naples, Palermo, Rome, Turin and Venice; Bari appears in 1874; Cagliari and Genoa in 1939; the National wheel begins on 4 May 2005. These dates match the chronology reported by the official Lotto website.

The draw cadence also changes. For decades draws were weekly; in 1997 regulations allowed multiple weekly draws and the archive shows the shift to roughly two per week. A third weekly draw started on 21 June 2005. Additional weekly draws were established in 2023 to support emergency funding after the floods; from 2025 the Friday draw became a permanent statutory feature. The 2020 drop must also be read in the context of public-gaming suspensions during the Covid-19 emergency.

How the draw works today

Today the Lotto uses 11 wheels. Five numbers from 1 to 90 are drawn for each wheel. Draws are concentrated in three sites: Rome handles Rome, Cagliari, Florence and the National wheel; Milan handles Milan, Genoa, Turin and Venice; Naples handles Naples, Palermo and Bari.
The move to automated draws began in May 2005 with Rome and the National wheel and was completed in 2009. The general regulation published in 2026 states that draws performed through electronic urns, together with the preparatory operations, are public and take place in the presence of a Supervisory Commission; subsequent validation operations are handled by a Control Commission.


Our archive
Questo piccolo articolo riguardante il Lotto è, per così dire, capitato per una serie piuttosto rocambolesca di eventi.

Chi mi conosce sa che lavoro assiduamente con sistemi di intelligenza artificiale.
Era quindi quasi inevitabile che, prima o poi, qualcuno mi facesse la domanda: “Ma con l'IA, sul Lotto, che cosa si può fare?” Il sottinteso era altrettanto evidente: trovare finalmente la formula, il metodo o la “soluzione” capace di indicare i numeri della prossima estrazione.

La mia prima risposta è stata molto semplice: un bel nulla. Se l'estrazione è realmente casuale e indipendente, l'intelligenza artificiale non possiede una scorciatoia magica che trasformi il caso in informazione sul futuro. Un modello sofisticato può trovare strutture nei dati quando quelle strutture esistono; non può fabbricare informazione che il processo non contiene.

Però mi dispiaceva liquidare così la curiosità di chi me lo aveva chiesto.
E allora si gli ho dato cinque numeri, che ovviamente non usciranno, ma la domanda è diventata un'altra: se non possiamo usare l'IA per prevedere il Lotto, possiamo usarla per studiarlo seriamente?

Da qui è partito tutto. La ricerca degli archivi, la costruzione del software, i controlli sui dati, i test statistici e la generazione dei report sono diventati un piccolo esperimento nel quale l'IA è stata usata come strumento di lavoro, non come oracolo. E la scoperta della disponibilità di un archivio delle estrazioni che parte dal 1871 e arriva al 2026 ha reso l'occasione troppo interessante per lasciarla perdere.

Non sono un giocatore del Lotto, anche se gli riconosco un certo fascino. La bellissima dea Fortuna che improvvisamente decide di baciarci è sicuramente un'immagine interessante. Ma per molti anni della mia vita professionale ho sbattuto la faccia contro casualità, rumore e caos; poter mettere sotto il microscopio una sequenza così lunga di numeri ha inevitabilmente acceso la mia curiosità.

Matematica e statistica non sono affatto amate dal grande pubblico. Eppure, quando si parla di Lotto, si raggiunge quasi l'apice dell'impossibile: compaiono connessioni di ogni genere, da Gödel a Freud, numeri ritardatari, date, ricorrenze, sogni e Smorfie. Culturalmente è un mondo affascinante; scientificamente è anche un terreno perfetto per trasformare una coincidenza in una regola e una suggestione in pseudoscienza.

Così, paradossalmente, una richiesta nata dalla speranza che l'intelligenza artificiale potesse prevedere il futuro si è trasformata in qualcosa che considero molto più interessante: usare dati, matematica, statistica e codice aperto per verificare che cosa il passato ci permette davvero di dire.

Le estrazioni sono regolari o sono truccate?

La statistica non può certificare in senso assoluto che un sistema sia “non truccato”. Può però cercare le impronte che un processo irregolare tenderebbe a lasciare: frequenze distorte, dipendenze temporali, correlazioni tra ruote, anomalie nelle posizioni di uscita, ritardi incompatibili con il modello teorico o cambiamenti persistenti in specifiche epoche. La domanda scientificamente verificabile diventa quindi: i dati osservati sono compatibili con estrazioni uniformi e indipendenti?

Un po' di storia

Il Lotto italiano affonda le proprie radici nella Genova del XVI secolo, dove si scommetteva sui nomi che sarebbero stati estratti per ricoprire cariche pubbliche. Nel tempo il gioco si diffuse nella penisola e divenne un fenomeno non solo fiscale ma anche culturale.

Per il nostro archivio la cronologia delle ruote è particolarmente importante: nel 1871 sono presenti Firenze, Milano, Napoli, Palermo, Roma, Torino e Venezia; Bari compare nel 1874; Cagliari e Genova nel 1939; la ruota Nazionale arriva il 4 maggio 2005. Queste date coincidono con la cronologia riportata dal sito ufficiale del Lotto.

Anche la cadenza cambia. Per decenni l'estrazione è settimanale; nel 1997 la normativa consente più estrazioni alla settimana e l'archivio mostra il passaggio a circa due appuntamenti settimanali. Dal 21 giugno 2005 viene introdotta la terza estrazione. Nel 2023 vengono istituite estrazioni aggiuntive per finanziare gli interventi legati all'emergenza alluvionale; dal 2025 l'estrazione del venerdì diventa strutturale per legge. Il calo osservato nel 2020 va inoltre letto nel contesto delle sospensioni dei giochi pubblici durante l'emergenza Covid-19.

Come funziona l'estrazione oggi

Attualmente, il gioco del Lotto prevede 11 ruote. Per ciascuna ruota vengono estratti cinque numeri compresi tra 1 e 90. Le operazioni di estrazione sono concentrate in tre sedi: Roma gestisce le ruote di Roma, Cagliari, Firenze e la Nazionale; Milano gestisce quelle di Milano, Genova, Torino e Venezia; Napoli gestisce quelle di Napoli, Palermo e Bari.
Il passaggio alle estrazioni automatizzate è iniziato nel maggio 2005 con le ruote di Roma e la Nazionale ed è stato completato nel 2009. Il regolamento generale stabilisce che le estrazioni effettuate tramite urne elettroniche, unitamente alle operazioni preliminari, sono pubbliche e si svolgono alla presenza di una Commissione di Vigilanza; le successive operazioni di convalida sono affidate a una Commissione di Controllo.

Il nostro archivio

Righe-ruota / Wheel rows
Date distinte / Distinct draw dates
Periodo / Period
Ruote / Wheels
105,297
10,925
1871-01-07
2026-09-11
11
Come abbiamo cercato le anomalie

Abbiamo prima verificato l'integrità dell'archivio e poi applicato una batteria di test indipendenti per obiettivo:
  • uniformità dei 90 numeri su ogni ruota;
  • uniformità delle cinque posizioni di uscita;
  • indipendenza tra estrazioni consecutive della stessa ruota;
  • indipendenza tra ruote nella stessa data;
  • distribuzione dei ritardi rispetto alla legge geometrica;
  • ripetizione del test di uniformità in sette epoche storiche.

Quando vengono eseguiti molti test, qualche p-value piccolo compare per puro caso. Per questo i risultati sono giudicati dopo correzione di Holm per confronti multipli, non scegliendo a posteriori soltanto i numeri più “interessanti”.

Risultati in sintesi

Il risultato complessivo è sorprendentemente semplice: nessuna delle anomalie testate sopravvive alla correzione per confronti multipli al livello 0,05.

Questo non dimostra che in 155 anni non sia mai potuto accadere nulla di irregolare, né sostituisce un audit fisico delle procedure. Dice però una cosa precisa: entro la sensibilità dei test applicati, l'archivio non mostra una firma statistica incompatibile con estrazioni uniformi e indipendenti.
How we looked for anomalies

We first audited the archive and then applied a battery of tests, each aimed at a different possible fingerprint:
  • uniformity of the 90 numbers on each wheel;
  • uniformity of the five extraction positions;
  • independence between consecutive draws of the same wheel;
  • independence between wheels on the same date;
  • delay distribution versus the geometric law;
  • repetition of the uniformity test across seven historical epochs.

When many tests are run, a few small p-values appear by chance alone. Results are therefore judged after a Holm multiple-testing correction, rather than cherry-picking only the most “interesting” numbers after the fact.

Results at a glance

The overall result is surprisingly simple: none of the tested anomalies survives the multiple-testing correction at the 0.05 level.
This does not prove that nothing irregular could ever have happened during 155 years, nor does it replace a physical audit of the procedures. It does establish a narrower and defensible result: within the sensitivity of the tests applied, the archive shows no statistical fingerprint incompatible with uniform and independent draws.
Famiglia di test
Test family
N test
min p raw
min p Holm
Significativi dopo Holm
Significant after Holm
Uniformità numeri / Number uniformity
11
0.02942
0.32361
0
Posizioni / Positions
55
0.02169
1.00000
0
Indipendenza temporale / Serial independence
11
0.13576
1.00000
0
Ruota vs ruota / Wheel vs wheel
55
0.00916
0.50394
0
Ritardi / Delays
11
0.17465
1.00000
0
Epoche / Epochs
71
0.00306
0.21746
0
Il p-value grezzo più piccolo dell’intero studio compare nell’analisi per epoche; proprio perché vengono effettuati 71 confronti, dopo Holm non è significativo. È un esempio concreto del motivo per cui non si deve scegliere il “numero più strano” dopo aver guardato centinaia di possibilità.

Cosa possiamo concludere — e cosa no

La conclusione riguarda i dati e i test applicati. Non certifica materialmente urne, palline, software o catena di custodia; non può rilevare un’ipotetica manipolazione costruita apposta per lasciare invarianti queste statistiche; e dipende dall’accuratezza storica dell’archivio di partenza. L’audit interno verifica coerenza e struttura, non può autenticare autonomamente ogni trascrizione ottocentesca.


La formulazione corretta è quindi:

Nell’archivio storico esaminato non emergono deviazioni statisticamente significative dal comportamento atteso per estrazioni uniformi e indipendenti, entro la sensibilità dei test applicati.

Riproducibilità

Non chiediamo al lettore di fidarsi. Il dataset, i sorgenti, i risultati intermedi e tutti i report HTML sono distribuiti insieme all'articolo. Ogni numero pubblicato qui può essere rigenerato.
L'intelligenza artificiale ha partecipato alla progettazione del codice, all'organizzazione dell'analisi e alla redazione dei report; l'autorità del risultato non è però l'IA: sono i dati, gli algoritmi pubblicati e la possibilità di ripetere i calcoli.

Questi sono i dati. Questo è il metodo. Questo è il codice. Questi sono i risultati. Rifate i conti.


The smallest raw p-value in the entire study appears in the epoch analysis; precisely because 71 comparisons are made, it is not significant after Holm. This is a concrete example of why one should not select the “strangest number” after inspecting hundreds of possibilities.

What we can — and cannot — conclude

The conclusion concerns the data and the tests applied. It does not physically certify urns, balls, software or chain of custody; it cannot detect a hypothetical manipulation deliberately designed to preserve these statistics; and it depends on the historical accuracy of the source archive. The internal audit checks structure and consistency, but cannot independently authenticate every nineteenth-century transcription.

The defensible wording is therefore:

In the historical archive examined, no statistically significant departures emerge from the behaviour expected for uniform and independent draws, within the sensitivity of the tests applied.

Reproducibility

Readers are not asked to trust us. The dataset, source code, intermediate results and all HTML reports are distributed with the article. Every numerical claim made here can be regenerated.
Artificial intelligence contributed to code design, analysis organisation and report drafting; the authority of the result is not the AI: it lies in the data, the published algorithms and the ability to repeat the calculations.

These are the data. This is the method. This is the code. These are the results. Re-run the calculations.

Free counters!
VAT: IT -
(C) 2016-2026 Officina Turini, Tutti i diritti riservati
Back to content