某市举行职工技能比赛活动, 甲厂派出 2 男 1 女共 3 名职工, 乙厂派出 2 男 2 女共 4 名职工

(1) 若从甲厂和乙厂报名的职工中各任选 1 名进行比赛, 求选出的 2 名职工性别相同的概率;

(2) 若从甲厂和乙厂报名的这 7 名职工中任选 2 名进行比赛, 求选出的这 2 名职工来自同一工厂的概率。
记甲厂派出的 2 名男职工为 $A_{1}, A_{2}$, 女职工为 $\mathrm{a}$; 乙厂派出的 2 名男职工为 $B_{1}, B_{2}$, 2 名女职工为 $b_{1}, b_{2}$.

(1) 从甲厂和乙厂报名的职工中各任选 1 名, 不同的结果有

$\left\{A_{1}, B_{1}\right\},\left\{A_{1}, B_{2}\right\},\left\{A_{1}, b_{1}\right\},\left\{A_{1}, b_{2}\right\},\left\{A_{2}, B_{1}\right\},\left\{A_{2}, B_{2}\right\}$

$\left\{A_{2}, b_{1}\right\},\left\{A_{2}, b_{2}\right\},\left\{a, B_{1}\right\},\left\{a, B_{2}\right\},\left\{a, b_{1}\right\},\left\{a, b_{2}\right\}$, 共 12 种.

其中选出的 2 名职工性别相同的结果有 $\left.\left\{A_{1}, B_{1}\right\},\left\{A_{1}, B_{2}\right\},\left\{A_{2}, B_{1}\right\},\left\{A_{2}, B_{2}\right\}, \mid a, b_{1}\right\},\left|a, b_{2}\right|$ 共 6 种。故选出的 2 名职工性别相同的概率 $P=\frac{6}{12}=\frac{1}{2}$

(2) 若从甲厂和乙厂报名的这 7 名职工中任选 2 名, 不同的结果有

$\left\{A_{1}, A_{2}\right\},\left\{A_{1}, a\right\},\left\{A_{1}, B_{1}\right\},\left\{A_{1}, B_{2}\right\},\left\{A_{1}, b_{1}\right\},\left\{A_{1}, b_{2}\right\}$

$\left.\left\{A_{2}, a\right\},\left\{A_{2}, B_{1}\right\},\left\{A_{2}, B_{2}\right\},\left\{A_{2}, b_{1}\right\},\left\{A_{2}, b_{2}\right\}, \mid a, B_{1}\right\},\left\{a, B_{2}\right\}$

, $\left.\left\{a, b_{1}\right\},\left\{a, b_{2}\right\},\left\{B_{1}, B_{2}\right\},\left\{B_{1}, b_{1}\right\},\left\{B_{1}, b_{2}\right\},\left\{B_{2}, b_{1}\right\},\left\{B_{2}, b_{2}\right\},\left\{b_{1}, b_{2}\right\}\right\}$, 共 21 种.