avatar
James Davis Nicoll @jdnicoll.bsky.social

What are the odds a random 6-digit string would have at least one digit repeat? That is, not just the same number twice (eg 123453) but paired (123345)?

jul 19, 2025, 10:33 pm • 5 2

Replies

avatar
A nice ground cover @horseherb.bsky.social

For adjacent digits, 123345 not 123453, I think it's 1−((10×9^5)÷10^6) = 41% chance of at least one adjacent pair. That is, there's 10 choices for the first digit, but then only 9 choices for each succeeding digit.

jul 19, 2025, 10:46 pm • 2 0 • view
avatar
Logan R. Kearsley @gliese1337.bsky.social

There are 1000000 6-digit strings, 409510 of those contain at least one pair of adjacent identical digits, so the probability is exactlt 40.951%.

jul 20, 2025, 12:45 am • 1 0 • view
avatar
Logan R. Kearsley @gliese1337.bsky.social

(With numbers this small, you can literally just check every case to be sure. Anything less than about 4 billion is "small".)

jul 20, 2025, 1:10 am • 0 0 • view
avatar
W. Dow Rieder @riderius.bsky.social

a little lower than 50-50.

jul 20, 2025, 11:16 am • 0 0 • view
avatar
James Davis Nicoll @jdnicoll.bsky.social

Because I see that all the time in confirmation codes.

jul 19, 2025, 10:40 pm • 3 0 • view
avatar
Kimberly Dairine @kimberlydairine.bsky.social

so the odds that a number is the same as the one before it is 1/10. and you've got to dodge that 5 times, so that's 1 minus 9/10 to the 5th power

jul 19, 2025, 10:41 pm • 5 0 • view
avatar
A nice ground cover @horseherb.bsky.social

0.9**5 is the chance of no doubled characters = 59%, so 1-0.9**5 = 41% should be the chance of doubled characters. I *think*. Even if I'm rongg, which is quite likely, it's very roughly 50-50 chance of doubled characters.

jul 19, 2025, 10:57 pm • 2 0 • view
avatar
Kimberly Dairine @kimberlydairine.bsky.social

aahhhh you're right, i had it right the first time

jul 19, 2025, 10:59 pm • 0 0 • view
avatar
Kimberly Dairine @kimberlydairine.bsky.social

need to write this stuff down and not try to do it in my head lmao

jul 19, 2025, 11:00 pm • 1 0 • view
avatar
Kimberly Dairine @kimberlydairine.bsky.social

so like 41%

jul 19, 2025, 10:42 pm • 0 0 • view
avatar
Kimberly Dairine @kimberlydairine.bsky.social

sorry, 41% that there's *no* repeats, so 59% that there is at least one repeat

jul 19, 2025, 10:42 pm • 5 0 • view
avatar
Andrew Love @andrewlovejr.bsky.social

Yup. People have terrible intuitions about probability, so things like this are surprising, but true

jul 19, 2025, 10:50 pm • 4 0 • view
avatar
Matt Austern @austern.bsky.social

I'm getting about 85%. There are 10⁶ 6-digit strings and only 10×9×8×7×6×5 = 151200 strings with no duplicates, so a 15.12% chance that you'll get a no-duplicate string and an 84.88 chance of seeing at least one duplicate.

jul 19, 2025, 10:58 pm • 0 0 • view
avatar
A nice ground cover @horseherb.bsky.social

That's the answer to "not just the same number twice (eg 123453)". Adjacent same digit is surprisingly not that much harder.

jul 20, 2025, 5:00 am • 0 0 • view