Date: 4 6 月 2014

random_2

random_1

顯示:編號

顯示:答案

Start

Reset

顯示:一般化結論

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