I have a string 1111 and I know that 1 can be converted to 1, 10 or 100 but the string will be still 4 symbols length, so actually each 0 sign replaces next symbol.
So it could be
1111
1110
1101
1011
1010
1001
1100
How to count all possible convertions to limited string size?
I counted that:
first symbol `1` could be converted to `1`, `10` or `100`.
second symbol `1` could be converted to `1`, `10`or `100`.
third symbol `1` could be converted to `1`, `10`.
fourth symbol `1` could be converted to `1`.
So I have some map of size of convertions for each position:
1 -> 3
2 -> 3
3 -> 2
4 -> 1
And with that map I know that there are 3 permutations with 10 , 2 permutations with 100 and 1 permutation with 1, but I can't catch mix of permutations.
Like if there were 5 initial symbols 11111 and the same convertions, so I didn't catch mixes like
10100
10010
10101
10110
11010
How to catch them?
But I can't solve it in this direction.
Can you help me with that?
Firstly, how to do it using my map of convertions.
And if it is a dead end, then how to do it with other solutions?
UPD Trying to rephrase it.
I have an alphabet {1, 10, 100} and I need to count all possible permutations that are limited to the total symbol length of 4.
How to do it with knowing amount of permutations for each symbol ? Like
first symbol `1` could be converted to `1`, `10` or `100`.
second symbol `1` could be converted to `1`, `10`or `100`.
third symbol `1` could be converted to `1`, `10`.
fourth symbol `1` could be converted to `1`.