World's most popular travel blog for travel bloggers.

# [Solved]: Find strings in L^4

, ,
Problem Detail:
Let L = {ab,aa,baa}.  

I need to find L^4. From my understanding, I union the set.

So:

L^1 = {ab,aa,baa} L^2 = {abab,abaa,abbaa,aaab,aaaa,aabaa,baaab,baaaa,baabaa} L^3 = {abababab,abababaa,abababba,....} ?? 

I concatenate L^3 with L^2 as I did above correct? And then I concatenate L^4 with L^3?

#### Answered By : Yuval Filmus

The set $L^4$ consists of all words $xyzw$ where $x,y,z,w \in L$. In our case, there are (at most) $3^4 = 81$ such words, but I don't see why you'd want to write all of them. If you want, you can also compute $L^4$ by squaring $L$ twice: $L^4 = (L^2)^2$. Then there is no need to compute $L^3$.