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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.