主題
Search

排列遊程


在一個排列中,一組升序序列被稱為一個遊程(Graham et al. 1994)或有時稱為上升(Comtet 1974, p. 241)。一個已排序的排列由單個遊程組成,而一個逆序排列由 n 個遊程組成,每個遊程的長度為 1。排列 p 中的排列遊程可以使用以下方法計算遊程[p] 在 Wolfram Language 包中Combinatorica`。具有 k 個遊程的 {1,2,...,n} 的劃分的排列遊程數有時表示為 a(n,k) (Comtet 1974, p. 241)。

例如,排列 {1,2} 包含單個遊程 {1,2},而 {2,1} 包含兩個遊程 {2}{1}。下表列出了 {1,2,3} 的每個排列 p 的排列遊程。

p排列遊程
{1,2,3}{1,2,3}
{1,3,2}{1,3}, {2}
{2,1,3}{2}, {1,3}
{2,3,1}{2,3}, {1}
{3,1,2}{3}, {1,2}
{3,2,1}{3}, {2}, {1}

長度為 n 且正好有 k 個遊程的排列數 a(n,k)排列上升的數目直接相關,其中 k 個遊程意味著 k-1 個上升 (Comtet 1974, p. 241; Skiena 1990, p. 31),因此

 a(n,k)=<n; k-1>,

其中 <n; k-1> 是一個 尤拉數

令人驚訝的是,第一個遊程的預期長度比第二個遊程的預期長度短 (Gassner 1967; Skiena 1990, p. 30; Knuth 1998)。


參見

尤拉數, 排列, 排列上升, 遊程

透過 探索

參考文獻

Comtet, L. "Permutations by Number of Rises; Eulerian Numbers." §6.5 in Advanced Combinatorics: The Art of Finite and Infinite Expansions, rev. enl. ed. Dordrecht, Netherlands: Reidel, pp. 240-246, 1974.Gassner, B. J. "Sorting by Replacement Selection." Comm. ACM 10, 89-93, 1967.Graham, R. L.; Knuth, D. E.; and Patashnik, O. Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, 1994.Knuth, D. E. The Art of Computer Programming, Vol. 3: Sorting and Searching, 2nd ed. Reading, MA: Addison-Wesley, 1998.Mannila, H. "Measures of Presortedness and Optimal Sorting Algorithms." IEE Trans. Comput. 34, 318-325, 1985.Skiena, S. "Runs and Eulerian Numbers." §1.3.4 in Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading, MA: Addison-Wesley, pp. 30-31, 1990.

在 上被引用

排列遊程

請引用為

Weisstein, Eric W. "排列遊程." 來自 --一個 資源。 https://mathworld.tw/PermutationRun.html

學科分類