From 0252800503c5d43a3e9e562ae878a3f8e0e21005 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Mon, 11 May 2026 21:47:30 +0700 Subject: [PATCH] docs(readme): explain the 6-appearances stopping rule and Vietlott statistical motivation --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a21cc93..59832d8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # go-lottery-generator - A lottery number generator written in Go that generates random sequences and tracks when any sequence appears multiple times. ## Features @@ -24,6 +23,12 @@ go run main.go Done ``` +## Why "stop at 6 appearances" + +This is a statistical curiosity inspired by [Vietlott](https://vietlott.vn/) Power 6/45 — Vietnam's national lottery where players pick 6 numbers from 1–45. The question: *how many draws would it take before any exact 6-number combination repeats?* + +By the birthday paradox, with C(45,6) = 8,145,060 possible combinations, you'd expect a repeat after roughly √(2 × 8,145,060 × ln 2) ≈ **3,360 draws** on average. This program runs the simulation and stops as soon as one sequence has been generated exactly 6 times — letting you observe the actual count empirically. + ## Original Python Version -*In 2025, I rewrote this project using Go. The original Python version of this project can be found at [feature/python](https://github.com/tiennm99/lottery-generator/tree/feature/python) branch.* \ No newline at end of file +*In 2025, I rewrote this project using Go. The original Python version of this project can be found at [feature/python](https://github.com/tiennm99/lottery-generator/tree/feature/python) branch.*