Date: 5 6 月 2014

Next

Reset

g = 3 (slider from 3 to 9, step 1)
r = 7 (slider from 3 to 9, step 1)
b = 18
A_1 = (-0.38, -0.24)
B_1: A_1 + (b, 0)
d = 8
D_1: A_1 + (0, d)
C_1: (x(B_1), y(D_1))
poly1 = PolyLine(A_1, B_1, C_1, D_1, A_1)
A_2: g / (r + g) * B_1 + r / (r + g) * A_1
n = 0 (slider from 0 to 16, step 1)
A_3: (x(A_2), y(D_1))
s_1 = Segment(A_2, A_3)
rec1, a_1, a_2, a_3, d_1 = Polygon(A_1, A_2, A_3, D_1)
rec2, a_4, a_5, b_1, c_1 = Polygon(A_3, A_2, B_1, C_1)
B_2: (g - 1) / (r + g - 1) * D_1 + r / (r + g - 1) * A_1
B_3: (x(A_2), y(B_2))
rec3, a_6, a_7, b_3, b_2 = Polygon(A_1, A_2, B_3, B_2)
B_4: g / (g + r - 1) * C_1 + (r - 1) / (r + g - 1) * B_1
B_5: (x(A_2), y(B_4))
rec4, b_4, a_8, b_5, b_6 = Polygon(B_1, A_2, B_5, B_4)
s_2 = Segment(B_2, B_3)
s_3 = Segment(B_5, B_4)
rec5, a, c, e, f = Polygon(B_2, A_1, (g - 2) / (r + g - 2) * A_2 + r / (r + g - 2) * A_1, (g - 2) / (r + g - 2) * B_3 + r / (r + g - 2) * B_2)
rec6, h, i, j, q = Polygon(B_2, D_1, (g - 1) / (r + g - 2) * A_3 + (r - 1) / (r + g - 2) * D_1, (g - 1) / (r + g - 2) * B_3 + (r - 1) / (r + g - 2) * B_2)
rec7, k, l, s, t = Polygon(B_5, A_2, (g - 1) / (r + g - 2) * B_1 + (r - 1) / (r + g - 2) * A_2, (g - 1) / (r + g - 2) * B_4 + (r - 1) / (r + g - 2) * B_5)
rec8, m, p, e_1, f_1 = Polygon(B_5, A_3, g / (r + g - 2) * C_1 + (r - 2) / (r + g - 2) * A_3, g / (r + g - 2) * B_4 + (r - 2) / (r + g - 2) * B_5)
text1: "P(甲)=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}"
text8: "" + (LaTeX[text1]) + ""
list1 = Sequence(Segment[A_1 + (k * (B_1 - A_1)) / (r + g), D_1 + (k * (B_1 - A_1)) / (r + g)], k, 1, r + g - 1)
list2 = Sequence(Segment[A_1 + (k * (D_1 - A_1)) / (r + g - 1), B_1 + (k * (D_1 - A_1)) / (r + g - 1)], k, 1, r + g - 2)
text2: "P(乙_1)=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}×\frac{" + (LaTeX[g - 1]) + "}{" + (LaTeX[r + g - 1]) + "}"
text3: "P(乙_2)=\frac{" + (LaTeX[r]) + "}{" + (LaTeX[r + g]) + "}×\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g - 1]) + "}"
text9: "P(乙)=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}×\frac{" + (LaTeX[g - 1]) + "}{" + (LaTeX[r + g - 1]) + "}" + (LaTeX[If[n ≟ 8, "+"]]) + "" + (LaTeX[If[n ≟ 8, "\frac{" + r + "}{" + (g + r) + "}×\frac{" + g + "}{" + (g + r - 1) + "}=\frac{" + g + "}{" + (g + r) + "}"]]) + ""
list3 = Sequence(Segment[A_1 + (k * (A_2 - A_1)) / (g + r - 2), B_2 + (k * (A_2 - A_1)) / (g + r - 2)], k, 1, g + r - 3)
text4: "P(丙_1)=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[g + r]) + "}×\frac{" + (LaTeX[g - 1]) + "}{" + (LaTeX[g + r - 1]) + "}×\frac{" + (LaTeX[g - 2]) + "}{" + (LaTeX[g + r - 2]) + "}"
list4 = Sequence(Segment[B_2 + (k * (A_2 - A_1)) / (g + r - 2), D_1 + (k * (A_2 - A_1)) / (g + r - 2)], k, 1, g + r - 3)
text5: "P(丙_2)＝\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}×\frac{" + (LaTeX[r]) + "}{" + (LaTeX[r + g - 1]) + "}×\frac{" + (LaTeX[g - 1]) + "}{" + (LaTeX[r + g - 2]) + "}"
list5 = Sequence(Segment[A_2 + (k * (B_1 - A_2)) / (r + g - 2), B_5 + (k * (B_1 - A_2)) / (r + g - 2)], k, 1, r + g - 3)
text6: "P(丙_3)=\frac{" + (LaTeX[r]) + "}{" + (LaTeX[g + r]) + "}×\frac{" + (LaTeX[g]) + "}{" + (LaTeX[g + r - 1]) + "}×\frac{" + (LaTeX[g - 1]) + "}{" + (LaTeX[g + r - 2]) + "}"
text10: "P(丙)=\frac{" + (LaTeX[g]) + "}{" + (LaTeX[r + g]) + "}×\frac{" + (LaTeX[g - 1]) + "}{" + (LaTeX[r + g - 1]) + "}×\frac{" + (LaTeX[g - 2]) + "}{" + (LaTeX[r + g - 2]) + "}" + (LaTeX[If[n ≥ 12, "+"]]) + "" + (LaTeX[If[n ≥ 12, "\frac{" + g + "}{" + (r + g) + "}×\frac{" + r + "}{" + (r + g - 1) + "}×\frac{" + (g - 1) + "}{" + (r + g - 2) + "}"]]) + "" + (LaTeX[If[n ≥ 14, "+"]]) + "" + (LaTeX[If[n ≥ 14, "\frac{" + r + "}{" + (r + g) + "}×\frac{" + g + "}{" + (r + g - 1) + "}×\frac{" + (g - 1) + "}{" + (r + g - 2) + "}"]]) + "" + (LaTeX[If[n ≥ 16, "+"]]) + "" + (LaTeX[If[n ≥ 16, "\frac{" + r + "}{" + (r + g) + "}×\frac{" + (r - 1) + "}{" + (r + g - 1) + "}×\frac{" + g + "}{" + (r + g - 2) + "}=\frac{" + g + "}{" + (r + g) + "}"]]) + ""
list6 = Sequence(Segment[B_5 + (k * (B_4 - B_5)) / (r + g - 2), A_3 + (k * (B_4 - B_5)) / (r + g - 2)], k, 1, r + g - 3)
text7: "P(丙_4)=\frac{" + (LaTeX[r]) + "}{" + (LaTeX[g + r]) + "}×\frac{" + (LaTeX[r - 1]) + "}{" + (LaTeX[g + r - 1]) + "}×\frac{" + (LaTeX[g]) + "}{" + (LaTeX[g + r - 2]) + "}"
text_Q: "袋中有中獎籤" + (LaTeX[g]) + " 支，\;沒中獎籤" + (LaTeX[r]) + " 支，\;今甲,乙,丙三人從袋中依序抽一支籤，\;抽出後不放回，\;試求三人抽中有獎籤的機率？"