Forward

重複組合概念(1)

A = (-2.128604138684624, 5.077120570135401)
B: A - ((-4), 7.5)
n = 5 (slider from 1 to 7, step 1)
list2 = Sequence(B + ((4 * k) - 2, 0), k, 0, n)
s = 0 (slider from 0 to 25, step 1)
G = Point(list2)
H = (38.971371800442, -3.9911958986153278)
list1 = Sequence(Translate[pic1, Vector[B, B + ((4 * k), 0)]], k, 0, n - 1)
text3: "1\;\;\;\;\;\;\;\;\;\;\;\;2" + (LaTeX[If[n ≥ 2, "\;\;\;\;\;\;\;\;\;\;\;\;\;3"]]) + "" + (LaTeX[If[n ≥ 3, "\;\;\;\;\;\;\;\;\;\;\;\;\;4"]]) + "" + (LaTeX[If[n ≥ 4, "\;\;\;\;\;\;\;\;\;\;\;\;\;5"]]) + "" + (LaTeX[If[n ≥ 5, "\;\;\;\;\;\;\;\;\;\;\;\;\;6"]]) + "" + (LaTeX[If[n ≥ 6, "\;\;\;\;\;\;\;\;\;\;\;\;\;7"]]) + "" + (LaTeX[If[n ≥ 7, "\;\;\;\;\;\;\;\;\;\;\;\;\;8"]]) + "" + (LaTeX[If[n ≥ 8, "\;\;\;\;\;\;\;\;\;\;\;\;\;9"]]) + ""
text1: "考慮不定方程式" + (LaTeX[If[s  <  13, "x+y=", "x+y+z="]]) + "" + (LaTeX[n]) + "\;的非負整數解"
C = Point(list2)
text16: " " + (LaTeX[n]) + "\;個球有\; " + (LaTeX[n + 1]) + "\;個空格\\
\fgcolor{yellow}{ " + (LaTeX[If[s ≥ 17, "取\;2\;個隔板將球分成3份"]]) + "}\\
\fgcolor{yellow}{" + (LaTeX[If[s ≥ 18, "故所求為" + n + "個球與2個隔板的排列數\frac{" + (n + 2) + "!}{" + n + "!×2!}=" + ((n + 2)! / ((n! * 2)))]]) + " }"
text2: "上述方程式的解(x,y)為" + (LaTeX[If[n ≟ 1, "(1,0),(0,1)"]]) + "" + (LaTeX[If[n ≟ 2, "(2,0),(1,1),(0,2)"]]) + "" + (LaTeX[If[n ≟ 3, "(3,0),(2,1),(1,2),(0,3)"]]) + "" + (LaTeX[If[n ≟ 4, "\\(4,0),(3,1),(2,2),(1,3),(0,4)"]]) + "" + (LaTeX[If[n ≟ 5, "\\(5,0),(4,1),(3,2),(2,3),(1,4),(0,5)"]]) + "" + (LaTeX[If[n ≟ 6, "\\(6,0),(5,1),(4,2),(3,3),(2,4),(1,5),(0,6)"]]) + "" + (LaTeX[If[n ≟ 7, "\\(7,0),(6,1),(5,2),(4,3),(3,4),(2,5),(1,6),(0,7)"]]) + "" + (LaTeX[If[n ≟ 8, "\\(8,0),(7,1),(6,2),(5,3),(4,4),(3,5),(2,6),(1,7),(0,8)"]]) + "\\" + (LaTeX[If[s ≥ 3, "上述方程式有" + (n + 1) + "組解"]]) + "\\" + (LaTeX[If[s ≥ 4, "試問方程式x+y=100有幾組非負整數解?"]]) + "\\" + (LaTeX[If[s ≥ 5, "(100,0),(99,1),...,(0,100)\;有101組解"]]) + "\\" + (LaTeX[If[s ≥ 6, "若n為正整數，則方程式x+y=n有幾組非負整數解?"]]) + "\\" + (LaTeX[If[s ≥ 7, "(n,0),(n-1,1),...,(0,n)\;有n+1組解"]]) + ""
text8: "考慮" + (LaTeX[n]) + "個相同的球，分給\;x,y\;兩人，每人可兼得或不得"
text10: "" + (LaTeX[n]) + "\;個球有\;" + (LaTeX[n + 1]) + "\;個空格\\
\fgcolor{yellow}{" + (LaTeX[If[s ≥ 11, "考慮放1個隔板在空格中，隔板前的球給x，後的球給y"]]) + "}\\
\fgcolor{yellow}{" + (LaTeX[If[s ≥ 12, "故所求為" + n + "個相同的球與1個隔板的排列數\frac{" + (n + 1) + "!}{" + n + "!}=" + (n + 1)]]) + "}"
text14: "考慮\;" + (LaTeX[n]) + "\;個相同的球，\;分給\;x,y,z\;三人，\;每人可兼得或\\不得"
text19: "求不定方程式\;x_1+x_2+...+x_k=n\;的非負整數解\\" + (LaTeX[If[s ≥ 20, "將\;n\;個相同的球，\;分給\;k\;個人，\;每人可兼得或不得的\\方法數"]]) + "\\" + (LaTeX[If[s ≥ 21, "拿\;k-1\;個隔板分開\;n\;個球"]]) + "\\" + (LaTeX[If[s ≥ 22, "所求即n個相同球與k-1個隔板的排列數"]]) + "\\" + (LaTeX[If[s ≥ 23, "\frac{(n+k-1)!}{n!×(k-1)!}"]]) + "" + (LaTeX[If[s ≥ 24, "\;也可以說C^{n+k-1}_{n}或C^{n+k-1}_{k-1}"]]) + "" + (LaTeX[If[s ≥ 25, "\;\;即\;：\;H^k_n"]]) + ""