Skip to main content
added 2 characters in body; added 4 characters in body
Source Link
user16416
  • 121
  • 1
  • 3

I would like to generate fixed size sequences contained a fixed number of repeated symbols. For example how to generate sequences of size N containing exactly p symbols of one type q symbols of another, etc... where p, q, etc. < N.

In my case I want to generate sequences of size 13 containing 3 symbols denoted x, 2 symbols denoted y and 2 symbols denoted z. Blank spaces are marked with '-'

So it would look like xxxyyzz------, x-xx--y-y-zz- ... etc.

There are C(13, 3)*C(10,2)*C(8,2) ways of generating such sequences but I have no idea how to generate them.

Technically how do you describe this problem? Combinations with repetitions? Where can I find a description of algorithms to solve this? Does Knuth book describe this algorithms? Most of the solutions I find deal with generating permutations or combinations but none deal with repeated elements.

Thanks.

I would like to generate fixed size sequences contained a fixed number of repeated symbols. For example how to generate sequences of size N containing exactly p symbols of one type q symbols of another, etc... where p, q, etc. < N.

In my case I want to generate sequences of size 13 containing 3 symbols denoted x, 2 symbols denoted y and 2 symbols denoted z. Blank spaces are marked with '-'

So it would look like xxxyyzz------ x-xx--y-y-zz- ... etc.

There C(13, 3)*C(10,2)*C(8,2) ways of generating such sequences but I have no idea how to generate them.

Technically how do you describe this problem? Combinations with repetitions? Where can I find a description of algorithms to solve this? Does Knuth book describe this algorithms? Most of the solutions I find deal with generating permutations or combinations but none deal with repeated elements.

Thanks.

I would like to generate fixed size sequences contained a fixed number of repeated symbols. For example how to generate sequences of size N containing exactly p symbols of one type q symbols of another, etc... where p, q, etc. < N.

In my case I want to generate sequences of size 13 containing 3 symbols denoted x, 2 symbols denoted y and 2 symbols denoted z. Blank spaces are marked with '-'

So it would look like xxxyyzz------, x-xx--y-y-zz- ... etc.

There are C(13, 3)*C(10,2)*C(8,2) ways of generating such sequences but I have no idea how to generate them.

Technically how do you describe this problem? Combinations with repetitions? Where can I find a description of algorithms to solve this? Does Knuth book describe this algorithms? Most of the solutions I find deal with generating permutations or combinations but none deal with repeated elements.

Thanks.

Source Link
user16416
  • 121
  • 1
  • 3

Generate combinations with repeated symbols?

I would like to generate fixed size sequences contained a fixed number of repeated symbols. For example how to generate sequences of size N containing exactly p symbols of one type q symbols of another, etc... where p, q, etc. < N.

In my case I want to generate sequences of size 13 containing 3 symbols denoted x, 2 symbols denoted y and 2 symbols denoted z. Blank spaces are marked with '-'

So it would look like xxxyyzz------ x-xx--y-y-zz- ... etc.

There C(13, 3)*C(10,2)*C(8,2) ways of generating such sequences but I have no idea how to generate them.

Technically how do you describe this problem? Combinations with repetitions? Where can I find a description of algorithms to solve this? Does Knuth book describe this algorithms? Most of the solutions I find deal with generating permutations or combinations but none deal with repeated elements.

Thanks.