Comments on: Math: Probability and combinatronics
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics/
Comments on Ask MetaFilter post Math: Probability and combinatronicsWed, 21 Sep 2022 05:09:16 -0800Wed, 21 Sep 2022 05:23:24 -0800en-ushttp://blogs.law.harvard.edu/tech/rss60Question: Math: Probability and combinatronics
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics
Ok... so I'm looking at a candidate for a job position and I notice on his resume the following:
Between his mobile number and my mobile number (10 digit, US format) there are 9 numbers in common, 5 of which are in the right position. <br /><br /> Without knowing which numbers are actually in common and which number does not match, what is the probability that you would be able to accurately synthesize the other phone number.<br>
<br>
Probability was 25ish years ago, and while I've used it - this is one of those exhaustive cases where I remember it would require combining multiple conditional probabilities to solve. <br>
<br>
I'd like to avoid giving the numbers and that would still be a special case of that condition, as you could place the 5 right positions in various permutations to make this pattern visible.<br>
<br>
I'm also less interested in the actual solution and much more interested in re-learning how to tackle it<br>
Statements I can make about the a given digit, Given that 9 digits are correct and 5 digits are in place, what is the probability that I am the right digit and in the right place?<br>
I mean does that just simplify it it ((9/10) * (5/10))^10 or do I have to consider the positioning and the probability of this more closely... and is it (5/10) or is it (5/9)... these are the things that kept me up last night<br>
Tpost:ask.metafilter.com,2022:site.367021Wed, 21 Sep 2022 05:09:16 -0800NanukthedogmathprobabilitymatchingphonenumbersBy: hovey
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227117
Are three of the five rightly-positioned numbers the area code? The rest of the math is beyond me, but you probably do need to consider that area codes (and the next three numbers, the exchanges) are not randomly distributed.comment:ask.metafilter.com,2022:site.367021-5227117Wed, 21 Sep 2022 05:23:24 -0800hoveyBy: Nanukthedog
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227124
I'm thinking only within the confines of a ten digit number. With specifics to my observation, the area codes don't match - the exchange was spot on and the last four were an inversion - hence where my eyes went. Amazingly, the area codes don't match - but as I said, for this - I'm thinking more in terms of a generalized solution which would treat 000 as an area code as a possibility even though that isn't a real solution...<br>
<br>
While I don't want to solve for the exact answer, the exact format is:<br>
His: BYF-FHY-QKVS<br>
Mine: YQB-FHY-QSVK<br>
I've replaced numbers with a random letter to make this largely useless, though you could use the specificity of the area code to initially narrow down the states - once again though, not looking to publish my phone number or some one else's on the internet.comment:ask.metafilter.com,2022:site.367021-5227124Wed, 21 Sep 2022 05:52:33 -0800NanukthedogBy: adekllny
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227132
If it's a question about any pair of ten-digit numbers, and you are willing to ignore hovey's excellent point about area codes not being random and exchanges not being random, then I think the main question is whether there are repeated digits. As in, your example BYF.FHY.QKVS repeats the "F", and YQB.FHY.QSVK repeats the "Y." <br>
<br>
If the number you were starting with was 123.456.7890, then there are 10-choose-9 ways to pick the 9 digits from those 10 and start mucking about with those. (That's 10, because picking 9 distinct things from 10 distinct things is the same as picking the 1 distinct thing you leave out.) <br>
<br>
If the number you were starting with was 212.222.2222, then there's really only 2 sets of 9 digits to pick: (nine 2's,) and (eight 2's plus one 1). A seemingly reasonable resource for these kinds of counting problems is <a href="https://sites.math.northwestern.edu/~mlerma/courses/cs310-05s/notes/dm-gcomb#:~:text=Two%20combinations%20with%20repetition%20are,at%20a%20time%20with%20repetition.">here</a>.<br>
<br>
If you're not going to let me know which digits are in the right position, then I think it's just (pick the nine digits in common)*(pick the tenth digit)*(permute those ten digits). So you'll need that "permutation with repetition" formula. But it's going to be on the order of:<br>
10 (ways to pick nine from your ten to start) *<br>
10 (ways to pick the tenth digit) *<br>
10! (ways to arrange the ten digits you know have).<br>
<br>
If there are repeated digits, you can divide that number by the number of repeated digits factorial to account for the fact that 12b45b789b gets counted 6 = 3! times for the 6 identical ten-digit numbers that result from whatever b happens to be. <br>
<br>
If you account for the fact that area codes and exchanges are not assigned randomly, that probably comes down dramatically. But I don't know too much about how they're assigned these days. (I know that Cape Canaveral Florida asked for permission to get "321" as their area code, which is cool, but maybe not helpful.)comment:ask.metafilter.com,2022:site.367021-5227132Wed, 21 Sep 2022 06:09:45 -0800adekllnyBy: zompist
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227135
I solved the wrong problem, but this might still be of interest. How many phone numbers could have this relationship with yours?<br>
<br>
You can simplify by looking only at the parts that differ: Y*BSK.<br>
<br>
How many ways are there to arrange YBSK? That's a permutation of 4 elements, so there are 4! = 24 possibilities. However, all four digits have to be in the wrong position! Only 8 of the possibilities remain (BYKS BKYS BSKY KYBS KSBY SKBY SYKB SKYB).<br>
<br>
That leaves the totally incorrect number (your Q). This could be any of 9 numbers (i.e. anything but Q). So there are 8 * 9 = 72 possible numbers with this precise relationship to your own.comment:ask.metafilter.com,2022:site.367021-5227135Wed, 21 Sep 2022 06:23:24 -0800zompistBy: Nanukthedog
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227136
Nice Adekllny! This is helping unclog the brain. As a note though 212-222-2222 violates the initial supposition, as the amount of repetition prevents only 5 digits from being in place.comment:ask.metafilter.com,2022:site.367021-5227136Wed, 21 Sep 2022 06:24:18 -0800NanukthedogBy: dfan
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227142
zompist: the number of <a href="https://en.wikipedia.org/wiki/Derangement">derangements</a> of a 4-element set is 9; your list omitted KSYB.comment:ask.metafilter.com,2022:site.367021-5227142Wed, 21 Sep 2022 06:37:33 -0800dfanBy: dfan
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227146
(Also, I think that your enumeration includes items like YBSKA -> BYKSC but not YBSKA -> BYKCS, where the four elements in common don't come from the same four positions as the original. This is where I decided to move on...)comment:ask.metafilter.com,2022:site.367021-5227146Wed, 21 Sep 2022 06:41:00 -0800dfanBy: Candleman
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227152
<i>the exchange was spot on</i><br>
<br>
As a note, exchanges cannot start with 0 or 1, which reduces the problem space a little.comment:ask.metafilter.com,2022:site.367021-5227152Wed, 21 Sep 2022 07:11:35 -0800CandlemanBy: eatcake
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227153
I just want to chime in anecdotally to say that I've experienced this number matching in real life. My exact number exists within a different area code in my own state and I've gotten misdirected phone calls because someone assumed the person's number started with my are code. So...the occurrence of this is probably not as unique as one might think.comment:ask.metafilter.com,2022:site.367021-5227153Wed, 21 Sep 2022 07:19:35 -0800eatcakeBy: AzraelBrown
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227194
Both area codes and exchanges are relatively deliberate -- they're not strictly random. The <a href="https://en.wikipedia.org/wiki/North_American_Numbering_Plan">North American Numbering Plan</a> established the original rules, which have been slowly been being broken/revised due to the huge number of telephone numbers in use now. So, you have to exclude cases like where 911 or 555 is not a valid exchange, an exchange usually isn't the same as the area code (although I couldn't find whether this was a rule or not), etc. <br>
<br>
According to the link above, an area code can have a maximum of 7,918,900 valid phone numbers, 20% fewer than the 9,999,999 you'd think were possible with truly random numbers.comment:ask.metafilter.com,2022:site.367021-5227194Wed, 21 Sep 2022 08:32:47 -0800AzraelBrownBy: zompist
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227395
Thanks for the correction and the useful word, dfan!<br>
<br>
I was focused on keeping the identical slots where they were. But I think we could piggyback on that. Five digits are right; so I think we can look at every set of five digits, make them the right ones, and multiply by 81 to account for the wild card and the right digits in wrong position. <br>
<br>
How many ways to pick five digits are there? I think 10 * 9 * 8 * 7 * 6 (that is, you choose one of the 10 digits, then one of the nine remaining, etc.). That's 30,240. So the total number of phone numbers with this level of correct digits/positions, not restricted to the particular locations in the example, should be 2,449,440. Compare this to the possible phone numbers, 10,000,000,000. (I'm ignoring the contraints on real phone numbers.)<br>
<br>
I'm a computer programmer at heart, so my approach tends to be "how could we write a program to do this?" A statistician would think differently!comment:ask.metafilter.com,2022:site.367021-5227395Wed, 21 Sep 2022 16:19:32 -0800zompistBy: zompist
http://ask.metafilter.com/367021/Math-Probability-and-combinatronics#5227399
Sorry, to be clear, the above is still not completely general. It's a prediction of how many numbers are similar to <em>a given phone number.</em> That may be what Nanuk wants; but he may want to know how many such near-matchups occur <em>among all phone number pairs</em>.comment:ask.metafilter.com,2022:site.367021-5227399Wed, 21 Sep 2022 16:28:41 -0800zompist