0

Let's say I've got a pool of 20 numbers, and each event chooses a number randomly. I'm trying to find the 50% point for one of these three:

  1. 50% chance that by this event, at least 1 duplicate number is pulled.
  2. 50% chance that by this event, at least 2 duplicate numbers are pulled.
  3. 50% chance that by this event, at least 1 triplicate number is pulled.

The closest I've come up to finding out a solution to this is using the Birthday problem for #1, wherein I get a range between 5 and 6. I feel like that's the direction I need to go to figure out the number for 2 and 3, but I can't seem to crack it.

Any advise or help is appreciated.

  • You can find many similar problems worked on this site. here for instance. – lulu Feb 23 '23 at 14:30
  • I actually saw that post before posting my own question. I think the triple pull was answered in the comments section by Michael Lugo mentioning the Anirban DasGupta formula, but I can't seem to find one that references "At least 2 pairs". I managed to do a 1 or more pairs with the basic Birthday problem calculation, and the triplicate with the above, but can't seem to find the "At Least 2 pairs" solution. – Ratface Feb 24 '23 at 03:02
  • For (1), you want to look at the probability there are $n$ unique values after $n$ draws, which has probability $\frac{20!}{(20-n)!20^n}$ and crosses $\frac12$ between $n=5$ and $6$. For (2) you want to look at the probability there are $n$ or $n-1$ unique values after $n$ draws, which has probability $\frac{20!}{(20-n)!20^n} + \frac{n(n-1)}{2}\frac{20!}{(20-n+1)!20^n} $ and crosses $\frac12$ between $n=8$ and $9$ – Henry Feb 24 '23 at 14:41
  • I think I understood this henry. Thanks so much. May I ask how scaling this would go about if I wanted to check for at least 3 dupes? Is it (n(n-2)/3)*(20!/(20-n+2)!20^n)? Or a different formula altogether? – Ratface Feb 25 '23 at 00:42
  • @Ratface No - it gets more complicated (involving Stirling numbers of the second kind) and rereading, my expression may be for the $50%$ probability that there is neither two duplicates nor a triplicate – Henry Feb 25 '23 at 12:14
  • @Henry so you mean to say that the code above is for a different variable entirely? Covering no triplicates combined with the the odds of there being 0, 1, 3 dupes and so on, but NOT 2 pairs? – Ratface Feb 26 '23 at 01:02
  • My expression was for $n$ or $n−1$ unique values after $n$ draws so zero duplicates or one duplicate but no two duplicates and no triplicates – Henry Feb 26 '23 at 01:53
  • Wouldn't the 1-Value of that number then mean "Two duplicate or more duplicates, or triplicates" then?

    Also, is there a formula that I'm blanking out on that says "Exactly 1 Duplicate only"? Because answering that would actually get us 2 or more, PLUS triples" as well.

    – Ratface Feb 26 '23 at 05:21

1 Answers1

1

To be precise I assume that 3-cates (or 4-cates ...) do not fulfill the requirement of duplicates, and so on, which means for the 0.5 probab. margin we only count duplicates. Drawing a quadriplate, for example, does not count as 2 duplicates(!).

  1. After 5 draws the prob. of 1 duplicate is 2907/8000 =0.363375 and the prob. of 2 duplicates is 513/16000 = 0.0320625, total below 0.5. (There are chances for 3-cates up to 5-cates.. ignored here). After 6 draws the prop. of 1 duplicate is 8721/20000 =0.43605, for 2 duplicates is 26163/320000 = 0.081759375, for 3 duplicates is 513/320000 =0.001603125, altogether beyond the 0.5 treshold. So the answer to 1 is between 5 to 6 draws as already stated.

  2. In a short cut notation we can split the 20 into a sequence of i^f(i) which means an i-cate occurs f(i) times. E.g. 0^17 1^2 5^1 means 17 numbers have not been drawn, 2 numbers have been drawn once, and one number has been drawn 5 times. An incomplete table (which means entries containing 2^1 and 2^0 are dropped) after 7 draws with probabilites shown as fractions and floating point numbers:

 0^15 1^3 2^2 | 61047/400000 0.1526175
 0^16 1^1 2^3 | 61047/6400000 0.00953859375
 0^17 2^2 3^1 | 3591/6400000 5.6109375E-4

