P(紅球比綠球先取完或紅球比藍球先取完)
\cr \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;=P(紅球比綠球先取完)+P(紅球比藍球先取完)-P(紅球比綠球先取完且紅球比藍球先取完)

依據取捨原理(排容原理)

P(紅球先取完)=P(紅球比綠球先取完)+P(紅球比藍球先取完)-P(紅球比綠球先取完或紅球比藍球先取完)

=\frac{g}{r+g}+\frac{b}{r+b}-\frac{g+b}{r+g+b}

Next

Reset

紅球比綠
\cr球先取完

紅球比藍
\cr 球先取完

紅球比綠球先
\cr 取完且紅球比
\cr 藍球先取完

紅球先取完

r0 = 3
n = 0 (slider from 0 to 6, step 1)
A = Corner(4)
r = 5 (slider from 1 to 9, step 1)
g = 4 (slider from 1 to 9, step 1)
b = 3 (slider from 1 to 9, step 1)
textQ: "一個不透明的袋中有大小材質相同的" + (LaTeX[r]) + "個紅球," + (LaTeX[g]) + "個綠球," + (LaTeX[b]) + "個藍球，\;每次取出一球，\;取後不放回，\;試求紅球先取完的機率."
text5: "=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}+\frac{" + (LaTeX[b]) + "}{" + (LaTeX[b + r]) + "}-\frac{" + (LaTeX[g + b]) + "}{" + (LaTeX[r + g + b]) + "}"
text6: "=" + (LaTeX[SurdText[(((g * b) * (b + g + (2 * r)))) / ((((r + g + b) * (r + b)) * (r + g)))]]) + ""
B: (0.5 * Corner[1]) + (0.5 * Corner[3]) - (0, 1.8)
d0: r0 / 2
C_1: B + (d0, 0)
C_2: B + ((-d0), 0)
c_a = Circle(C_1, r0)
c_b = Circle(C_2, r0)
C = Intersect(c_a, c_b, 2)
D = Intersect(c_a, c_b, 1)
c = CircumcircleArc(C, C_2, D)
d = CircumcircleArc(C, C_1, D)
list1: {c, d}
P_1 = Point(list1)
Q_1: P_1 + (0, 0)
lcs1 = Locus(Q_1, P_1)
E = Point(c_b)
F = Point(c_a)
e = CircleArc(C_2, C, D)
list2: {c, e}
P_2 = Point(list2)
Q_2: P_2 + (0, 0)
lcs2 = Locus(Q_2, P_2)
f = CircleArc(C_1, D, C)
list3: {f, d}
P_3 = Point(list3)
Q_3: P_3 + (0, 0)
lcs3 = Locus(Q_3, P_3)