# Thread: Chance of two different sets of locks to produce different combinations

1. ## Chance of two different sets of locks to produce different combinations

Hello all,

I am a bioinformatician with a statistical/combinatorial problem - ...a common condition in my field. A bioinformatician can conceive and write the code for very complex problems of biological data, but when it comes to statistics, it is often complete panic in the ranks !

After this short introduction, I will try to rephrase my problem to make it accessible to a larger number of experts:

-------------------------------------------------------
I have two Sets of 4-digit combination locks.

Set-1 consists of 300 locks.
Each digit in a lock in set-1 accepts only a reduced set of numbers (so the complete range 0-9 is not available):
digit-1: 12345 (5 possible numbers)
digit-2: 3456 (4 possible numbers)
digit-3: 890 (3 possible numbers)
digit-4: 123456 (6 possible numbers)
I create a combination for each one of my 300 Set-1 locks - I don't care if a combination is repeated more than once.

Set-2 consists of 20 locks
Each digit in a lock in set-2 accepts a different reduced set of numbers:
digit-1: 4567 (4 possible numbers)
digit-2: 123 (3 possible numbers)
digit-3: 567890 (6 possible numbers)
digit-4: 45 (2 possible numbers)
I create again a combination for each one of my 20 Set-2 locks and I don't care if a combination is repeated.

My question is:
How can I calculate the probability that all 20 Set-2 locks produce a combination that is never observed in my 300 combinations of Set-1 locks?

I have started digging my way through permutations and combinations, Binomial coefficients, Bernouli theorem, Pascal triangles, etc., etc... but I am not ashamed to admit that I have large gaps in these areas which are not easily filled without consultation with an expert in the field. In other words I cannot apply the theory on my problem...

Regards.

2. ## Re: Chance of two different sets of locks to produce different combinations

Ok, so let me venture a possible solution.

The total possible combinations in set-1 locks is
C1(total) = 5x4x3x6 = 360
For set-2 we have:
C2(total) = 4x3x6x2 = 144

digit-1 has 2 common numbers between the respective pools of set-1 and set-2
digit-2 has 1 common numbers between the respective pools of set-1 and set-2
digit-3 has 3 common numbers between the respective pools of set-1 and set-2
digit-4 has 2 common numbers between the respective pools of set-1 and set-2

So there are C(common)=2x1x3x2=12 possible combinations that are common between the two sets of locks.
The chance that a potential common combination is produced by any set-1 lock is:
P1(common) = 12/360 = 0.033
The same chance for a common combination from any lock in set-2 is:
P2(common) = 12/144 = 0.083

Then I used an online calculator of binomial probability, once for each set of locks.

For set-1, I used:
probability of success P = 0.033
number of trials N = 300
number of successes K = 0

==> Binomial Probability that one of the 12 common combination never occurs after 300 trials P1(x=0) = 4.24e^-5

Then, for set-2:
probability of success P = 0.083
number of trials N = 20
number of successes K = 0

==> Binomial Probability that one of the 12 common combination never occurs after 20 trials P2(x=0) = 0.175

We want the probability that no common combination appears between the 300 set-1 locks and the 20 set-2 locks.
So we want that no potentially common combinations appear in set-1, or that no potentially common combinations appear in set-1, or that none of set-1 and set-2 produce a potentially common combination.
P(cumulative)= P1(x=0)+P2(x=0)+(P1(x=0)*P2(x=0)) = 0.000042 + 0.175 + (0.000042 * 0.175) =~ 0.175 or 17.5%

Can anyone please confirm that this solution is correct?
Thanks-