Example 3-6 Find the number of prime numbers not exceeding 120.
$$
11^{2}=121, \text{ any composite number not exceeding 120 must be a multiple of } 2,3,5,7, \text{ and the factors of composite numbers not exceeding 120 can only be } 2,3,5,7, \text{ that is, they can be divided by } 2,3,5 \text{ or } 7. \text{ Because they are prime numbers less than 11, let } A_{1} \text{ be the numbers less than 120 that are divisible by 2, } A_{2} \text{ be the numbers less than 120 that are divisible by 3, } A_{3}, A_{5} \text{ be the numbers less than 120 that are divisible by 5,7, respectively. } S=\{1,2, 3, \cdots, 120\},|S|=120, \text{ the prime numbers less than 120 are to be found, which is to find } A_{1} \cap \bar{A}_{2} \cap \bar{A}_{3} \cap \bar{A}_{4}. \text{ According to the principle of inclusion and exclusion, }
$$
$$
\begin{array}{l}
\left|\bar{A}_{1} \cap \bar{A}_{2} \cap \bar{A}_{3} \cap \bar{A}_{4}\right|=120-\left(\left|A_{1}\right|+\left|A_{2}\right|+\left|A_{3}\right|+\left|A_{4}\right|\right) \\
+\left(\left|A_{1} \cap A_{2}\right|+\left|A_{1} \cap A_{3}\right|\right) \\
+\left(\left|A_{1} \cap A_{4}\right|+\left|A_{2} \cap A_{3}\right|\right. \\
\left.+\left|A_{2} \cap A_{4}\right|+\left|A_{3} \cap A_{4}\right|\right) \\
-\left(\left|A_{1} \cap A_{2} \cap A_{3}\right|+\left|A_{1} \cap A_{2} \cap A_{4}\right|\right. \\
\left.+\left|A_{1} \cap A_{3} \cap A_{1}\right|+\left|A_{2} \cap A_{3} \cap A_{4}\right|\right) \\
+\left|A_{1} \cap A_{2} \cap A_{3} \cap A_{4}\right| \\
\left|A_{1}\right|=\left\lfloor\frac{120}{2}\right\rfloor=60, \quad\left|A_{2}\right|=\left\lfloor\frac{120}{3}\right\rfloor=40 \\
\left|A_{3}\right|=\left\lfloor\frac{120}{5}\right\rfloor=24, \quad\left|A_{4}\right|=\left\lfloor\frac{120}{7}\right\rfloor=17 \\
\left|A_{1} \cap A_{2}\right|=\left\lfloor\frac{120}{2 \times 3}\right\rfloor=20, \quad\left|A_{1} \cap A_{3}\right|=\left\lfloor\frac{120}{2 \times 5}\right\rfloor=12 \\
\left|A_{1} \cap A_{4}\right|=\left\lfloor\frac{120}{2 \times 7}\right\rfloor=8, \quad\left|A_{2} \cap A_{3}\right|=\left\lfloor\frac{120}{3 \times 5}\right\rfloor=8 \\
\left|A_{2} \cap A_{4}\right|=\left\lfloor\frac{120}{3 \times 7}\right\rfloor=5, \quad\left|A_{3} \cap A_{4}\right|=\left\lfloor\frac{120}{5 \times 7}\right\rfloor=3 \\
\left|A_{1} \cap A_{2} \cap A_{3}\right|=\left\lfloor\frac{120}{2 \times 3 \times 5}\right\rfloor=4 \\
\left|A_{1} \cap A_{2} \cap A_{4}\right|=\left\lfloor\frac{120}{2 \times 3 \times 7}\right\rfloor=\left\lfloor\frac{120}{42}\right\rfloor=2 \\
\left|A_{1} \cap A_{3} \cap A_{4}\right|=\left\lfloor\frac{120}{2 \times 5 \times 7}\right\rfloor=\left\lfloor\frac{120}{70}\right\rfloor=1 \\
\left|A_{2} \cap A_{3} \cap A_{4}\right|=\left\lfloor\frac{120}{3 \times 5 \times 7}\right\rfloor=\left\lfloor\frac{120}{105}\right\rfloor=1 \\
\left|A_{1} \cap A_{2} \cap A_{3} \cap A_{4}\right|=\left\lfloor\frac{120}{2 \times 3 \times 5 \times 7}\right\rfloor=\left\lfloor\frac{120}{210}\right\rfloor=0 \\
\end{array}
$$

So
$$
\begin{array}{c}
\left|\bar{A}_{1} \cap \bar{A}_{2} \cap \bar{A}_{3} \cap \bar{A}_{4}\right|=120-(60+40+24+17)+(20+12+8+8+5+3) \\
-(4+2+1+1)=27
\end{array}
$$