# determining odds of an occurance

**URL:** <https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495>\
**Category:** Factual Questions\
**Created:** [January 16, 2020, 4:39am UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495 "2020-01-16T04:39:16Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Telemark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/telemark/32/372_2.png) [@Telemark](https://boards.straightdope.com/u/Telemark)\
**Post date:** [January 17, 2020, 4:37pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/21 "2020-01-17T16:37:16Z")

</div>

> [@cmore](#):
>
> I’m saying that there are no other numbers with everything in place, in order, and only varying by one digit - yes. Is this odd? There’s about 1.5 million numbers in my area. The only thing close, which I’d mentioned, is another friends number shares the same suffix as the two I’m asking about (the odds against that seem high to me as well).

It does seem odd to me, because phone numbers aren’t random. There are just over 300 area codes in the US, and I suspect that most of the people in your address book share just a few of those. But I may be overestimating the chances, but I’m not skilled enough to do the math.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [January 17, 2020, 4:51pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/22 "2020-01-17T16:51:09Z")

</div>

> [@cmore](#):
>
> Link to your story? It sounds interesting.

It’s a hijack and I’m not sure it’s proper to post it in GQ. Perhaps Spoiler tags will prevent rebuke.[SPOILER]

> [@What's the closest thing to a 'supernatural experience' you've had happen in your life?](https://boards.straightdope.com/t/whats-the-closest-thing-to-a-supernatural-experience-youve-had-happen-in-your-life/566500/23):
>
> … Picnicking with wife and infant, I brought up the subject of my wife’s mother’s famous ghost and _immediately_ the largest wasp-hive in our orchard fell to the ground. (A once-per-year event or less.) We raced away from the wasps carrying our baby, did a few things and stood catching our breaths in wonderment. I said something like “Wow, as soon as I mentioned your mother’s ghost …” but before I could finish the sentence, the sky turned quite dark and a ferocious wind drove sand at us so hard we were immobilized protecting baby. The storm was quite unusual but not unprecedented. With hindsight, it was likely an early wind gust from that storm that brought the wasp-hive down. Still, that the timing of the two singular events coincided _exactly_ with my two mentions of the ghost seemed bizarre. (No one will live in the house where my mother-in-law died, and when unknowing outsiders were boarded there, they left after one night and made camp outside. The orchard with the wasp-hive is 4 miles from that house and also allegedly haunted.)

While searching for that, I found another coincidence I posted in MPSIMS.  
[https://boards.straightdope.com/sdmb/showpost.php?p=13660126&postcount=1[/SPOILER]](https://boards.straightdope.com/sdmb/showpost.php?p=13660126&postcount=1%5B/SPOILER%5D)

---

<div class="post-metadata">

**Author:** ![cmore](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@cmore](https://boards.straightdope.com/u/cmore)\
**Post date:** [January 17, 2020, 5:01pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/23 "2020-01-17T17:01:37Z")

</div>

> [@pulykamell](#):
>
> There’s a nice video on the [birthday problem here](https://www.youtube.com/watch?v=KtT_cgMzHx8).

Thanks for the link. I’m for sure going to have to watch it a bunch more times to wrap my head around it.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [January 17, 2020, 6:18pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/24 "2020-01-17T18:18:47Z")

</div>

> [@pulykamell](#):
>
> If I’m doing my math right (and I very well may not be), and only taking into account the last seven digits (not the area code), you would need – if phone numbers were purely randomly assigned and all digits from 000 0000 to 999 9999 were possible, which they are not – you’d need about 1200 contacts before a better-than-even chance that just the last digit is off. (I didn’t think about all the other permutations. You also have to take into account just the first digit being off, just the second digit being off, etc.) Basically, here I’m doing the equation 1 000 000!/(1 000 000^1200\*(1 000 000-1200)!) The real mathematicians should check me.
> 
> I think. So that should be a very upper bound. The actual number will be south of that, of course, because the pool of possible numbers is more limited, and we’re not just looking to match specifically the first six digits of a seven-digit phone number.

OK, i just whipped up a python script (boy am I rusty!) to generate a string from 000 0000 to 999 9999, representing a 7-digit number. As said above, obviously, many of these numbers are not legitimate phone numbers, but this will create an upper bound.  
The script can compare strings for an exact match, or any n-character match you want. After doing a sanity check with known numbers (like we should expect on average 23 numbers for a 3-digit match out of 365 on the birthday problem) and being convinced that the output at least looked correct, I ran 1000 trials for a (at least) 6-digit match on a 7-digit phone number, with an output also showing me the two numbers that matched.

On 1000 trials, it gave me an average of 502 numbers needed to be generated before 6 out of any 7 digits matched in a previous number generated. For all 7 to match (which couldn’t happen with phone numbers in the same area code, of course), I just ran 100 trials (my code is a bit slow), and that gave me a result of 3906, where the expected average should be around 3724, using the equation above, so it looks like my code is in the right ballpark.

---

<div class="post-metadata">

**Author:** ![moes\_lotion](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@moes\_lotion](https://boards.straightdope.com/u/moes_lotion)\
**Post date:** [January 17, 2020, 7:00pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/25 "2020-01-17T19:00:01Z")

</div>

From the facts given, we know that there are about 775 exchanges (3 digit prefix) and the coincidence is that the friend’s number and the mother’s number only differ by one digit in the exchange. So the first question is how many of the 775 exchanges are there that differ by one digit, and then how many possible 4 digit suffixes exist for all exchanges. From this, analogous to the shared birthday problem, we could calculate the probability of this coincidence as 1 minus the probability of it not happening. Without an accurate list of the exchanges, the best we could do, as **pulkyamell** suggests, is estimate an upper limit but with the restriction that we are limited to only 775 3 digit prefixes, not the 1000 that his(?) approach uses.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [January 17, 2020, 7:29pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/26 "2020-01-17T19:29:03Z")

</div>

> [@pulykamell](#):
>
> On 1000 trials, it gave me an average of 502 numbers needed to be generated before 6 out of any 7 digits matched in a previous number generated. For all 7 to match (which couldn’t happen with phone numbers in the same area code, of course), I just ran 100 trials (my code is a bit slow), and that gave me a result of 3906, where the expected average should be around 3724, using the equation above, so it looks like my code is in the right ballpark.

Actually, quick nit-pick: the expected average of 3724 is not as precise as it seems. I neglected to take into account that because of the gigantic numbers used in the equation, that Wolfram Alpha uses estimated values at some points. So my empircal result is probably closer to the true expectation of how many random numbers from 0000000 to 9999999 you’d need to pick before two are expected to match in the group. I’ll keep it running in the background for shits & giggles and report back after a larger sample size. (It’s kind of tangential to the problem at hand, but it’s interesting to see that if you got about 4000-ish people together to write down a number from one to ten million, you’re likely to have a match somewhere in that group.)

ETA: (And, yes, “he” is the correct pronoun for me.)

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [January 17, 2020, 9:38pm UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/27 "2020-01-17T21:38:19Z")

</div>

> [@moes\_lotion](#):
>
> From the facts given, we know that there are about 775 exchanges (3 digit prefix) and the coincidence is that the friend’s number and the mother’s number only differ by one digit in the exchange. So the first question is how many of the 775 exchanges are there that differ by one digit, and then how many possible 4 digit suffixes exist for all exchanges. From this, analogous to the shared birthday problem, we could calculate the probability of this coincidence as 1 minus the probability of it not happening. Without an accurate list of the exchanges, the best we could do, as **pulkyamell** suggests, is estimate an upper limit but with the restriction that we are limited to only 775 3 digit prefixes, not the 1000 that his(?) approach uses.

OK, to keep it simple, if we just do 775 exchanges \* 10000 numbers per exchange, that makes 7 750 000 possible numbers. With those plugged in, I’m now getting an average of needing about 448 numbers on average for there to be a group of two six-digit matches.

---

<div class="post-metadata">

**Author:** ![cmore](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@cmore](https://boards.straightdope.com/u/cmore)\
**Post date:** [January 18, 2020, 12:42am UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/28 "2020-01-18T00:42:09Z")

</div>

I saw a few of the latest comments, I’m working thru understanding them.

I’ll also add that I double checked my list, and the next, most similar numbers, have all but two numbers in the suffix different, the rest of the numbers exactly the same otherwise.

---

<div class="post-metadata">

**Author:** ![cmore](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@cmore](https://boards.straightdope.com/u/cmore)\
**Post date:** [January 18, 2020, 5:39am UTC](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495/29 "2020-01-18T05:39:58Z")

</div>

> [@septimus](#):
>
> It’s a hijack and I’m not sure it’s proper to post it in GQ. Perhaps Spoiler tags will prevent rebuke.[SPOILER]
> 
> While searching for that, I found another coincidence I posted in MPSIMS.  
> [https://boards.straightdope.com/sdmb/showpost.php?p=13660126&postcount=1[/SPOILER]](https://boards.straightdope.com/sdmb/showpost.php?p=13660126&postcount=1%5B/SPOILER%5D)

1st story, in the orchard, that would’ve freaked me out a little bit as well. 2nd story I guess I’d have to know more.

thanks for sharing.

I’m not sure if I should share this as it’s kinda off topic, kinda on topic, but the craziest coincidence I’ve probably had occur was when I was at a friend’s folks house eating Christmas dinner. One of his uncles was joking around and said something about how he thought he was getting taller (when really he just had some high waters on). I mentioned a My Three Sons episode I remembered where they were messing with Uncle Charlie, trying to make him think he was getting taller by sawing off a little of his cane, hemming his pants, and maybe even messing with his chair at the dinner table.

My buddy said it sounded like an episode of MASH where the two laid back surgeon guys were messing with the bald headed uptight guy that dated Hotlips, trying to fool him into thinking the same thing. I said I’d never seen the episode, no doubt because I’d only watched MASH a few times in my life, and that was forever ago.

Anyway, fast forward a few hours, I go home from dinner, turn on the tv, look at the channel guide and on it I see theres an episode of MASH listed on one of the channels. Entirely because we’d just talked about the show, I switched to it. It was just coming back from a commercial break. I’ll be gadamn’ed if it was not only the episode he’d told me about, but it was the exact scene he’d told me about that was just starting.

there’s probably no way to ever quantify what a coincidence that was, so I won’t dare ask.

[Previous page](https://boards.straightdope.com/t/determining-odds-of-an-occurance/846495.md?page=1)
