# Useful definitions of vector addition, dot product and scalar multiplication for strings?

A string is something like: "ad939-0x!", or "mary had a LittLE lambD". There's a character set, and you glue stuff together from the character set to build strings.

Have there been any useful definitions for operations on strings that allow strings to form a vector space?

• Polynomials can be seen as strings. – Git Gud Feb 7 '15 at 18:08
• @GitGud Polynomials are encoded by vectors, they are not elements of vectors. – user89 Feb 7 '15 at 18:58

To give you a flavor of the theory, given a string of characters one may choose to ignore character positions and focus only on number of character occurrences only. This map is well studied and its range in your case is 26-dimensional Parikh Space. For example, the string "baaab" maps to vector (3,2,0,...), while "cbc" maps to (0,1,2,...). Their concatenation "baaab"+"cbc" maps to vector sum (3,3,2,...).