# What is the best way to test of draws ( 10,000 unique possibilities) from multiple sample are random?

say I have 6 people drawing from their own box, each box contains 10,000 unique barcodes. Now at the end of the experiment each person has drawn roughly 10-20 barcodes. How do I test if the barcodes are not siginficantly overlapping between each person. In other words I want to show that the barcodes are just random? I'm thinking of something like a hypergeometric test or some sort of contigency table, however in this case there there are N=6 and 10,000 unique rows.

thanks!

• @BruceET I think this is a good point - I will try it out. The example above is very close to my real experiment. I did not want to get to technical but esentially the barcodes are strips of DNA with a disntinct signature. Each cells contains the unique barcode and this is a control experiment where we want to make sure that the surviving clones are just due to random and not specific to inserted barcodes. Commented Aug 7, 2021 at 1:10
• @BruceET this is interesting, so basically if I can show that through a stimulation given X selection I will have < Y duplicates, I can use this a sort of a baseline? thanks I like it. Commented Aug 7, 2021 at 1:33
• OK. Your mechanism seems right. And I did my simulation again. It is rare to have more than 2 duplicates out of 80 selections altogether from the six groups. The 99th percentile is 2 matches, max nr of matches in 100,000 iterations was 5. // Have an appointment now. Will post R code for my my simulation in 3-4 hrs if you want to see it. Commented Aug 7, 2021 at 1:34
• Fine tuning: is it possible to have a duplicate within one of the six groups?. // For simulation, it is OK to have all six groups sample exact;y 15 barcodes? If not, what is the approx. dist'n of group barcode counts 10-20? Proportions 1:1:2;2,3:4:3:2:2,1:1 out of 22? Commented Aug 7, 2021 at 2:21
• @BruceET yes, it is possible for all 6 to all have the same barcodes since each sample is drawing from their own box of barcodes. Commented Aug 7, 2021 at 2:27

R code for simulation per discussion in comments. For comments I did 100,000 iterations; here I did a million iterations for greater precision.

set.seed(806)   # for reproducibility
m = 10^6
d = numeric(m)  # duplicates
n = 80          # barcodes chosen
for (i in 1:m) {
x = sample(1:10000, n, rep=T)
d[i] = n - length(unique(x))
}
mean(d)
[1] 0.315031   # mean nr of matches among 80
summary(d)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
0.000   0.000   0.000   0.315   1.000   6.000

quantile(d, c(.9, .95, .99))
90% 95% 99%
1   1   2    # rare to get 2 or more matches


With n = 20, we see that it is rare to have one duplicate in a single group of 20. [Even more so for a single group of 10.]