Students Coding 570F7E
1. **Problem Statement:**
In a bootcamp of 60 students:
- 35 students can code in Python.
- 40 students can code in Java.
- 10 students can code in neither Python nor Java.
Find:
1. Number of students who code in both languages.
2. Number of students who code in exactly one language.
2. **Formula and Rules:**
We use the principle of inclusion-exclusion for two sets $A$ and $B$:
$$|A \cup B| = |A| + |B| - |A \cap B|$$
where:
- $|A|$ is the number of students coding in Python.
- $|B|$ is the number of students coding in Java.
- $|A \cap B|$ is the number coding in both.
- $|A \cup B|$ is the number coding in at least one language.
3. **Step-by-step Solution:**
- Total students = 60
- Students coding neither = 10
- Therefore, students coding at least one language:
$$|A \cup B| = 60 - 10 = 50$$
- Using inclusion-exclusion:
$$|A \cup B| = |A| + |B| - |A \cap B|$$
Substitute known values:
$$50 = 35 + 40 - |A \cap B|$$
- Solve for $|A \cap B|$:
$$|A \cap B| = 35 + 40 - 50 = 25$$
- Number coding in exactly one language is:
$$|A| + |B| - 2|A \cap B| = 35 + 40 - 2 \times 25 = 75 - 50 = 25$$
4. **Final answers:**
- Students coding in both languages: **25**
- Students coding in exactly one language: **25**