Date: 4 6 月 2014

random_2

random_1

顯示:編號

顯示:答案

Start

Reset

顯示:一般化結論

b_1 = 0.29 (slider from 0 to 1, step 0.01)
a = 0.13 (slider from 0 to 1, step 0.01)
r = 5 (slider from 1 to 10, step 1)
g = 4 (slider from 1 to 10, step 1)
b = 3 (slider from 1 to 10, step 1)
A = (5.374986021771889, 1.5102905583865378)
B = (0.5758915147749438, -1.9601290231195152)
k = 0 (slider from 0 to 4, step 0.01)
c = false
text1 = Text("待取的球擺放區", A + (0, 0.5), true, true)
list0 = Join({Sequence[Segment[B + (i, 0), B + (i, -1)], i, 0, r + g + b], Sequence[Segment[B + (0, -i), B + (r + g + b, -i)], i, 0, 1], Sequence[Text["" + (i), B + (i - 1, 0.4), true, true], i, 1, r + g + b]})
list2 = Append(r + g + b, Shuffle[a * 0 + b_1 * 0 + Sequence[i, i, 1, r + g + b - 1]])
list3 = Take(list2, 1, b)
list4: list2 \ list3
list6 = Shuffle(a * 0 + Sequence[i, i, 1, b])
list7 = Shuffle(a * 0 + Sequence[i, i, 1, g])
list8 = Shuffle(a * 0 + Sequence[i, i, 1, r])
list5 = Join({list3, {Max[list4]}, list4 \ {Max[list4]}})
list9 = Join({list6, list7, list8})
list10 = Join({Sequence[A + (Element[list6, i] - 1, -2), i, 1, b], {A + (Element[list7, 1] - 1, -1)}})
list11 = Join({Sequence[A + (Element[list7, i] - 1, -1), i, 2, g], Sequence[A + (Element[list8, i] - 1, 0), i, 1, r]})
list12 = Join({list10, list11})
list13 = Sequence(If[i ≟ 1, If[k < 1, Element[list12, i] + k * (B + (Element[list5, i] - 1, 0) - Element[list12, i]), B + (Element[list5, i] - 1, 0)], If[i ≤ b, If[k ≤ 1, Element[list12, i], If[k ≥ 2, B + (Element[list5, i] - 1, 0), Element[list12, i] + (k - 1) * (B + (Element[list5, i] - 1, 0) - Element[list12, i])]], If[i ≟ b + 1, If[k ≤ 2, Element[list12, i], If[k ≥ 3, B + (Element[list5, i] - 1, 0), Element[list12, i] + (k - 2) * (B + (Element[list5, i] - 1, 0) - Element[list12, i])]], If[k ≤ 3, Element[list12, i], Element[list12, i] + (k - 3) * (B + (Element[list5, i] - 1, 0) - Element[list12, i])]]]], i, 1, r + g + b)
list1: {Polygon[A, A + (Max[{r, g, b}], 0), A + (Max[{r, g, b}], -3), A + (0, -3)]}
list16 = Sequence(Polygon[B + (Element[list5, i], 0), B + (Element[list5, i] - 1, 0), 4], i, 1, 1)
list17 = Sequence(Polygon[B + (Element[list5, i], 0), B + (Element[list5, i] - 1, 0), 4], i, 2, b)
list18 = Sequence(Polygon[B + (Element[list5, i], 0), B + (Element[list5, i] - 1, 0), 4], i, b + 1, b + 1)
list19 = Sequence(Polygon[B + (Element[list5, i], 0), B + (Element[list5, i] - 1, 0), 4], i, b + 2, r + g + b)
list20: {Sequence[Segment[A + (i, 0), A + (i, -3)], i, 0, Max[{r, g, b}]], Sequence[Segment[A + (0, i), A + (Max[{r, g, b}], i)], i, 0, -3, -1]}
d = true
e = false
text2 = Text("取出的球依序擺放區", B + (0, 0.8), true, true)
list21 = Sequence(Circle[Element[list13, i] + (0.5, -0.5), 0.4], i, 1, b)
list22 = Sequence(Circle[Element[list13, i] + (0.5, -0.5), 0.4], i, b + 1, b + g)
list23 = Sequence(Circle[Element[list13, i] + (0.5, -0.5), 0.4], i, b + g + 1, r + b + g)
list15 = Sequence(Text[If[i ≤ b, "\textcolor{#00ffff}{" + (Element[list9, i]) + "}", If[i ≤ g + b, "\textcolor{#003300}{" + (Element[list9, i]) + "}", "\textcolor{#ffff00}{" + (Element[list9, i]) + "}"]], Element[list13, i] + (0.25, -0.2), true, true], i, 1, r + g + b)
text4: "狀況(2):r個紅球,g個綠球, b個藍球取出排成一列,\underline{\textcolor{red}{紅球先拿完}}且\underline{\textcolor{blue}{最後一個是藍球}}
\cr\text{             }" + (LaTeX[If[c ≟ 1, "★(有編號時視為相異物,利用完全相異物的排列)", "★(無編號時視為相同物,利用不盡相異物的排列)"]]) + "
\cr(1).方法數:
\cr\text{    } " + (LaTeX[If[c ≟ 1, "C^b_1·P^{r+g+b-1}_{b-1}·C^g_1·(r+g-1)!=b·\frac{(r+g+b-1)!}{(r+g)!}·g·(r+g-1)!=\frac{g·b·(r+g+b-1)!}{r+g}", "1·C^{r+g+b-1}_{b-1}·1·\frac{(r+b-1)!}{r!·(g-1)!}=\frac{(r+g+b-1)!}{(b-1)!·(r+b)!}·\frac{(r+b-1)!}{r!·(g-1)!}=\frac{(r+g+b-1)!}{(r+g)·r!·(b-1)!·(g-1)!}"]]) + "
\cr(2).機率:
\cr\text{   } " + (LaTeX[If[c ≟ 1, "\frac{C^b_1·P^{r+g+b-1}_{b-1}·C^g_1·(r+g-1)!}{(r+g+b)!}=\frac{b·\frac{(r+g+b-1)!}{(r+g)!}·g·(r+g-1)!}{(r+g+b)!}=\frac{\text{  }\frac{g·b·(r+g+b-1)!}{r+g}\text{  }}{(r+g+b)!}=\textcolor{red}{\frac{g}{r+g}·\frac{b}{r+b+g}}", "\frac{1·C^{r+g+b-1}_{b-1}·1·\frac{(r+b-1)!}{r!·(g-1)!}}{\frac{(r+g+b)!}{r!·g!·b!}}=\frac{\frac{(r+g+b-1)!}{(r+g)·r!·(b-1)!·(g-1)!}}{\frac{(r+g+b)!}{r!·g!·b!}}=\frac{\text{  }\frac{1}{(r+g)}\text{  }}{\frac{(r+g+b)}{g·b}}=\textcolor{red}{\frac{g}{r+g}·\frac{b}{r+b+g}}"]]) + ""
text3: "狀況(2):" + (LaTeX[r]) + " 個紅球, " + (LaTeX[g]) + "個綠球, " + (LaTeX[b]) + "個藍球取出排成一列, \underline{\textcolor{red}{紅球先拿完}}且\underline{\textcolor{blue}{最後一個是藍球}}
\cr \text{             }" + (LaTeX[If[c ≟ 1, "★(有編號時視為相異物,利用完全相異物的排列)", "★(無編號時視為相同物,利用不盡相異物的排列)"]]) + "
\cr" + (LaTeX[If[k > 0, "(1).先由\underline{藍球}中拿一球放在\underline{第" + (r + g + b) + "位置}⇒有\underline{\text{  }" + (If[d ≟ 1, If[c ≟ 1, "C^{" + b + "}_{1}", "1"], "?"]) + "\text{  }}種方法", ""]]) + "
\cr" + (LaTeX[If[k ≥ 1, "(2).在剩下的\underline{" + (r + g + b - 1) + "位置}中,任選\underline{" + (b - 1) + "位置}(準備放入其他藍球)" + (If[k > 1, "將" + (b - 1) + "個藍球排入選好的" + (b - 1) + "個位置上⇒有\underline{\text{  }" + (If[d ≟ 1, If[c ≟ 1, "P^{" + (r + g + b - 1) + "}_{" + (b - 1) + "}", "C^{" + (r + g + b - 1) + "}_{" + (b - 1) + "}"], "?"]) + "\text{  }}種方法", ""]), ""]]) + "
\cr" + (LaTeX[If[k > 2, "(3).由\underline{綠球}中拿一球放在\underline{剩下" + (r + g) + "位置的最右邊位置}⇒有\underline{\text{  }" + (If[d ≟ 1, If[c ≟ 1, "C^{" + g + "}_{1}", "1"], "?"]) + "\text{  }}種方法", ""]]) + "
\cr" + (LaTeX[If[k > 3, "(4).將剩下的\underline{" + (g - 1) + "個綠球}及\underline{" + r + "個紅球}排入剩下的\underline{" + (g + r - 1) + "個位置}上⇒有\underline{\text{  }" + (If[d ≟ 1, If[c ≟ 1, "" + (g + r - 1) + "!", "\frac{" + (g + r - 1) + "!}{" + (g - 1) + "!·" + r + "!}"], "?"]) + "\text{  }}種方法", ""]]) + "
\cr" + (LaTeX[If[k ≟ 4, "結論:共有\underline{\text{  }\textcolor{blue}{" + (If[d ≟ 1, If[c ≟ 1, "C^{" + b + "}_{1}·P^{" + (r + g + b - 1) + "}_{" + (b - 1) + "}·C^{" + g + "}_{1}·" + (g + r - 1) + "!", "1·C^{" + (r + g + b - 1) + "}_{" + (b - 1) + "}·1·\frac{" + (g + r - 1) + "!}{" + (g - 1) + "!·" + r + "!}"], "?"]) + "}\text{  }}種不同的排列方法", ""]]) + "
 " + (LaTeX[If[k ≟ 4, "⇒機率:\textcolor{blue}{\frac{\text{  }" + (If[d ≟ 1, If[c ≟ 1, "C^{" + b + "}_{1}·P^{" + (r + g + b - 1) + "}_{" + (b - 1) + "}·C^{" + g + "}_{1}·" + (g + r - 1) + "!", "1·C^{" + (r + g + b - 1) + "}_{" + (b - 1) + "}·1·\frac{" + (g + r - 1) + "!}{" + (g - 1) + "!·" + r + "!}"], "?"]) + "\text{  }}{" + (If[d ≟ 1, If[c ≟ 1, "" + (r + g + b) + "!", "\frac{" + (r + g + b) + "!}{" + r + "!·" + g + "!·" + b + "!}"], "?"]) + "}}", ""]]) + "" + (LaTeX[If[k ≟ 4, "" + (If[d ≟ 1, "=" + "\textcolor{red}{\frac{" + ((b * g) / GCD[b * g, (r + g) * (r + b + g)]) + "}{" + (((r + g) * (r + b + g)) / GCD[b * g, (r + g) * (r + b + g)]) + "}}", ""]), ""]]) + ""