Date: 7 6 月 2014

random_1

顯示:編號

Start

Reset

B = (-0.6589829271701004, -1.7526970869906435)
r = 7 (slider from 1 to 10, step 1)
g = 3 (slider from 1 to 10, step 1)
a = 0.71 (slider from 0 to 1, step 0.01)
A = (3.9001568544769976, 1.9426056833970082)
k = 0 (slider from 0 to 2, step 0.01)
c = true
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])
list1: {Polygon[A, A + (Max[{r, g}], 0), A + (Max[{r, g}], -2), A + (0, -2)]}
list4 = Join({list2, list3})
list5 = Shuffle(a * 0 + Sequence[i, i, 1, r + g])
list6 = Join({Sequence[A + (Element[list2, i] - 1, 0), i, 1, r], Sequence[A + (Element[list3, i] - 1, -1), i, 1, g]})
list7 = Sequence(B + (i - 1, 0), i, 1, r + g)
list8 = Sequence(If[i ≤ r, If[k < 1, Element[list6, i] + k * (Element[list7, Element[list5, i]] - Element[list6, i]), Element[list7, Element[list5, i]]], If[k ≤ 1, Element[list6, i], If[k ≥ 2, Element[list7, Element[list5, i]], Element[list6, i] + (k - 1) * (Element[list7, Element[list5, i]] - Element[list6, i])]]], i, 1, r + g)
list11 = Sequence(Polygon[B + (Element[list5, i], 0), B + (Element[list5, i] - 1, 0), 4], i, 1, r)
list12 = Sequence(Circle[Element[list8, i] + (0.5, -0.5), 0.4], i, 1, r)
list13 = Sequence(Circle[Element[list8, i] + (0.5, -0.5), 0.4], i, r + 1, r + g)
list10 = Sequence(Text[If[i ≤ r, "\textcolor{yellow}{" + (Element[list4, i]) + "}", "\textcolor{003300}{" + (Element[list4, i]) + "}"], Element[list8, i] + (0.25, -0.2), true, true], i, 1, r + g)
list0 = Join({Sequence[Segment[B + (i, 0), B + (i, -1)], i, 0, r + g], Sequence[Segment[B + (0, -i), B + (r + g, -i)], i, 0, 1], Sequence[Text["" + (i), B + (i - 1, 0.5), true, true], i, 1, r + g], Sequence[Segment[A + (i, 0), A + (i, -2)], i, 0, Max[{r, g}]], Sequence[Segment[A + (0, i), A + (Max[{r, g}], i)], i, 0, -2, -1]})
text1 = Text("待取的球擺放區", A + (0, 0.6), true, true)
text3: "" + (LaTeX[r]) + "個紅球," + (LaTeX[g]) + "個綠球,排成一列:
\cr" + (LaTeX[If[c ≟ 1, "★(有編號時視為相異物)", "★(無編號時視為相同物)"]]) + "
\cr" + (LaTeX[If[c ≟ 1, "★(利用完全相異物的排列)", "★(利用不盡相異物的排列)"]]) + "
\cr " + (LaTeX[If[k ≥ 0, "(1).先在總共" + (r + g) + "位置中,選" + r + "個位置(準備排入紅球)" + (If[k > 0, ",將" + r + "個紅球排入\cr \text{     }⇒有\underline{\text{  }\textcolor{blue}{" + (If[c ≟ 1, "P^{" + (r + g) + "}_{" + r + "}", "C^{" + (r + g) + "}_{" + r + "}"]) + "}\text{  }}種方法", ""]), ""]]) + "
\cr " + (LaTeX[If[k ≥ 1, "(2).在剩下" + g + "位置中,選" + g + "個位置(準備排入綠球)" + (If[k > 1, ",將" + g + "個綠球排入\cr \text{     }⇒有\underline{\text{  }\textcolor{blue}{" + (If[c ≟ 1, "P^{" + g + "}_{" + g + "}", "C^{" + g + "}_{" + g + "}"]) + "}\text{  }}種方法", ""]), ""]]) + "
\cr " + (LaTeX[If[k ≟ 2, "結論:共有\underline{\text{  }\textcolor{blue}{" + (If[c ≟ 1, "P^{" + (r + g) + "}_{" + r + "}·P^{" + g + "}_{" + g + "}=" + (r + g) + "!", "C^{" + (r + g) + "}_{" + r + "}·C^{" + g + "}_{" + g + "}=\frac{" + (r + g) + "!}{" + r + "!·" + g + "!}"]) + "}\text{  }}種方法", ""]]) + " "