Calculating the probability of an element being in 2 subsets

106 Views Asked by At

I've just started to learn about "Probability-Theory" and came across this problem that i want to calculate.
I've given a total amount of 28 million elements. Following information is given: In total there are 2562 elements with Attribute A and 3 elements with the Attribute B. Now how can i calculate the probability that one randomly drawn element has BOTH Attributes A and B
And how does the probability behave if I draw X elements (without replacement).

I've also drawn a little picture to visualize my problem.

Thanks in advance,

Koapsii

Edit: The Attributes are randomly distributed. So:
Step 1: Go through the 28 mil and distribute Attribute A randomly
Step 2: Go through the 28 mil and distribute Attribute B randomly
Step 3: Calculate amount/likelihood that an element has Attribute A AND B

The problem is about IT Security. In total there are 28 mil software entities, researches estimated that there are ~2562 hidden vulnerabilities (so called ZeroDay vulnerabilities) in these software entities and now I want to find out what's the chance that one of my 3 software entities is affected by those 2562 hidden vulnerabilities. There is no way i can look that up, because this is exactly what i want to know. The chance of being affected

probability

1

There are 1 best solutions below

6
On BEST ANSWER

Your calculation assumes that having attribute A and attribute B are independent. It would apply if you went through the elements and gave them attribute A with probability $\frac {2562}{28,000,000}$ and attribute B with probability $\frac {3}{28,000,000}$. Given that you have the sample and exact numbers with each attribute they can't be independent. If there is one that has both attributes, given a $B$ the chance it is an $A$ is (at least) $\frac 13$. If there are none with both attributes the chance that a $B$ is also an $A$ is $0$. Both of these are different from $\frac {2562}{28,000,000}$.