Skip to main content
Log in

Gray code orders for \(q\)-ary words avoiding a given factor

  • Original Article
  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

Based on order relations inspired by the binary reflected Gray code (BRGC) we define Gray codes and give a generating algorithm for \(q\)-ary words avoiding a prescribed factor. These generalize an early 2001 result and a very recent one published by some of the present authors, and can be seen as an alternative to those of Squire published in 1996. Among the involved tools, we make use of generalized BRGC order relations, ultimate periodicity of infinite words, and word matching techniques.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Bernini, A., Bilotta, S., Pinzani, R., Vajnovszki, V.: Two Gray codes for \(q\)-ary \(k\)-generalized Fibonacci strings. In: ICTCS13, Palermo-Italy, 9–11 Sept (2013)

  2. Bilotta, S., Pergola, E., Pinzani, R.: A construction for a class of binary words avoiding \(1^j0^i\). Pu.M.A 23(2), 81–102 (2012)

  3. Bilotta, S., Merlini, D., Pergola, E., Pinzani, R.: Pattern \(1^{j+1}0^j\) avoiding binary words. Fund. Inf. 117, 35–55 (2012)

    MATH  MathSciNet  Google Scholar 

  4. Er, M.C.: On generating the \(N\)-ary reflected Gray code. IEEE Trans. Comput. 33(8), 739–741 (1984)

  5. Gray, F.: Pulse code communication. US Patent 2632058 (1953)

  6. Guibas, L.J., Odlyzko, A.M.: Periods in strings. J. Comb. Theory Ser. A 30(1), 19–42 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  7. Heubach, S., Mansour, T.: Combinatorics of Compositions and Words. Chapman and Hall/CRC, Taylor & Francis Group, Boca Raton, London, New York (2009)

  8. Joichi, J., White, D.E., Williamson, S.G.: Combinatorial Gray codes. SIAM J. Comput. 9, 130–141 (1980)

  9. Knuth, D.E., Morris, J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6, 323–350 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  10. Li, Y., Sawada, J.: Gray codes for reflectable languages. Inf. Process. Lett. 109(5), 296–300 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  11. Lothaire, M.: Applied Combinatorics on Words. Cambridge University Press, New York (2005)

    Book  MATH  Google Scholar 

  12. Sabri, A., Vajnovszki, V.: Two reflected Gray code based orders on some restricted growth sequences. Comput. J. (to appear)

  13. Squire, M.: Gray codes for \(A\)-free strings. Electr. J. Comb. 3(paper R17) (1996)

  14. Ruskey, F.: Combinatorial Generation (book in preparation)

  15. Vajnovszki, V.: A loopless generation of bitstrings without \(p\) consecutive ones. In: Calude, C.S., Dinneen, M.J., Sburlan, S. (eds.) Combinatorics, Computability and Logic. Discrete Mathematics and Theoretical Computer Science, pp. 227–240. Springer, London (2001)

  16. Vajnovszki, V., Vernay, R.: Restricted compositions and permutations: from old to new Gray codes. Inf. Process. Lett. 111(13), 650–655 (2011)

  17. Vajnovszki, V.: http://v.vincent.u-bourgogne.fr/0ABS/publi.html

  18. Walsh, T.: Generating Gray codes in \(O(1)\) worst-case time per word. In: 4th Discrete Mathematics and Theoretical Computer Science Conference, Dijon-France, 7–12 July 2003 (LNCS), vol. 2731, pp. 73–88 (2003)

  19. Walsh, T.: Loop-free sequencing of bounded integer compositions. J. Comb. Math. Comb. Comput. 33, 323–345 (2000)

    MATH  Google Scholar 

  20. Williamson, S.G.: Combinatorics for Computer Science. Computer Science Press, Rockville (1985)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to V. Vajnovszki.

Appendix

Appendix

See Tables 2 and 3.

Table 2 The set \(A_3^4\) listed in \(\triangleleft \) order, inducing a 2-Gray code
Table 3 (a) The set \(A_2^4(011)\) listed in \(\prec \) order, inducing 3-adjacent Gray code; (b) the reverse of the list in (a), giving Gray code for \(A_2^4(110)\); (c) the complement of the list in (b), giving Gray code for \(A_2^4(001)\)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bernini, A., Bilotta, S., Pinzani, R. et al. Gray code orders for \(q\)-ary words avoiding a given factor. Acta Informatica 52, 573–592 (2015). https://doi.org/10.1007/s00236-015-0225-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-015-0225-2

Navigation