If we have the string ab, would abab be a permutation of ab? It seems that a permutation is a rearrangement of things but only within the things in our set. In this example, that set is ab.
Asked
Active
Viewed 194 times
0
-
3The only permutations of ab are itself and ba. A permutation of a string is a rearrangement of it, and so must have the same length. – coffeemath Sep 18 '14 at 22:30
1 Answers
0
There are only two permutations of $ab$: $ab$ and $ba$. A permutation is a rearrangement of characters in the string.
A related (but different) concept is that of regular languages. For example, the language
$$(a + b)^*$$
Describes all character sequences of length zero or more whose characters are from the set $\{a, b\}$. Using a canonical enumeration scheme, this language includes $\epsilon$ (the empty string), $a$, $b$, $aa$, $ab$, $ba$, $bb$, ...
The language $$(ab)^*$$ Describes the set of all character sequences formed by repeating $ab$ any number of times. This language includes $\epsilon$, $ab$, $abab$, ...
A.E
- 2,473