in reply to Re: How to show all possible replacements?
in thread How to show all possible replacements?
Thank you for your reply, I'll check glob out.
I have created an algorithm that processes quite large binary words, to acquire complexity-related characteristics from them, one being the amount of ways to create this word using only concatenation, and in minimal amount of operations used.
The complete algorithm basically divides the original word into two parts, recursively uses itself to look for easiest ways to concatenate the smallest word(left in case the word was halved on step 1). The concatenation scheme of the smallest word is called later as prehistory of this word - the list of word already created, and those can be used to create the second word.
The question posted arose, when I started to test this algorithm on larger words, say:
Word = 01101001, maximum complexity is 5.
1. A = 01; B = 101001.
2. P(A) = {0,1;01}, C(A) = 1;
3. Map generated:
01 -> a;
4. If B is replaced only the greediest way possible:
1a0a, it can be created in 3 steps, but, the algorithm misses a scheme, since the word 1010a can also be created in 3 steps, so it also does not break the rule:
C(A) + C(B) = C(W) + 1