【Example 3】Among the second-year high school students, 100 students are excellent in at least one of mathematics, physics, or chemistry. Among them, 70 are excellent in mathematics, 65 in physics, and 75 in chemistry, with 40 excellent in both mathematics and physics, 45 excellent in both mathematics and chemistry, and 25 excellent in all three subjects. How many students are excellent in both physics and chemistry but not in mathematics?
Let the sets of students who excel in mathematics, physics, and chemistry be denoted as $B_{1}$, $B_{2}$, and $B_{3}$, respectively. According to the problem, we have $\left|B_{1}\right|=70, \left|B_{2}\right|=65, \left|B_{3}\right|=75, \left|B_{1} \cap B_{2}\right|=40, \left|B_{1} \cap B_{3}\right|=45, \left|B_{1} \cap B_{2} \cap B_{3}\right|=25, \left|B_{1} \cup B_{2} \cup B_{3}\right|=100$. Therefore, by the inclusion-exclusion principle for $k=3$, we have
$$
100=(70+65+75)-\left(40+45+\left|B_{2} \cap B_{3}\right|\right)+25
$$

Thus, $\left|B_{2} \cap B_{3}\right|=50$. However, the number of students we are looking for includes those who excel in all three subjects, so the number of students who excel in physics and chemistry but not in mathematics is
$$
\begin{aligned}
\left|\bar{B}_{1} \cap B_{2} \cap B_{3}\right| & =\left|B_{2} \cap B_{3}\right|-\left|B_{1} \cap B_{2} \cap B_{3}\right| \\
& =50-25=25 \text { (students) }
\end{aligned}
$$