$k=%v$

$n=%v$

$Step=%v$

$ 重複組合 $

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

k = 4 (slider from 1 to 7, step 1)
n = 4 (slider from 2 to 5, step 1)
s = 0 (slider from 0 to 4, step 1)
A = (0.14644628099173684, 1.1766942148760324)
B: A - (0, 3.2)
list1 = Sequence(A + (j - 1, 0), j, 1, k + n - 1)
C: A + (0, 1.2)
list2 = Sequence(C + 2.3 * (j - 1, 0), j, 1, n)
poly1, a_0, b_0, c_0, d_0 = Polygon(Element[list1, 1], Element[list1, 1] + (1, 0), Element[list1, 1] + (1, 1), Element[list1, 1] + (0, 1))
poly2, e_0, f_0, g_0, h_0 = Polygon(Element[list1, 2], Element[list1, 2] + (1, 0), Element[list1, 2] + (1, 1), Element[list1, 2] + (0, 1))
poly3, i_0, j_0, l_0, m_0 = Polygon(Element[list1, 3], Element[list1, 3] + (1, 0), Element[list1, 3] + (1, 1), Element[list1, 3] + (0, 1))
poly4, p_0, q_0, r_0, t_0 = 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))
poly7, i_1, j_1, k_1, l_1 = Polygon(Element[list1, 7], Element[list1, 7] + (1, 0), Element[list1, 7] + (1, 1), Element[list1, 7] + (0, 1))
poly8, m_1, n_1, p_1, q_1 = Polygon(Element[list1, 8], Element[list1, 8] + (1, 0), Element[list1, 8] + (1, 1), Element[list1, 8] + (0, 1))
poly9, r_1, s_1, t_1, a_2 = Polygon(Element[list1, 9], Element[list1, 9] + (1, 0), Element[list1, 9] + (1, 1), Element[list1, 9] + (0, 1))
poly10, b_2, c_2, d_2, e_2 = Polygon(Element[list1, 10], Element[list1, 10] + (1, 0), Element[list1, 10] + (1, 1), Element[list1, 10] + (0, 1))
poly11, f_2, g_2, h_2, i_2 = Polygon(Element[list1, 11], Element[list1, 11] + (1, 0), Element[list1, 11] + (1, 1), Element[list1, 11] + (0, 1))
listb = Sequence(Translate[pica, (j - 1, 0)], j, 1, n - 1)
a = false
b = false
c = false
d = false
e = false
f = false
g = false
h = false
i = false
j = false
m = false
p: a + b + c + d + e + f + g + h + i + j + m
list3 = Sequence(Polygon[A + (j, 0), A + (j, 1), A + (j + 1, 1), A + (j + 1, 0)], j, 0, k + n - 2)
list4 = Sequence(B + (j, 1), j, 0, n - 2)
polya, q, r, t, j_2 = Polygon(Element[list4, n - 1], Element[list4, n - 1] + (1, 0), Element[list4, n - 1] + (1, 1), Element[list4, n - 1] + (0, 1))
polyb, k_2, l_2, m_2, n_2 = Polygon(Element[list4, n - 2], Element[list4, n - 2] + (1, 0), Element[list4, n - 2] + (1, 1), Element[list4, n - 2] + (0, 1))
polyc, p_2, q_2, r_2, s_2 = Polygon(Element[list4, n - 3], Element[list4, n - 3] + (1, 0), Element[list4, n - 3] + (1, 1), Element[list4, n - 3] + (0, 1))
polyd, t_2, a_3, b_3, c_3 = Polygon(Element[list4, n - 4], Element[list4, n - 4] + (1, 0), Element[list4, n - 4] + (1, 1), Element[list4, n - 4] + (0, 1))
square01, d_3, e_3, f_3, g_3 = Polygon(Element[list1, 1], Element[list1, 1] + (1, 0), Element[list1, 1] + (1, 1), Element[list1, 1] + (0, 1))
square02, h_3, i_3, j_3, k_3 = Polygon(Element[list1, 2], Element[list1, 2] + (1, 0), Element[list1, 2] + (1, 1), Element[list1, 2] + (0, 1))
square03, l_3, m_3, n_3, p_3 = Polygon(Element[list1, 3], Element[list1, 3] + (1, 0), Element[list1, 3] + (1, 1), Element[list1, 3] + (0, 1))
square04, q_3, r_3, s_3, t_3 = Polygon(Element[list1, 4], Element[list1, 4] + (1, 0), Element[list1, 4] + (1, 1), Element[list1, 4] + (0, 1))
square05, a_4, b_4, c_4, d_4 = Polygon(Element[list1, 5], Element[list1, 5] + (1, 0), Element[list1, 5] + (1, 1), Element[list1, 5] + (0, 1))
square06, e_4, f_4, g_4, h_4 = Polygon(Element[list1, 6], Element[list1, 6] + (1, 0), Element[list1, 6] + (1, 1), Element[list1, 6] + (0, 1))
square07, i_4, j_4, k_4, l_4 = Polygon(Element[list1, 7], Element[list1, 7] + (1, 0), Element[list1, 7] + (1, 1), Element[list1, 7] + (0, 1))
square08, m_4, n_4, p_4, q_4 = Polygon(Element[list1, 8], Element[list1, 8] + (1, 0), Element[list1, 8] + (1, 1), Element[list1, 8] + (0, 1))
square09, r_4, s_4, t_4, a_5 = Polygon(Element[list1, 9], Element[list1, 9] + (1, 0), Element[list1, 9] + (1, 1), Element[list1, 9] + (0, 1))
square10, b_5, c_5, d_5, e_5 = Polygon(Element[list1, 10], Element[list1, 10] + (1, 0), Element[list1, 10] + (1, 1), Element[list1, 10] + (0, 1))
square11, f_5, g_5, h_5, i_5 = Polygon(Element[list1, 11], Element[list1, 11] + (1, 0), Element[list1, 11] + (1, 1), Element[list1, 11] + (0, 1))
bb = false
cc = false
dd = false
ee = false
ff = false
gg = false
hh = false
ii = false
jj = false
mm = false
aa = false
list5 = Sequence(B + (j, 0), j, 0, k - 1)
Poly1, j_5, k_5, l_5, m_5 = Polygon(Element[list5, k], Element[list5, k] + (1, 0), Element[list5, k] + (1, 1), Element[list5, k] + (0, 1))
pp: bb + cc + dd + ee + ff + gg + hh + ii + jj + mm + aa
Poly2, n_5, p_5, q_5, r_5 = Polygon(Element[list5, k - 1], Element[list5, k - 1] + (1, 0), Element[list5, k - 1] + (1, 1), Element[list5, k - 1] + (0, 1))
Poly3, s_5, t_5, a_6, b_6 = Polygon(Element[list5, k - 2], Element[list5, k - 2] + (1, 0), Element[list5, k - 2] + (1, 1), Element[list5, k - 2] + (0, 1))
Poly4, c_6, d_6, e_6, f_6 = Polygon(Element[list5, k - 3], Element[list5, k - 3] + (1, 0), Element[list5, k - 3] + (1, 1), Element[list5, k - 3] + (0, 1))
Poly5, g_6, h_6, i_6, j_6 = Polygon(Element[list5, k - 4], Element[list5, k - 4] + (1, 0), Element[list5, k - 4] + (1, 1), Element[list5, k - 4] + (0, 1))
Poly6, k_6, l_6, m_6, n_6 = Polygon(Element[list5, k - 5], Element[list5, k - 5] + (1, 0), Element[list5, k - 5] + (1, 1), Element[list5, k - 5] + (0, 1))
Poly7, p_6, q_6, r_6, s_6 = Polygon(Element[list5, k - 6], Element[list5, k - 6] + (1, 0), Element[list5, k - 6] + (1, 1), Element[list5, k - 6] + (0, 1))
lista = Sequence(Translate[pic0, (j - 1, 0)], j, 1, k)
text2: "$ 選擇\;" + (LaTeX[n - 1]) + "\;個隔板位置$"
text3: "$ 將球放到剩下的\;" + (LaTeX[k]) + "\;個位置$"
text4: "$ 我們將所求視為" + (LaTeX[k]) + "\;個球與$
$" + (LaTeX[n - 1]) + "\;個隔板的直線排列數$
$即\;\frac{(" + (LaTeX[k]) + "+" + (LaTeX[n]) + "-1)!}{" + (LaTeX[k]) + "!\cdot(" + (LaTeX[n]) + "-1)!}=\frac{" + (LaTeX[k + n - 1]) + "!}{" + (LaTeX[k]) + "!\cdot" + (LaTeX[n - 1]) + "!}$
$=C^{" + (LaTeX[k]) + "+" + (LaTeX[n]) + "-1}_" + (LaTeX[k]) + "=C^{" + (LaTeX[k + n - 1]) + "}_" + (LaTeX[k]) + "=H^" + (LaTeX[n]) + "_" + (LaTeX[k]) + "$"
z = true
u_1 = true
v_1 = true
w_1 = true
z_1 = true
o_2 = true
Question: "$ 將\;" + (LaTeX[k]) + "\;個相同的球分給\;" + (LaTeX[n]) + "\;個$
$人，\;求方法數$
$試求方程式$
$x+y" + (LaTeX[If[n ≥ 3, "+z"]]) + "" + (LaTeX[If[n ≥ 4, "+u"]]) + "" + (LaTeX[If[n ≥ 5, "+w"]]) + "＝" + (LaTeX[k]) + "$
$的非負整數解$"