Suppose there are n people smoking and the dislocation type is an.
When n=2, there is obviously only one, A takes B, B takes A, a2= 1.
When n=3, A takes B, B takes C, and C takes A; A takes C, C takes B, B takes A, a3=2.
Then recursion is needed.
Suppose there is ak dislocation when n = k.
Then when n=k+ 1
The name of k+ 1 was added.
Definitely not k+ 1
There must be someone I (I'm not k+ 1) who took k+ 1.
Then it is divided into two situations:
(1)k+ 1 person takes I, so it becomes the case that k+ 1-2=k- 1 person is staggered.
There is just one (k- 1), but I can take 1, 2, ..., k.
Therefore, there is a k*a(k- 1) dislocation method in this case.
(2) People with K+ 1 don't take I, and the rest can be misplaced at will, because it is equivalent to K personal dislocation, so I will be replaced by k+1.
So there are ak species, and the same I can be taken as 1, 2, ..., k.
So the total * * * is k*ak species.
So as to obtain a recurrence formula.
a(k+ 1)= k * a(k- 1)+k * AK
When k = 3 and n = 4 are verified.
A takes b, b takes a, c takes d, and d takes C.
A gets c, c gets a, b gets d, and d gets B.
A takes D, D takes A, C takes B, and B takes C.
A takes b, b takes c, c takes d, and d takes a.
A takes b, b takes d, d takes c, and c takes a.
A gets c, c gets b, b gets d, and d gets a.
A takes c, c takes d, d takes b, and b takes a.
A takes d, d takes b, b takes c, and c takes a.
A takes d, d takes c, c takes b, and b takes a.
a4=9
And 3 * a1+3 * a2 = 3 *1+3 * 2 = 9.
So the recursive formula holds.
So stick to it and you'll get it.
a5=4*(a3+a4)=4*(9+2)=44
a6=5*(a4+a5)=5*(9+44)=265
a7 = 6 *(a5+a6)= 6 *(44+265)= 1854
A8 = 7 *(a6+a7)= 7 *(265+ 1854)= 14833
a9 = 8 *( 1854+ 14833)= 133496
a 10 = 9 *( 14833+ 133496)= 133496 1
The possible arrangement of total * * * is10 * 9 * 8 * ... *1= 3628800.
So the answer to the first question is
133496 1/3628800=465/ 1264
The second question is
1-465/ 1264=799/ 1264