Counting and Generating Permutations Using Timed Languages

  • Nicolas Basset
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8392)


The signature of a permutation σ is a word sg(σ) ⊆ {a, d}* whose i th letter is d when σ has a descent (i.e. σ(i) > σ(i + 1)) and is a when σ has an ascent (i.e. σ(i) < σ(i + 1)). Combinatorics of permutations with a prescribed signature is quite well explored. Here we state and address the two problems of counting and randomly generating in the set sg − 1(L) of permutations with signature in a given regular language L ⊆ {a, d}*. First we give an algorithm that computes a closed form formula for the exponential generating function of sg − 1(L). Then we give an algorithm that generates randomly the n-length permutations of sg − 1(L) in a uniform manner, that is all the permutations of a given length with signature in L are equally probable to be returned. Both contributions are based on a geometric interpretation of a subclass of regular timed languages.


Regular Language Closed Form Formula Clock Word Generate Permutation Exponential Generate Function 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Alur, R., Dill, D.L.: A theory of timed automata. Theor. Comput. Sci. 126(2), 183–235 (1994)CrossRefzbMATHMathSciNetGoogle Scholar
  2. 2.
    Asarin, E., Basset, N., Degorre, A., Perrin, D.: Generating functions of timed languages. In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS 2012. LNCS, vol. 7464, pp. 124–135. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  3. 3.
    Asarin, E., Degorre, A.: Volume and entropy of regular timed languages: Analytic approach. In: Ouaknine, J., Vaandrager, F.W. (eds.) FORMATS 2009. LNCS, vol. 5813, pp. 13–27. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  4. 4.
    Basset, N.: Volumetry of timed languages and applications. PhD thesis, Université Paris-Est (2013)Google Scholar
  5. 5.
    Bernardi, O., Giménez, O.: A linear algorithm for the random sampling from regular languages. Algorithmica 62(1-2), 130–145 (2012)CrossRefzbMATHMathSciNetGoogle Scholar
  6. 6.
    Bouyer, P., Petit, A.: A Kleene/Büchi-like theorem for clock languages. Journal of Automata, Languages and Combinatorics 7(2), 167–186 (2002)zbMATHMathSciNetGoogle Scholar
  7. 7.
    Ehrenborg, R., Jung, J.: Descent pattern avoidance. In: Advances in Applied Mathematics (2012)Google Scholar
  8. 8.
    Elizalde, S., Noy, M.: Consecutive patterns in permutations. Advances in Applied Mathematics 30(1), 110–125 (2003)CrossRefzbMATHMathSciNetGoogle Scholar
  9. 9.
    Flajolet, P., Sedgewick, R.: Analytic combinatorics. Camb. Univ. press (2009)Google Scholar
  10. 10.
    Flajolet, P., Zimmerman, P., Van Cutsem, B.: A calculus for the random generation of labelled combinatorial structures. Theoretical Computer Science 132(1), 1–35 (1994)zbMATHMathSciNetGoogle Scholar
  11. 11.
    Hibi, T., Li, N.: Unimodular equivalence of order and chain polytopes. arXiv preprint arXiv:1208.4029 (2012)Google Scholar
  12. 12.
    Kitaev, S.: Patterns in permutations and words. Springer (2011)Google Scholar
  13. 13.
    Marchal, P.: Generating random permutations with a prescribed descent set. Presentation at Permutation Patterns (2013)Google Scholar
  14. 14.
    Nijenhuis, A., Wilf, H.S.: Combinatorial algorithms for computers and calculators. In: Computer Science and Applied Mathematics, 2nd edn., p. 1. Academic Press, New York (1978)Google Scholar
  15. 15.
    Stanley, R.P.: Two poset polytopes. Discrete & Computational Geometry 1(1), 9–23 (1986)CrossRefzbMATHMathSciNetGoogle Scholar
  16. 16.
    Stanley, R.P.: A survey of alternating permutations. In: Combinatorics and graphs. Contemp. Math., vol. 531, pp. 165–196. Amer. Math. Soc., Providence (2010)CrossRefGoogle Scholar
  17. 17.
    Szpiro, G.G.: The number of permutations with a given signature, and the expectations of their elements. Discrete Mathematics 226(1), 423–430 (2001)CrossRefzbMATHMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Nicolas Basset
    • 1
  1. 1.Department of Computer ScienceUniversity of OxfordUnited Kingdom

Personalised recommendations