with sum below 0.5. After 9 draws

 0^13 1^5 2^2 | 11537883/40000000 0.288447075
 0^14 1^3 2^3 | 549423/8000000 0.068677875
 0^15 1^1 2^4 | 549423/160000000 0.00343389375
 0^15 1^2 2^2 3^1 | 549423/40000000 0.013735575
 0^16 2^3 3^1 | 183141/640000000 2.861578125E-4
 0^16 1^1 2^2 4^1 | 549423/1280000000 4.2923671875E-4
 0^17 2^2 5^1 | 32319/6400000000 5.04984375E-6

which sums to 0.375.. below 0.5. After 10 draws

 0^12 1^6 2^2 | 49997493/160000000 0.31248433125
 0^13 1^4 2^3 | 3845961/32000000 0.12018628125
 0^14 1^2 2^4 | 1648269/128000000 0.0128771015625
 0^14 1^3 2^2 3^1 | 549423/16000000 0.0343389375
 0^15 2^5 | 549423/3200000000 1.716946875E-4 
 0^15 1^1 2^3 3^1 | 183141/80000000 0.0022892625
 0^15 1^2 2^2 4^1 | 549423/320000000 0.001716946875
 0^16 2^2 3^2 | 183141/2560000000 7.1539453125E-5
 0^16 2^3 4^1 | 183141/5120000000 3.57697265625E-5 
 0^16 1^1 2^2 5^1 | 549423/12800000000 4.2923671875E-5
 0^17 2^2 6^1 | 10773/25600000000 4.208203125E-7

which sums to 0.484215, below 0.5 After 11 draws:

 0^11 1^7 2^2 | 235702467/800000000 0.29462808375
 0^12 1^5 2^3 | 549972423/3200000000 0.1718663821875
 0^13 1^3 2^4 | 42305571/1280000000 0.03305122734375
 0^13 1^4 2^2 3^1 | 42305571/640000000 0.0661024546875
 0^14 1^1 2^5 | 18130959/12800000000 0.001416481171875
 0^14 1^2 2^3 3^1 | 6043653/640000000 0.0094432078125
 0^14 1^3 2^2 4^1 | 6043653/1280000000 0.00472160390625
 0^15 1^1 2^2 3^2 | 2014551/3200000000 6.295471875E-4
 0^15 1^1 2^3 4^1 | 2014551/6400000000 3.1477359375E-4
 0^15 1^2 2^2 5^1 | 6043653/32000000000 1.8886415625E-4
 0^16 2^2 3^1 4^1 | 2014551/102400000000 1.9673349609375E-5
 0^16 2^3 5^1 | 2014551/512000000000 3.934669921875E-6
 0^16 1^1 2^2 6^1 | 2014551/512000000000 3.934669921875E-6
 0^17 2^2 7^1 | 16929/512000000000 3.3064453125E-8

which sums to 0.5823... more than 0.5 So the anwer to 2. is that the transition is from 10 to 11 draws.

3. After 9 draws (incomplete table meaning entries containing 3^0 are dropped)

 0^13 1^6 3^1 | 1281987/20000000 0.06409935
 0^14 1^4 2^1 3^1 | 549423/8000000 0.068677875
 0^15 1^2 2^2 3^1 | 549423/40000000 0.013735575
 0^15 1^3 3^2 | 61047/20000000 0.00305235
 0^16 2^3 3^1 | 183141/640000000 2.861578125E-4
 0^16 1^1 2^1 3^2 | 183141/320000000 5.72315625E-4
 0^16 1^2 3^1 4^1 | 183141/640000000 2.861578125E-4
 0^17 3^3 | 1197/320000000 3.740625E-6
 0^17 2^1 3^1 4^1 | 10773/640000000 1.68328125E-5
 0^17 1^1 3^1 5^1 | 10773/1600000000 6.733125E-6
 0^18 3^1 6^1 | 399/6400000000 6.234375E-8

