# Polynomial-time algorithm for distribution of arbitrary symbols

Is there a polynomial-time algorithm for distribution of clauses of arbitrary symbols (i.e. similar to multiplication distributing over addition)? For simplicity, let's assume the distributive operation is concatenation and the symbols are letters in the English alphabet. For example, the clause (a b c) distributed with the clause (d e f) would result in: ad ae af bd be bf cd ce cf. The clauses need not be the same length, but they are here for simplicity. It's clear that the length of the result grows exponentially with respect to the amount of clauses, but does that mean any algorithm to generate the result must then be in exp-time? Or is there a more efficient way of generating such results?

• Please define what you mean by "distribution of clauses". An example is not a substitute for a general specification. What are the inputs, and what is the desired output?
– D.W.
Oct 11 at 4:27
• Apologies, I thought what I gave would suffice. Essentially, it would be similar to multiplication distributing across addition. Each clause would contain an arbitrary number of characters, and concatenations would be generated by selecting one character from each clause, with all possible concatenations being the final output. Again, the process is similar to that of multiplication distributing across addition. Oct 11 at 12:27