$重新選取$

$n=%v$

$k=%v$

$ 不定方程式的正整數解 $

$Step=%v$

$ Alan $

$ Bob $

$ Cara $

$ Dora $

$ Eden $

$ Fay $

$ Gary $

$ Hedy $

$ Ian $

$ Jane $

t_1 = 0.6 (slider from 0 to 1, step 0.1)
n = 15 (slider from k to 15, step 1)
lista = Sequence(j + t_1 * 0, j, 2, n)
listb = Shuffle(lista)
k = 10 (slider from 3 to 10, step 1)
A = (-1, 4)
B: A + (15, 0)
r = Distance(A, B)
list1 = Sequence((x(A) + i, y(A)), i, 0, n - 1)
C: A - (0, 3.5)
D: B - (0, 5)
list3 = Sequence((x(A) + (i - 1) * r / 13.5, y(A) - 2.8), i, 1, k + 1)
list2 = Sequence(Circle[Element[list1, i], r / (4 * n - 3)], i, 1, n)
s = 0 (slider from 0 to 4, step 1)
p = Distance(Element[list3, 2], Element[list3, 1])
poly1, a_0, b_0, c_0, d_0 = Polygon(A, Element[list1, k + 1], Element[list1, k + 1] + (0, p), A + (0, p))
E: C - (0, p)
list4 = Sequence((x(A) + (i - 1) * r / 13.5, y(E)), i, 1, k + 1)
list5 = Sequence(Segment[(x(A) + (i - 1) * r / 13.5, y(A)), (x(A) + (i - 1) * r / 13.5, y(A) + 1.1)], i, 1, n + 1)
list6 = Shuffle(list5)
listc = First(listb, k - 1)
d = Distance(Element[list1, 2], Element[list1, 1])
listd = Sequence(Segment[A + (d * Element[listc, j] - d, 0), A + (d * Element[listc, j] - d, 1.1)], j, 1, k - 1)
text12: "$ \frac{" + (LaTeX[n + k - 1]) + "\;!}{" + (LaTeX[n]) + "\;!\;" + (LaTeX[k - 1]) + "\;!} $"
liste = Sort(listc)
listf = Join({{Element[liste, 1] - 1}, Sequence[Element[liste, j + 1] - Element[liste, j], j, 1, k - 2], {n + 1 - Element[liste, k - 1]}})
T1: "$ " + (LaTeX[Element[listf, 1]]) + " $"
T2: "$ " + (LaTeX[Element[listf, 2]]) + " $"
T3: "$ " + (LaTeX[Element[listf, 3]]) + " $"
T4: "$ " + (LaTeX[Element[listf, 4]]) + " $"
T5: "$ " + (LaTeX[Element[listf, 5]]) + " $"
T6: "$ " + (LaTeX[Element[listf, 6]]) + " $"
T7: "$ " + (LaTeX[Element[listf, 7]]) + " $"
T8: "$ " + (LaTeX[Element[listf, 8]]) + " $"
T9: "$ " + (LaTeX[Element[listf, 9]]) + " $"
T10: "$ " + (LaTeX[Element[listf, 10]]) + " $"
t_q: "$試求方程式：\; " + (LaTeX["x_1+x_2" + (If[k ≟ 3, "+x_3", If[k ≟ 4, "+x_3+x_4", If[k ≟ 5, "+x_3+x_4+x_5", If[k ≟ 6, "+x_3+x_4+x_5+x_6", If[k ≟ 7, "+x_3+x_4+x_5+x_6+x_7", If[k ≟ 8, "+x_3+x_4+x_5+x_6+x_7+x_8", If[k ≟ 9, "+x_3+x_4+x_5+x_6+x_7+x_8+x_9", If[k ≟ 10, "+x_3+x_4+x_5+x_6+x_7+x_8+x_9+x_{10}"]]]]]]]])]) + " =" + (LaTeX[n]) + "\;的正整數解$"
text1: "$ 我們考慮將" + (LaTeX[n]) + "個相同的球，\;分給" + (LaTeX[k]) + "個人，\;每人至少一球 $"
text11: "$ 我們把" + (LaTeX[k - 1]) + "個加號當做隔板，\;隔在" + (LaTeX[n - k]) + "個球的中間 $
$也就是考慮" + (LaTeX[n - k]) + "個相同的球與" + (LaTeX[k - 1]) + "個隔版的直線排列數$"
t = 0 (slider from 0 to k, step 0.001)
F_0: Element[list1, n] + t * Vector[Element[list1, n], Element[list3, k] - (0, 1)]
F_1: Element[list1, n - 1] + (t - 1) * Vector[Element[list1, n - 1], Element[list3, k - 1] - (0, 1)]
F_2: Element[list1, n - 2] + (t - 2) * Vector[Element[list1, n - 2], Element[list3, k - 2] - (0, 1)]
F_3: Element[list1, n - 3] + (t - 3) * Vector[Element[list1, n - 3], Element[list3, k - 3] - (0, 1)]
F_4: Element[list1, n - 4] + (t - 4) * Vector[Element[list1, n - 4], Element[list3, k - 4] - (0, 1)]
F_5: Element[list1, n - 5] + (t - 5) * Vector[Element[list1, n - 5], Element[list3, k - 5] - (0, 1)]
F_6: Element[list1, n - 6] + (t - 6) * Vector[Element[list1, n - 6], Element[list3, k - 6] - (0, 1)]
F_7: Element[list1, n - 7] + (t - 7) * Vector[Element[list1, n - 7], Element[list3, k - 7] - (0, 1)]
F_8: Element[list1, n - 8] + (t - 8) * Vector[Element[list1, n - 8], Element[list3, k - 8] - (0, 1)]
F_9: Element[list1, n - 9] + (t - 9) * Vector[Element[list1, n - 9], Element[list3, k - 9] - (0, 1)]
text2: "$ 我們將\;" + (LaTeX[n]) + "\;個相同的球，\;分給\;" + (LaTeX[k]) + "\;個人，\;每人至少得\;1\;個$"
text2_1: "$ H^{" + (LaTeX[k]) + "}_{" + (LaTeX[n - k]) + "} =C^{" + (LaTeX[k]) + "+" + (LaTeX[n - k]) + "-1}_{" + (LaTeX[n - k]) + "}=C^{" + (LaTeX[n - 1]) + "}_{" + (LaTeX[n - k]) + "}" + (LaTeX[If[n - k < k - 1, "", "=C^" + ("{" * (n - 1) * "}") + "_" + (n - k)]]) + "=" + (LaTeX[Binomial[n - 1, n - k]]) + "=\frac{" + (LaTeX[n - 1]) + "!}{" + (LaTeX[n - k]) + "\;!\;" + (LaTeX[k - 1]) + "\;!}$"