Files
2025-12-26 17:35:14 +08:00

15 lines
679 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 有序排列
我没想到的是,排列也有很多事情是我没想到的,比如 [欧拉数 Eulerian Number](https://en.wikipedia.org/wiki/Eulerian_number)。
在 [OEIS A008292](https://oeis.org/A008292) 还有更多讨论。
本来以为使用python自带的排列方法就是最快的了。但没想到欧拉数的有序计算逻辑似乎更好用
对于 $n$ 个元素的排列:
- 总共有 $n!$ 种排列
- 以某个特定元素开头的排列有 $(n1)!$ 种
- 这构成了变进制的基础,可以用来计算第 $k$ 个排列。
相比在序列上移动要快速多了,毕竟是与原序列的长度相关,而不与位置相关。