Skip to main content
edited tags
Link
joriki
  • 239.1k
  • 14
  • 302
  • 528
added 25 characters in body
Source Link
le4m
  • 3k
  • 2
  • 19
  • 37

Let $\{1, \dots, i\}$ be a set of consecutive integers. Suppose we are making a sequence $s$ of length-$n$ that does not contain all integers (or does contain all integers) in the given integer set. Specifically, we define an operation $S$ that counts the number of the integers used in the formation of the sequence $s$: $$ S(s) = |\{i: i = s_j \,\,\,\exists j\}|. $$$$ S(s) = |\{i: i = s_j \,\,\,\exists j\}| $$ where $s \in \{1,\dots, i\}^n$. What I'd like to do is to count the number of all sequences $s$ such that $S(s) = k$ for $k=1,\dots, i$; namely, $$ |\{ s : S(s) = k\} |. $$

Would there be a neat way to do this?

The strategy I thought about is first pick $k$ distinct integers then count all the possible ways to position them. Then the rest of the sequence elements can be arbitrary. However, I am not so sure whether this approach makes any duplicate sequences.

Anyhow I don't think this is neat; I kind of believe there would be much a neater solution.

Let $\{1, \dots, i\}$ be a set of consecutive integers. Suppose we are making a sequence $s$ of length-$n$ that does not contain all integers (or does contain all integers). Specifically, we define an operation $S$ that counts the number of the integers used in the formation of the sequence $s$: $$ S(s) = |\{i: i = s_j \,\,\,\exists j\}|. $$ What I'd like to do is to count the number of all sequences $s$ such that $S(s) = k$ for $k=1,\dots, i$; namely, $$ |\{ s : S(s) = k\} |. $$

Would there be a neat way to do this?

The strategy I thought about is first pick $k$ distinct integers then count all the possible ways to position them. Then the rest of the sequence elements can be arbitrary. However, I am not so sure whether this approach makes any duplicate sequences.

Anyhow I don't think this is neat; I kind of believe there would be much a neater solution.

Let $\{1, \dots, i\}$ be a set of consecutive integers. Suppose we are making a sequence $s$ of length-$n$ that does not contain all integers (or does contain all integers) in the given integer set. Specifically, we define an operation $S$ that counts the number of the integers used in the formation of the sequence $s$: $$ S(s) = |\{i: i = s_j \,\,\,\exists j\}| $$ where $s \in \{1,\dots, i\}^n$. What I'd like to do is to count the number of all sequences $s$ such that $S(s) = k$ for $k=1,\dots, i$; namely, $$ |\{ s : S(s) = k\} |. $$

Would there be a neat way to do this?

The strategy I thought about is first pick $k$ distinct integers then count all the possible ways to position them. Then the rest of the sequence elements can be arbitrary. However, I am not so sure whether this approach makes any duplicate sequences.

Anyhow I don't think this is neat; I kind of believe there would be much a neater solution.

Source Link
le4m
  • 3k
  • 2
  • 19
  • 37

count the number of fixed-length sequences with a specific condition

Let $\{1, \dots, i\}$ be a set of consecutive integers. Suppose we are making a sequence $s$ of length-$n$ that does not contain all integers (or does contain all integers). Specifically, we define an operation $S$ that counts the number of the integers used in the formation of the sequence $s$: $$ S(s) = |\{i: i = s_j \,\,\,\exists j\}|. $$ What I'd like to do is to count the number of all sequences $s$ such that $S(s) = k$ for $k=1,\dots, i$; namely, $$ |\{ s : S(s) = k\} |. $$

Would there be a neat way to do this?

The strategy I thought about is first pick $k$ distinct integers then count all the possible ways to position them. Then the rest of the sequence elements can be arbitrary. However, I am not so sure whether this approach makes any duplicate sequences.

Anyhow I don't think this is neat; I kind of believe there would be much a neater solution.