below 0.5. After 14 draws

 0^9 1^10 3^1 | 3745050309/160000000000 0.02340656443125
 0^10 1^8 2^1 3^1 | 33705452781/320000000000 0.105329539940625
 0^11 1^6 2^2 3^1 | 21448924497/160000000000 0.13405577810625
 0^11 1^7 3^2 | 1021377357/80000000000 0.0127672169625
 0^12 1^4 2^3 3^1 | 7149641499/128000000000 0.0558565742109375
 0^12 1^5 2^1 3^2 | 7149641499/320000000000 0.022342629684375
 0^12 1^6 3^1 4^1 | 2383213833/640000000000 0.0037237716140625
 0^13 1^2 2^4 3^1 | 1649917269/256000000000 0.00644498933203125
 0^13 1^3 2^2 3^2 | 549972423/64000000000 0.008593319109375
 0^13 1^4 3^3 | 61108047/64000000000 9.54813234375E-4
 0^13 1^4 2^1 3^1 4^1 | 549972423/128000000000 0.0042966595546875
 0^13 1^5 3^1 5^1 | 549972423/1600000000000 3.43732764375E-4
 0^14 2^5 3^1 | 235702467/2560000000000 9.2071276171875E-5
 0^14 1^1 2^3 3^2 | 78567489/128000000000 6.138085078125E-4
 0^14 1^2 2^1 3^3 | 26189163/64000000000 4.09205671875E-4
 0^14 1^2 2^2 3^1 4^1 | 235702467/256000000000 9.2071276171875E-4
 0^14 1^3 3^2 4^1 | 26189163/128000000000 2.046028359375E-4
 0^14 1^3 2^1 3^1 5^1 | 78567489/320000000000 2.45523403125E-4
 0^14 1^4 3^1 6^1 | 26189163/1280000000000 2.046028359375E-5
 0^15 2^2 3^3 | 8729721/640000000000 1.36401890625E-5
 0^15 2^3 3^1 4^1 | 26189163/1280000000000 2.046028359375E-5
 0^15 1^1 3^4 | 2909907/640000000000 4.5467296875E-6
 0^15 1^1 2^1 3^2 4^1 | 26189163/640000000000 4.09205671875E-5
 0^15 1^1 2^2 3^1 5^1 | 78567489/3200000000000 2.45523403125E-5
 0^15 1^2 3^1 4^2 | 26189163/2560000000000 1.0230141796875E-5
 0^15 1^2 3^2 5^1 | 26189163/3200000000000 8.1841134375E-6
 0^15 1^2 2^1 3^1 6^1 | 26189163/3200000000000 8.1841134375E-6
 0^15 1^3 3^1 7^1 | 1247103/1600000000000 7.79439375E-7
 0^16 3^3 4^1 | 2909907/10240000000000 2.8417060546875E-7
 0^16 2^1 3^1 4^2 | 26189163/40960000000000 6.393838623046875E-7
 0^16 2^1 3^2 5^1 | 26189163/51200000000000 5.1150708984375E-7
 0^16 2^2 3^1 6^1 | 26189163/102400000000000 2.55753544921875E-7
 0^16 1^1 3^1 4^1 5^1 | 26189163/51200000000000 5.1150708984375E-7
 0^16 1^1 3^2 6^1 | 8729721/51200000000000 1.7050236328125E-7
 0^16 1^1 2^1 3^1 7^1 | 3741309/25600000000000 1.461448828125E-7
 0^16 1^2 3^1 8^1 | 3741309/204800000000000 1.82681103515625E-8
 0^17 3^1 5^2 | 1540539/512000000000000 3.008865234375E-9
 0^17 3^1 4^1 6^1 | 513513/102400000000000 5.014775390625E-9
 0^17 3^2 7^1 | 73359/51200000000000 1.43279296875E-9
 0^17 2^1 3^1 8^1 | 220077/204800000000000 1.0745947265625E-9
 0^17 1^1 3^1 9^1 | 24453/102400000000000 2.38798828125E-10
 0^18 3^1 10^1 | 2717/2048000000000000 1.32666015625E-12

