docs(readme): explain the 6-appearances stopping rule and Vietlott statistical motivation

This commit is contained in:
2026-05-11 21:47:30 +07:00
parent 4eefec92ea
commit 0252800503
+7 -2
View File
@@ -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 145. 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.*
*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.*