Soru

Zorluk: ZorSet Theory Concepts and Venn Diagrams

A software security audit evaluated 500500 open-source repositories for three specific vulnerability types: SQL Injection (SS), Cross-Site Scripting (XX), and Buffer Overflow (BB). Exactly 8080 repositories had none of these vulnerabilities. The audit revealed the following data:

- 220220 repositories contained SQL Injection vulnerabilities.
- 190190 repositories contained Cross-Site Scripting vulnerabilities.
- 210210 repositories contained Buffer Overflow vulnerabilities.
- 7575 repositories contained both SQL Injection and Cross-Site Scripting vulnerabilities.
- 8080 repositories contained both Cross-Site Scripting and Buffer Overflow vulnerabilities.
- 3030 repositories contained all three vulnerability types.

How many of the audited repositories contained Buffer Overflow vulnerabilities ONLY?

  1. A
    5555
  2. 8585Cevap
  3. C
    100100
  4. D
    130130
  5. E
    155155

Cevap

85 repositories contained Buffer Overflow vulnerabilities only.
The total number of repositories containing at least one vulnerability is 50080=420500 - 80 = 420. Using the inclusion-exclusion formula SXB=S+X+B(SX+XB+SB)+SXB|S \cup X \cup B| = |S| + |X| + |B| - (|S \cap X| + |X \cap B| + |S \cap B|) + |S \cap X \cap B|, we substitute the known values: 420=220+190+210(75+80+SB)+30420 = 220 + 190 + 210 - (75 + 80 + |S \cap B|) + 30. Solving gives 420=650155SB420 = 650 - 155 - |S \cap B|, so SB=75|S \cap B| = 75. The repositories containing Buffer Overflow ONLY are given by subtracting the overlapping regions from the total Buffer Overflow set: B(SB only)(XB only)SXB=210(7530)(8030)30=210455030=85|B| - (|S \cap B| \text{ only}) - (|X \cap B| \text{ only}) - |S \cap X \cap B| = 210 - (75 - 30) - (80 - 30) - 30 = 210 - 45 - 50 - 30 = 85.

Adım Adım Çözüm

1
Calculate the total number of repositories containing at least one vulnerability
SXB=50080=420|S \cup X \cup B| = 500 - 80 = 420
The total population is 500 and 80 repositories have no vulnerabilities.
2
Apply the 3-Set Inclusion-Exclusion Principle to determine the sum of pairwise intersections
SX+XB+SB=230|S \cap X| + |X \cap B| + |S \cap B| = 230
From SXB=S+X+B(SX+XB+SB)+SXB|S \cup X \cup B| = |S| + |X| + |B| - (|S \cap X| + |X \cap B| + |S \cap B|) + |S \cap X \cap B|, we get 420=220+190+210intersections+30420 = 220 + 190 + 210 - \sum |\text{intersections}| + 30, so intersections=650420=230\sum |\text{intersections}| = 650 - 420 = 230.
3
Find the missing pairwise intersection SB|S \cap B|
SB=75|S \cap B| = 75
Since SX=75|S \cap X| = 75 and XB=80|X \cap B| = 80, we have 75+80+SB=23075 + 80 + |S \cap B| = 230, which yields SB=75|S \cap B| = 75.
4
Calculate the number of repositories with Buffer Overflow ONLY
B only=85|B \text{ only}| = 85
Subtract the exclusive two-set overlaps and the three-set overlap from B|B|: B only=B(SBSXB)(XBSXB)SXB=210(7530)(8030)30=210455030=85|B \text{ only}| = |B| - (|S \cap B| - |S \cap X \cap B|) - (|X \cap B| - |S \cap X \cap B|) - |S \cap X \cap B| = 210 - (75 - 30) - (80 - 30) - 30 = 210 - 45 - 50 - 30 = 85.

Anahtar Kavram

Three-Set Inclusion-Exclusion Principle and Venn Diagram Region Analysis
Bu soruyu puanla