Date: 10 3 月 2013

$Step=%v$

$n=%v$

$ 直線排列不相鄰問題 $

1

2

3

4

5

a

b

c

d

e

s = 0 (slider from 0 to 5, step 1)
n = 6 (slider from 3 to 6, step 1)
listc = Shuffle(Sequence[j, j, 1, n - 2])
listd = First(listc, n - 2)
A = (-0.3, 0.58)
d_1 = 2 (slider from 2 to 3.9, step 0.001)
lista = Shuffle(Sequence[j, j, 1, n])
listb = Sequence(A + (d_1 * Element[lista, j] - d_1, 0), j, 1, n)
t1 = 0 (slider from 0 to 1, step 0.001)
C: A + (2, -4.4)
D: A + (4, -4.4)
liste = Sequence(A + (d_1 * Element[listd, j] - d_1, 0), j, 1, n)
t0 = 4.9 (slider from -5 to 5, step 0.1)
text1: "$ 先考慮\;" + (LaTeX[n - 2]) + "\;個女生排成一列，\;有" + (LaTeX[n - 2]) + "\;!=\;" + (LaTeX[(n - 2)!]) + "\;種方法. $"
text3: "$ " + (LaTeX[n - 2]) + " \;個女生有\;" + (LaTeX[n - 1]) + "\;個間隔$"
a = false
b = false
c = false
d = false
e = false
list1 = Sequence(A + (-1.8 + 4 * j, 0), j, 0, n - 2)
t2 = 0 (slider from 0 to 1, step 0.001)
C_1: C + t1 * Vector[C, Element[list1, 1]]
C_2: C + t1 * Vector[C, Element[list1, 2]]
C_3: C + t1 * Vector[C, Element[list1, 3]]
C_4: C + t1 * Vector[C, Element[list1, 4]]
C_5: C + t1 * Vector[C, Element[list1, 5]]
D_1: D + t2 * Vector[D, Element[list1, 1]]
D_2: D + t2 * Vector[D, Element[list1, 2]]
D_3: D + t2 * Vector[D, Element[list1, 3]]
D_4: D + t2 * Vector[D, Element[list1, 4]]
D_5: D + t2 * Vector[D, Element[list1, 5]]
text4: "$ 第\;2\;位男生有" + (LaTeX[n - 2]) + "個選擇 $"
text2: "$ 第\;1\;個男生有" + (LaTeX[n - 1]) + "個選擇 $"
a1 = false
b1 = false
c1 = false
d1 = false
e1 = false
text5: "$ 故所求為\;" + (LaTeX[n - 2]) + " !×" + (LaTeX[n - 1]) + "×" + (LaTeX[n - 2]) + "=" + (LaTeX[n - 2]) + "!×P^" + (LaTeX[n - 1]) + "_2$"
text0: "$ " + (LaTeX[n - 2]) + " \;位女生與\;2\;個男生排成一列，\;若男生不相鄰，\;求方法數.$"