Date: 7 6 月 2014

random_2

random_1

顯示:編號

顯示:答案

Start

Reset

b_1 = 0.6 (slider from 0 to 1, step 0.01)
B = (-2.02672486166423, -2.7365114609250183)
r = 2 (slider from 1 to 10, step 1)
b = 4 (slider from 1 to 10, step 1)
g = 3 (slider from 1 to 10, step 1)
a = 0.42 (slider from 0 to 1, step 0.01)
list9 = Shuffle(a * 0 + Sequence[i, i, 1, r + g + b])
list19 = Join({Take[list9, 1, r], Shuffle[b_1 * 0 + Take[list9, r + 1, r + g + b]]})
A = (6, 2)
k = 0 (slider from 0 to 3, step 0.01)
c = false
text2 = Text("取出的球依序擺放區", B + (0, 1), true, true)
list3 = Shuffle(a * 0 + Sequence[i, i, 1, g])
list2 = Shuffle(a * 0 + Sequence[i, i, 1, r])
list4 = Shuffle(a * 0 + Sequence[i, i, 1, b])
list5 = Join({list2, list3, list4})
list1: {Polygon[A, A + (Max[{r, g, b}], 0), A + (Max[{r, g, b}], -3), A + (0, -3)]}
list6 = Sequence(A + (Element[list2, i] - 1, 0), i, 1, r)
list7 = Sequence(A + (Element[list3, i] - 1, -1), i, 1, g)
list11 = Sequence(B + (Element[list19, i] - 1, 0), i, 1, r + g + b)
list8 = Sequence(A + (Element[list4, i] - 1, -2), i, 1, b)
list10 = Join({list6, list7, list8})
list12 = Sequence(If[i ≤ r, If[k < 1, Element[list10, i] + k * (Element[list11, i] - Element[list10, i]), Element[list11, i]], If[i ≤ r + g, If[k ≤ 1, Element[list10, i], If[k ≥ 2, Element[list11, i], Element[list10, i] + (k - 1) * (Element[list11, i] - Element[list10, i])]], If[k ≤ 2, Element[list10, i], If[k ≥ 3, Element[list11, i], Element[list10, i] + (k - 2) * (Element[list11, i] - Element[list10, i])]]]], i, 1, r + g + b)
list15: {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]}
list17 = Sequence(Polygon[B + (Element[list19, i], 0), B + (Element[list19, i] - 1, 0), 4], i, r + 1, r + g)
list16 = Sequence(Polygon[B + (Element[list19, i], 0), B + (Element[list19, i] - 1, 0), 4], i, 1, r)
list18 = Sequence(Polygon[B + (Element[list19, i], 0), B + (Element[list19, i] - 1, 0), 4], i, r + g + 1, r + g + b)
d = true
list20 = Sequence(Circle[Element[list12, i] + (0.5, -0.5), 0.4], i, 1, r)
list21 = Sequence(Circle[Element[list12, i] + (0.5, -0.5), 0.4], i, r + 1, r + g)
list22 = Sequence(Circle[Element[list12, i] + (0.5, -0.5), 0.4], i, r + g + 1, r + g + b)
list14 = Sequence(Text[If[i ≤ r, "\textcolor{#ffff00}{" + (Element[list5, i]) + "}", If[i ≤ r + g, "\textcolor{#003300}{" + (Element[list5, i]) + "}", "\textcolor{#00ffff}{" + (Element[list5, i]) + "}"]], Element[list12, i] + (0.25, -0.2), true, true], i, 1, r + g + b)
text1 = Text("待取的球擺放區", A + (0, 0.6), true, true)
text3: "" + (LaTeX[r]) + "個紅球," + (LaTeX[g]) + "個綠球," + (LaTeX[b]) + "個藍球排成一列:
\cr" + (LaTeX[If[c ≟ 1, "★(有編號時視為相異物,利用完全相異物的排列)", "★(無編號時視為相同物,利用不盡相異物的排列)"]]) + "
\cr " + (LaTeX[If[k ≥ 0, "(1).先在總共" + (r + g + b) + "位置中,選" + r + "個位置(準備排入紅球)" + (If[k > 0, "將" + r + "個紅球排入⇒有\underline{\text{   }" + (If[d ≟ 1, If[c ≟ 1, "P^{" + (r + g + b) + "}_{" + r + "}", "C^{" + (r + g + b) + "}_{" + r + "}"], "?"]) + "\text{   }}種方法", ""]), ""]]) + "
\cr " + (LaTeX[If[k ≥ 1, "(2).在剩下" + (g + b) + "位置中,選" + g + "個位置(準備排入綠球)" + (If[k > 1, "將" + g + "個綠球排入⇒有\underline{\text{   }" + (If[d ≟ 1, If[c ≟ 1, "P^{" + (g + b) + "}_{" + g + "}", "C^{" + (g + b) + "}_{" + g + "}"], "?"]) + "\text{   }}種方法", ""]), ""]]) + "
\cr " + (LaTeX[If[k ≥ 2, "(3).在剩下" + b + "位置中,選" + b + "個位置(準備排入藍球)" + (If[k > 2, "將" + b + "個藍球排入⇒有\underline{\text{   }" + (If[d ≟ 1, If[c ≟ 1, "P^{" + b + "}_{" + b + "}", "C^{" + b + "}_{" + b + "}"], "?"]) + "\text{   }}種方法", ""]), ""]]) + "
\cr " + (LaTeX[If[k ≟ 3, "結論:共有\underline{\text{   }" + (If[d ≟ 1, If[c ≟ 1, "P^{" + (r + g + b) + "}_{" + r + "}·P^{" + (g + b) + "}_{" + g + "}·P^{" + b + "}_{" + b + "}=" + (r + g + b) + "!", "C^{" + (r + g + b) + "}_{" + r + "}·C^{" + (g + b) + "}_{" + g + "}·C^{" + b + "}_{" + b + "}=\frac{" + (r + g + b) + "!}{" + r + "!·" + g + "!·" + b + "!·}"], "?"]) + "\text{   }}種方法", ""]]) + ""
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]})