Date: 2 3 月 2013

$n=%v$

$k=%v$

$ 重複組合 $

$ 拉動滑竿決定n\;,k \;值$

t = 0 (slider from 0 to 5, step 0.0010)
n = 4 (slider from 2 to 5, step 1)
k = 6 (slider from n to 7, step 1)
A = (0.1672727272727281, 0.014545454545454752)
C: A + (0, 2.3)
list2 = Sequence(C + 2.3 * (j - 1, 0), j, 1, n)
B: A - (0, 2.8)
list5 = Sequence(B + (j, 0), j, 0, k - 1)
s = 0 (slider from 0 to 5, step 1)
list1 = Sequence(A + (j - 1, 0), j, 1, k + n - 1)
list4 = Sequence(B + (j, 1), j, 0, n - 2)
listb = Sequence(Translate[pica, (j - 1, 0)], j, 1, n - 1)
lista = Sequence(Translate[picb, (j - 1, 0)], j, 1, If[s ≟ 1, k, k - n])
D_1: Element[list5, k] + t * Vector[Element[list5, k], Element[list2, 1] + (0.5, -1.1)]
D_2: Element[list5, k - 1] + (t - 1) * Vector[Element[list5, k - 1], Element[list2, 2] + (0.75, -1.1)]
D_4: Element[list5, k - 3] + (t - 3) * Vector[Element[list5, k - 3], Element[list2, 4] + (0.75, -1.1)]
D_3: Element[list5, k - 2] + (t - 2) * Vector[Element[list5, k - 2], Element[list2, 3] + (0.75, -1.1)]
D_5: Element[list5, k - 4] + (t - 4) * Vector[Element[list5, k - 4], Element[list2, 5] + (0.75, -1.1)]
poly1, a_2, b_2, c_2, d_2 = Polygon(Element[list1, 1], Element[list1, 1] + (1, 0), Element[list1, 1] + (1, 1), Element[list1, 1] + (0, 1))
poly2, e_2, f_2, g, h = Polygon(Element[list1, 2], Element[list1, 2] + (1, 0), Element[list1, 2] + (1, 1), Element[list1, 2] + (0, 1))
poly3, i, j, l, m = Polygon(Element[list1, 3], Element[list1, 3] + (1, 0), Element[list1, 3] + (1, 1), Element[list1, 3] + (0, 1))
poly4, p_0, q, r, t_1 = Polygon(Element[list1, 4], Element[list1, 4] + (1, 0), Element[list1, 4] + (1, 1), Element[list1, 4] + (0, 1))
poly5, a_1, b_1, c_1, d_1 = Polygon(Element[list1, 5], Element[list1, 5] + (1, 0), Element[list1, 5] + (1, 1), Element[list1, 5] + (0, 1))
poly6, e_1, f_1, g_1, h_1 = Polygon(Element[list1, 6], Element[list1, 6] + (1, 0), Element[list1, 6] + (1, 1), Element[list1, 6] + (0, 1))
list3 = Sequence(Polygon[A + (j, 0), A + (j, 1), A + (j + 1, 1), A + (j + 1, 0)], j, 0, k - 2)
text2: "$ " + (LaTeX[n]) + "個人先各分一個球，\;$
$還剩\;" + (LaTeX[k - n]) + "\;個球 $"
a = false
b = false
c = false
d = false
e = false
f = false
aa = false
bb = false
cc = false
dd = false
ee = false
ff = false
polya, i_1, j_1, k_1, l_1 = Polygon(Element[list1, 1], Element[list1, 1] + (1, 0), Element[list1, 1] + (1, 1), Element[list1, 1] + (0, 1))
polyb, m_1, n_1, p_1, q_1 = Polygon(Element[list1, 2], Element[list1, 2] + (1, 0), Element[list1, 2] + (1, 1), Element[list1, 2] + (0, 1))
polyc, r_1, s_1, g_2, h_2 = Polygon(Element[list1, 3], Element[list1, 3] + (1, 0), Element[list1, 3] + (1, 1), Element[list1, 3] + (0, 1))
polyd, i_2, j_2, k_2, l_2 = Polygon(Element[list1, 4], Element[list1, 4] + (1, 0), Element[list1, 4] + (1, 1), Element[list1, 4] + (0, 1))
polye, m_2, n_2, p_2, q_2 = Polygon(Element[list1, 5], Element[list1, 5] + (1, 0), Element[list1, 5] + (1, 1), Element[list1, 5] + (0, 1))
polyf, r_2, s_2, t_2, a_3 = Polygon(Element[list1, 6], Element[list1, 6] + (1, 0), Element[list1, 6] + (1, 1), Element[list1, 6] + (0, 1))
square1, b_3, c_3, d_3, e_3 = Polygon(Element[list4, n - 1], Element[list4, n - 1] + (1, 0), Element[list4, n - 1] + (1, 1), Element[list4, n - 1] + (0, 1))
square2, f_3, g_3, h_3, i_3 = Polygon(Element[list4, n - 2], Element[list4, n - 2] + (1, 0), Element[list4, n - 2] + (1, 1), Element[list4, n - 2] + (0, 1))
square3, j_3, k_3, l_3, m_3 = Polygon(Element[list4, n - 3], Element[list4, n - 3] + (1, 0), Element[list4, n - 3] + (1, 1), Element[list4, n - 3] + (0, 1))
square4, n_3, p_3, q_3, r_3 = Polygon(Element[list4, n - 4], Element[list4, n - 4] + (1, 0), Element[list4, n - 4] + (1, 1), Element[list4, n - 4] + (0, 1))
text3: "$ 選擇\; " + (LaTeX[n - 1]) + "\;個隔板位置$"
p = Sum({If[aa ≟ true, 1, 0], If[bb ≟ true, 1, 0], If[cc ≟ true, 1, 0], If[dd ≟ true, 1, 0], If[ee ≟ true, 1, 0], If[ff ≟ true, 1, 0]})
pp = Sum({If[a ≟ true, 1, 0], If[b ≟ true, 1, 0], If[c ≟ true, 1, 0], If[d ≟ true, 1, 0], If[e ≟ true, 1, 0], If[f ≟ true, 1, 0]})
text4: "$ 將球放到剩下的\;" + (LaTeX[k - n]) + " \;個位置$"
squarea, s_3, t_3, a_4, b_4 = Polygon(Element[list5, k - n], Element[list5, k - n] + (1, 0), Element[list5, k - n] + (1, 1), Element[list5, k - n] + (0, 1))
squareb, c_4, d_4, e_4, f_4 = Polygon(Element[list5, k - n - 1], Element[list5, k - n - 1] + (1, 0), Element[list5, k - n - 1] + (1, 1), Element[list5, k - n - 1] + (0, 1))
squarec, g_4, h_4, i_4, j_4 = Polygon(Element[list5, k - n - 2], Element[list5, k - n - 2] + (1, 0), Element[list5, k - n - 2] + (1, 1), Element[list5, k - n - 2] + (0, 1))
squared, k_4, l_4, m_4, n_4 = Polygon(Element[list5, k - n - 3], Element[list5, k - n - 3] + (1, 0), Element[list5, k - n - 3] + (1, 1), Element[list5, k - n - 3] + (0, 1))
squaree, p_4, q_4, r_4, s_4 = Polygon(Element[list5, k - n - 4], Element[list5, k - n - 4] + (1, 0), Element[list5, k - n - 4] + (1, 1), Element[list5, k - n - 4] + (0, 1))
text5: "$ 我們將所求視為 \;" + (LaTeX[k - n]) + "個球與$
$" + (LaTeX[n - 1]) + " \;個隔板的直線排列數$
$即\;\frac{( " + (LaTeX[k - n]) + "+ " + (LaTeX[n]) + "-1)!}{" + (LaTeX[k - n]) + " !\cdot( " + (LaTeX[n]) + "-1)!}=\frac{" + (LaTeX[k - 1]) + " !}{ " + (LaTeX[k - n]) + "!\cdot" + (LaTeX[n - 1]) + " !}$
$=C^{ " + (LaTeX[k - n]) + "+" + (LaTeX[n]) + " -1}_ " + (LaTeX[k - n]) + "=C^{" + (LaTeX[k - 1]) + " }_ " + (LaTeX[k - n]) + "=H^ " + (LaTeX[n]) + "_ " + (LaTeX[k - n]) + "$"
Question: "$將" + (LaTeX[k]) + "個相同的球分給" + (LaTeX[n]) + "個$
$人，\;每人至少一個，\;求$
$方法數.$
$試求方程式$
$x+y" + (LaTeX[If[n ≥ 3, "+z"]]) + "" + (LaTeX[If[n ≥ 4, "+u"]]) + "" + (LaTeX[If[n ≥ 5, "+w"]]) + "=" + (LaTeX[k]) + "$
$的正整數解$"