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

依據取捨原理(排容原理)與笛摩根定理

$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;=P(紅球比綠球先取完)+P(紅球比藍球先取完)-[1-P(綠球比紅球先取完且藍球比紅球先取完)]$

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

Next

Reset

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

n = 0 (slider from 0 to 7, 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]) + "個藍球，\;每次取出一球，\;取後不放回，\;試求紅球先取完的機率."
text6: "=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}+\frac{" + (LaTeX[b]) + "}{" + (LaTeX[r + b]) + "}-\frac{" + (LaTeX[g + b]) + "}{" + (LaTeX[r + g + b]) + "}"
text7: "=" + (LaTeX[SurdText[g / (r + g) + b / (r + b) - (g + b) / (r + g + b)]]) + ""