Suppose $w,u\in\Sigma^*$, $w^5=u^3$, and I need to show that $wu=uw$.
I started with $5|w|=3|u|$, but I didn't know how to continue... any suggestions?
Suppose $w,u\in\Sigma^*$, $w^5=u^3$, and I need to show that $wu=uw$.
I started with $5|w|=3|u|$, but I didn't know how to continue... any suggestions?
Copyright © 2021 JogjaFile Inc.
Like you said, we have $5 |w| = 3 |u|$. Since $3$ and $5$ are co-prime, $|w|$ is a multiple of $3$.
Therefore, there exist $w_1, w_2, w_3\in \Sigma^*$ such that $|w_1|=|w_2|=|w_3|$ and $w=w_1 w_2 w_3$.
Now we have : $$\begin{array}{c c c c c} w^5&=&(w_1 w_2 w_3)(w_1 w_2 w_3)(w_1 w_2 w_3)(w_1 w_2 w_3)(w_1 w_2 w_3)& & \\ &=&(w_1 w_2 w_3 w_1 w_2) (w_3 w_1 w_2 w_3 w_1) (w_2 w_3w_1 w_2 w_3)&=&u^3 \end{array}$$
Since the $w_i$ have the same length, we can deduce that $$u = w_1 w_2 w_3 w_1 w_2 = w_3 w_1 w_2 w_3 w_1 = w_2 w_3w_1 w_2 w_3$$ which implies thereafter that $w_1 = w_2 = w_3$.
Now we are able to easily conclude : $$uw = (w_1)^5(w_1)^3 = (w_1)^3 (w_1)^5 = wu$$