|
这个问题叫做有重复元素的环排列问题。中外历史上应该有多人研究过。国内近期已知的研究者是常新德,他是一位中专学校的老师。
对于本问题,用常新德老师给出的公式计算如下:
- Clear["Global`*"]; (*常新德公式*)
- s = 0;
- m = 3; n[3] = 0;
- Do[
- n[1] = k; n[2] = 6 - k; (* m 种颜色,n[i]是各色珠子个数 *)
- q = 0; Do[If[OddQ[n[i]], q = q + 1], {i, 1, m}]; (* n[i] 中的奇数个数 *)
- Subscript[S, n] = \!\(
- \*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(m\)]\(n[i]\)\); (*
- 共有 Subscript[S, n] 颗珠子 *)
- If[q < 3, M = (\!\(
- \*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(m\)]\(\[LeftFloor]
- \*FractionBox[\(n[i]\), \(2\)]\[RightFloor]\)\))!/\!\(
- \*UnderoverscriptBox[\(\[Product]\), \(i = 1\), \(m\)]\(\[LeftFloor]
- \*FractionBox[\(n[i]\), \(2\)]\[RightFloor]!\)\), M = 0];(*圆排列中的对称排列数*)
- Q = (Sum[EulerPhi[d] *(Subscript[S, n]/d)!/\!\(
- \*UnderoverscriptBox[\(\[Product]\), \(i = 1\), \(m\)]\(\((
- \*FractionBox[\(n[i]\), \(d\)])\)!\)\), {d,
- Divisors[GCD[n[1], n[2], n[3]]]}])/Subscript[S, n];
- \[CapitalPhi] = (Q + M)/2; s = s + \[CapitalPhi];
- , {k, 1, 5}];
- s
复制代码
程序运行结果为 s=11。这即是前面陆教授得出的只用两种颜色的组合数。只用一种颜色时显然是 3 种。因此总组合数是 3+11×3=36 种。 |
|