Affiliation:
1. Department of Informatics , Gunadarma University , Indonesia
2. LIB, Université Bourgogne Franche-Comté, France
Abstract
Abstract
A generalized (resp. p-ary) ballot sequence is a sequence over the set of non-negative integers (resp. integers less than p) where in any of its prefixes each positive integer i occurs at most as often as any integer less than i. We show that the Reected Gray Code order induces a cyclic 3-adjacent Gray code on both, the set of fixed length generalized ballot sequences and p-ary ballot sequences when p is even, that is, ordered list where consecutive sequences (regarding the list cyclically) differ in at most 3 adjacent positions. Non-trivial efficient generating algorithms for these ballot sequences, in lexicographic order and for the obtained Gray codes, are also presented.
Reference20 articles.
1. [1] A. Bernini, S. Bilotta, R. Pinzani, A. Sabri and V. Vajnovszki, Reected Gray codes for q-ary words avoiding a given factor, Acta Inform., 52 (2015) 573–592.10.1007/s00236-015-0225-2
2. [2] J. Bertrand, Solution d'un probléme, C. R. Math. Acad. Sci. Paris, 105 (1887) 369.
3. [3] M. C. Er, On generating the N-ary reected Gray code, IEEE Trans. Comput., 33 (1984) 739-741.10.1109/TC.1984.5009360
4. [4] F. Gray, Pulse code communication, U.S. Patent 2632058, 1953.
5. [5] P. Klingsberg, A Gray code for compositions, J. Algorithms, 3 (1981) 41–44.10.1016/0196-6774(82)90006-2