which sums to 0.3807, not enough. After 15 draws

 0^7 1^12 3^1 | 21448924497/3200000000000 0.0067027889053125
 0^8 1^10 2^1 3^1 | 707814508401/12800000000000 0.055298008468828125
 0^9 1^8 2^2 3^1 | 707814508401/5120000000000 0.13824502117207033
 0^9 1^9 3^2 | 26215352163/2560000000000 0.010240371938671874
 0^10 1^6 2^3 3^1 | 1651567186269/12800000000000 0.12902868642726562
 0^10 1^7 2^1 3^2 | 235938169467/6400000000000 0.03686533897921875
 0^10 1^8 3^1 4^1 | 235938169467/51200000000000 0.004608167372402344
 0^11 1^4 2^4 3^1 | 450427414437/10240000000000 0.043987052191113284
 0^11 1^5 2^2 3^2 | 450427414437/12800000000000 0.035189641752890626
 0^11 1^6 3^3 | 16682496831/6400000000000 0.00260664012984375
 0^11 1^6 2^1 3^1 4^1 | 150142471479/12800000000000 0.011729880584296875
 0^11 1^7 3^1 5^1 | 21448924497/32000000000000 6.7027889053125E-4
 0^12 1^2 2^5 3^1 | 450427414437/102400000000000 0.004398705219111328
 0^12 1^3 2^3 3^2 | 50047490493/5120000000000 0.009774900486914062
 0^12 1^4 2^1 3^3 | 16682496831/5120000000000 0.0032583001623046875
 0^12 1^4 2^2 3^1 4^1 | 150142471479/20480000000000 0.007331175365185547
 0^12 1^5 3^2 4^1 | 50047490493/51200000000000 9.774900486914063E-4
 0^12 1^5 2^1 3^1 5^1 | 150142471479/128000000000000 0.0011729880584296875
 0^12 1^6 3^1 6^1 | 16682496831/256000000000000 6.516600324609375E-5
 0^13 2^6 3^1 | 11549420883/204800000000000 5.639365665527344E-5
 0^13 1^1 2^4 3^2 | 11549420883/20480000000000 5.639365665527343E-4
 0^13 1^2 2^2 3^3 | 3849806961/5120000000000 7.519154220703125E-4
 0^13 1^2 2^3 3^1 4^1 | 11549420883/10240000000000 0.0011278731331054686
 0^13 1^3 3^4 | 427756329/5120000000000 8.35461580078125E-5
 0^13 1^3 2^1 3^2 4^1 | 3849806961/5120000000000 7.519154220703125E-4
 0^13 1^3 2^2 3^1 5^1 | 11549420883/25600000000000 4.511492532421875E-4
 0^13 1^4 3^1 4^2 | 3849806961/40960000000000 9.398942775878907E-5
 0^13 1^4 3^2 5^1 | 3849806961/51200000000000 7.519154220703125E-5
 0^13 1^4 2^1 3^1 6^1 | 3849806961/51200000000000 7.519154220703125E-5
 0^13 1^5 3^1 7^1 | 549972423/128000000000000 4.2966595546875E-6
 0^14 2^3 3^3 | 183324141/10240000000000 1.790274814453125E-5
 0^14 2^4 3^1 4^1 | 1649917269/81920000000000 2.0140591662597656E-5
 0^14 1^1 2^1 3^4 | 183324141/10240000000000 1.790274814453125E-5
 0^14 1^1 2^2 3^2 4^1 | 1649917269/20480000000000 8.056236665039062E-5
 0^14 1^1 2^3 3^1 5^1 | 1649917269/51200000000000 3.222494666015625E-5
 0^14 1^2 3^3 4^1 | 183324141/10240000000000 1.790274814453125E-5
 0^14 1^2 2^1 3^1 4^2 | 1649917269/40960000000000 4.028118332519531E-5
 0^14 1^2 2^1 3^2 5^1 | 1649917269/51200000000000 3.222494666015625E-5
 0^14 1^2 2^2 3^1 6^1 | 1649917269/102400000000000 1.6112473330078126E-5
 0^14 1^3 3^1 4^1 5^1 | 549972423/51200000000000 1.074164888671875E-5
 0^14 1^3 3^2 6^1 | 183324141/51200000000000 3.58054962890625E-6
 0^14 1^3 2^1 3^1 7^1 | 78567489/25600000000000 3.0690425390625E-6
 0^14 1^4 3^1 8^1 | 78567489/409600000000000 1.9181515869140625E-7
 0^15 3^5 | 20369349/256000000000000 7.956776953125E-8
 0^15 2^1 3^3 4^1 | 61108047/51200000000000 1.19351654296875E-6
 0^15 2^2 3^1 4^2 | 549972423/409600000000000 1.3427061108398438E-6
 0^15 2^2 3^2 5^1 | 549972423/512000000000000 1.074164888671875E-6
 0^15 2^3 3^1 6^1 | 183324141/512000000000000 3.58054962890625E-7
 0^15 1^1 3^2 4^2 | 183324141/204800000000000 8.951374072265625E-7
 0^15 1^1 3^3 5^1 | 61108047/128000000000000 4.774066171875E-7
 0^15 1^1 2^1 3^1 4^1 5^1 | 549972423/256000000000000 2.14832977734375E-6
 0^15 1^1 2^1 3^2 6^1 | 183324141/256000000000000 7.1610992578125E-7
 0^15 1^1 2^2 3^1 7^1 | 78567489/256000000000000 3.0690425390625E-7
 0^15 1^2 3^1 5^2 | 549972423/2560000000000000 2.14832977734375E-7
 0^15 1^2 3^1 4^1 6^1 | 183324141/512000000000000 3.58054962890625E-7
 0^15 1^2 3^2 7^1 | 26189163/256000000000000 1.0230141796875E-7
 0^15 1^2 2^1 3^1 8^1 | 78567489/1024000000000000 7.67260634765625E-8
 0^15 1^3 3^1 9^1 | 2909907/512000000000000 5.683412109375E-9
 0^16 3^1 4^3 | 61108047/6553600000000000 9.32434799194336E-9
 0^16 3^2 4^1 5^1 | 183324141/8192000000000000 2.237843518066406E-8
 0^16 3^3 6^1 | 20369349/4096000000000000 4.972985595703125E-9
 0^16 2^1 3^1 5^2 | 549972423/40960000000000000 1.3427061108398437E-8
 0^16 2^1 3^1 4^1 6^1 | 183324141/8192000000000000 2.237843518066406E-8
 0^16 2^1 3^2 7^1 | 26189163/4096000000000000 6.393838623046875E-9
 0^16 2^2 3^1 8^1 | 78567489/32768000000000000 2.3976894836425783E-9
 0^16 1^1 3^1 5^1 6^1 | 183324141/20480000000000000 8.951374072265625E-9
 0^16 1^1 3^1 4^1 7^1 | 26189163/4096000000000000 6.393838623046875E-9
 0^16 1^1 3^2 8^1 | 26189163/16384000000000000 1.5984596557617187E-9
 0^16 1^1 2^1 3^1 9^1 | 8729721/8192000000000000 1.0656397705078124E-9
 0^16 1^2 3^1 10^1 | 8729721/81920000000000000 1.0656397705078124E-10
 0^17 3^1 6^2 | 3594591/81920000000000000 4.387928466796875E-11
 0^17 3^1 5^1 7^1 | 1540539/20480000000000000 7.5221630859375E-11
 0^17 3^1 4^1 8^1 | 1540539/32768000000000000 4.701351928710937E-11
 0^17 3^2 9^1 | 171171/16384000000000000 1.044744873046875E-11
 0^17 2^1 3^1 10^1 | 513513/81920000000000000 6.26846923828125E-12
 0^17 1^1 3^1 11^1 | 46683/40960000000000000 1.1397216796875E-12
 0^18 3^1 12^1 | 1729/327680000000000000 5.2764892578125E-15

which sums to 0.50648, sufficient. So the answer to 3 is between 14 and 15.

R. J. Mathar
  • 2,324