Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a combinatorial problem that I think is related to sequences over an alphabet.

The situation is the following: I have an alphabet of n symbols and I want to look at sequences that contain each symbol at most m times.

For which m and n exists a sequence s such that for each subset of the n symbols, there exists a substring of s containing exactly these symbols?

Example: 1) If I have 3 symbols A,B,C and K=2, there exists such a sequence: ABCA, which contains (apart from the singleton subsets and the whole set) all subsets consisting of two symbols as substrings. 2) If K is unlimited, there exists such a sequence for each n since I can just spell out all subsets. The length of this string is exponential in n.

Has anyone encountered a problem like this? I'd really appreciate pointers to related theories.

share|cite|improve this question
You might want to look at De Bruijn sequences, which are sequences that contain each subsequence of symbols exactly once. In that case, the subsequences $BC$ and $CB$ both appear once. – TMM Sep 13 '11 at 13:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.