The Mysterious World of Randomness: Let's Build a Lottery Number Generator (Feat. Algorithms)

KO EN
2021년 3월 5일 · 10분 읽기 · 조회 76 · 💬 0

The winning numbers for lottery round 952 were

4, 12, 22, 24, 33, 41 +[38].

This round's jackpot comes out to 2,713,699,834 won.

The dream of striking it rich... the dream of turning your life around...

Please, just once...

I doubt I'm the only one shouting that, right?

I came across this meme. If you're going to auto-generate lottery numbers, how can you be so half-hearted about it, haha.

If you run the lottery's auto-pick feature,

the computer just draws numbers at random and hands you a set —

but this "randomness" isn't actually fully realizable in practice.

It's really just an arbitrary pull from a massive pile of numbers that have been shuffled together.

Not a perfectly random sequence born straight out of nature,

but rather a chunk of data that merely looks random after passing through human hands.

Anyway, enough of that —

shall we try picking numbers with a bit more sincerity?

So here's my plan: first, I'll generate lottery numbers using a basic random function,

then apply my own custom hash function to these numbers so they're distributed as evenly as possible,

increasing the entropy, and use this method to generate 1,000 lottery number sets.

Then I'll score each set by comparing it against the winning numbers from the past 100 lottery rounds.

For each newly drawn number set,

I'll tally up points like this: 3,000 points for a 1st-place match, 600 for 2nd place, 30 for 3rd, 10 for 4th, and smaller amounts for 5th and lower.

That way, every number set ends up with a score, right?

The top 5 highest-scoring sets would be the random numbers most similar to actual winning patterns,

while the bottom 5 lowest-scoring sets would mean they've managed to avoid matching any past winning numbers as much as possible.

Is there perhaps some hidden pattern lurking behind lottery wins?

If so, the random numbers similar to that pattern — the high-scoring sets — would be closer to the winning odds.

Or, banking on the expectation that winning numbers won't repeat (meaning the 6-number combination as a whole, not a single digit),

you might hope that the lowest-scoring sets are "due" to take first place next round.

I doubt you're actually curious about all this rambling explanation, haha.

Let's get straight to the point.

Now everything's ready.

Enter a number, and my custom-built random number generation algorithm kicks in based on that seed,

producing 10 final lottery number sets.

Do you all believe in fate?

Does fate even exist?

If it does, I'll leave it up to our Ppomi.

I actually used to borrow Ppomi's paw a lot when doing gacha pulls in mobile games —

the more she growled, the better the item that came out.

Sending all my wishes~☆

And here are the 10 resulting number sets...

Maybe it's because I put so much effort into writing the algorithm,

but the numbers somehow look prettier.

I'll go ahead and book the KTX tickets.

To everyone who's read this post,

see you all in front of the NongHyup bank next Monday ^^


In closing,

statistically speaking,

whether it's a set like 1, 2, 3, 4, 5, 6 that seems like it could never possibly win,

or a set like 8, 17, 19, 37, 40, 44 that looks plausible because the numbers are nicely mixed,

the probability of winning first place is,

surprisingly, exactly the same for both.

That's because the total number of possible lottery combinations is 45C6, and the winning number is just one out of all of those.

Until the numbers are actually drawn, no particular arrangement carries any special meaning, haha.

Also, there's no causal relationship between the previous drawing and the current one —

each drawing is an independent trial!

So even though I put in all this effort to generate these numbers, it doesn't really mean anything special, lol.

Obviously, please just take this as a bit of fun~

That's today's little exploration.

That's all for now~

#난수#랜덤#로또#알고리즘#로또당첨금#로또생성기#로또1등#로또952회

댓글 0