Exercises on regular operations

  1. Regular description for {w{a,b}waaa>0    wbbb>0    waba>0    wbab>0}\{ w \in \{a,b\}^* \mid |w|_{aaa}>0\;\vee\;|w|_{bbb}>0\;\vee\;|w|_{aba}>0\;\vee\;|w|_{bab}>0 \}
  2. Regular description for {w{a,b}waaa>0    wbbb>0    waba>0    wbab>0}\{ w \in \{a,b\}^* \mid |w|_{aaa}>0\;\wedge\;|w|_{bbb}>0\;\wedge\;|w|_{aba}>0\;\wedge\;|w|_{bab}>0 \}
  3. Regular description for {w{a,b}waaa=wbbb=1}\{ w \in \{a,b\}^* \mid |w|_{aaa}=|w|_{bbb}=1 \}
  4. Regular description for {w{a,b}waba=wbab=1}\{ w \in \{a,b\}^* \mid |w|_{aba}=|w|_{bab}=1 \}
  5. Regular description for {w{a,b}w1,w2:(w=w1aw2    w2=5)    wbbb>0}\{ w \in \{a,b\}^* \mid \exists w_1,w_2: (w=w_1aw_2\;\wedge\;|w_2|=5)\;\wedge\;|w|_{bbb}>0 \}
  6. Regular description for {w{0,1}value2(w)12˙}\{ w \in \{0,1\}^* \mid \mathtt{value}_2(w)\in\dot{12}\}
  7. Regular description for {w{0,1}value2(w)20˙}\{ w \in \{0,1\}^* \mid \mathtt{value}_2(w)\in\dot{20}\}
  8. Regular description for {w{0,1}value2(w)60˙}\{ w \in \{0,1\}^* \mid \mathtt{value}_2(w)\in\dot{60}\}
  9. Regular description for σ(L)\sigma(L) where L={w{a,b}x,y:(w=xay    y=2)}L=\{ w \in \{a,b\}^* \mid \exists x,y: (w=xay\;\wedge\;|y|=2) \}
    and σ\sigma is the morphism defined by σ(a)=aba\sigma(a)=aba and σ(b)=bab\sigma(b)=bab
  10. Regular description for σ(L)\sigma(L) where L={w{a,b,c}x,y:((w=xay    w=xcy)    y=1)}L=\{ w \in \{a,b,c\}^* \mid \exists x,y: ((w=xay\;\vee\;w=xcy)\;\wedge\;|y|=1) \}
    and σ\sigma is the morphism defined by σ(a)=aba\sigma(a)=aba, σ(b)=aa\sigma(b)=aa and σ(c)=b\sigma(c)=b
  11. Regular description for σ(L)\sigma(L) where L={w{a,b}x,y:(w=xay    y=2)}L=\{ w \in \{a,b\}^* \mid \exists x,y: (w=xay\;\wedge\;|y|=2) \}
    and σ\sigma is the substitution defined by σ(a)={aa}\sigma(a)=\{aa\}^* and σ(b)={a,aba,bab}\sigma(b)=\{a,aba,bab\}
  12. Regular description for the language recognized by the NFA with set of states {0,1,2,3,4,5}\{0,1,2,3,4,5\},
    initial state 00, accepting state 44, and transitions
    δ(0,a)={1,3},  δ(0,b)=4,  δ(1,a)=4,  δ(1,b)={2,3},  δ(2,b)=5,  δ(3,a)=2,  δ(4,a)={0,5},  δ(4,b)={0,2},  δ(5,a)=4\delta(0,a)=\{1,3\},\;\delta(0,b)=4,\;\delta(1,a)=4,\;\delta(1,b)=\{2,3\},\;\delta(2,b)=5,\;\delta(3,a)=2,\;\delta(4,a)=\{0,5\},\;\delta(4,b)=\{0,2\},\;\delta(5,a)=4
  13. Regular description for the language recognized by the NFA with set of states {0,1,2,3,4,5}\{0,1,2,3,4,5\},
    initial states {2,5}\{2,5\}, accepting state 44, and transitions
    δ(0,a)={1,3},  δ(0,b)=4,  δ(1,a)=4,  δ(1,b)={2,3},  δ(2,b)=5,  δ(3,a)=2,  δ(4,a)={0,5},  δ(4,b)={0,2},  δ(5,a)=4\delta(0,a)=\{1,3\},\;\delta(0,b)=4,\;\delta(1,a)=4,\;\delta(1,b)=\{2,3\},\;\delta(2,b)=5,\;\delta(3,a)=2,\;\delta(4,a)=\{0,5\},\;\delta(4,b)=\{0,2\},\;\delta(5,a)=4
  14. Regular description for {annD}\{a^n\mid n\in D\}, where DD is the set of distances of paths (with allowed repetition of nodes in the path)
    from node 00 to node 44 in the directed graph with edges labelled with lengths whose set of nodes is {0,1,2,3,4}\{0,1,2,3,4\} and whose set of edges is
    {041,  142,  163,  240,  224,  320,  443}\{0\xrightarrow{4}1,\;1\xrightarrow{4}2,\;1\xrightarrow{6}3,\;2\xrightarrow{4}0,\;2\xrightarrow{2}4,\;3\xrightarrow{2}0,\;4\xrightarrow{4}3\}
  15. Regular description for {annD}\{a^n\mid n\in D\}, where DD is the set of distances of paths (with allowed repetition of nodes in the path)
    from node 00 to node 55 in the directed graph with edges labelled with lengths whose set of nodes is {0,1,2,3,4,5}\{0,1,2,3,4,5\} and whose set of edges is
    {071,  042,  171,  193,  244,  235,  340,  452,  433,  594}\{0\xrightarrow{7}1,\;0\xrightarrow{4}2,\;1\xrightarrow{7}1,\;1\xrightarrow{9}3,\;2\xrightarrow{4}4,\;2\xrightarrow{3}5,\;3\xrightarrow{4}0,\;4\xrightarrow{5}2,\;4\xrightarrow{3}3,\;5\xrightarrow{9}4\}
  16. Regular description for σ(L)\sigma(L) where L={w{a,b}wa2˙}L=\{ w \in \{a,b\}^* \mid |w|_a\in\dot{2} \}
    and σ\sigma is the transducer with states {0,1,2}\{0,1,2\}, initial state 00, and transitions
    0aaba1,  0bbb2,  1ab2,  1ba0,  2aa1,  2bbbba00\xrightarrow{a\,|\,aba}1,\;0\xrightarrow{b\,|\,bb}2,\;1\xrightarrow{a\,|\,b}2,\;1\xrightarrow{b\,|\,a}0,\;2\xrightarrow{a\,|\,a}1,\;2\xrightarrow{b\,|\,bbba}0
  17. Regular description for σ(L)\sigma(L) where L={xay{a,b}y=1}L=\{ xay \in \{a,b\}^* \mid |y|=1 \}
    and σ\sigma is the transducer with states {0,1}\{0,1\}, initial state 00, and transitions
    0aaba0,  0bb1,  1ab0,  1baa10\xrightarrow{a\,|\,aba}0,\;0\xrightarrow{b\,|\,b}1,\;1\xrightarrow{a\,|\,b}0,\;1\xrightarrow{b\,|\,aa}1
  18. Regular description for {intercal(w1,w2)w1,w2{0,1}    w1=w2    value2(w1)>value2(w2)}\{ \mathtt{intercal}(w_1,w_2) \mid w_1,w_2\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|\;\wedge\;\mathtt{value}_2(w_1)>\mathtt{value}_2(w_2) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  19. Regular description for {intercal(w1,w2)w1,w2{0,1}    w1=w2    value2(w1)<value2(w2)}\{ \mathtt{intercal}(w_1,w_2) \mid w_1,w_2\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|\;\wedge\;\mathtt{value}_2(w_1)<\mathtt{value}_2(w_2) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  20. Regular description for {intercal(w1,w2,w3)w1,w2,w3{0,1}    w1=w2=w3    value2(w1)>value2(w2)>value2(w3)}\{ \mathtt{intercal}(w_1,w_2,w_3) \mid w_1,w_2,w_3\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|\;\wedge\;\mathtt{value}_2(w_1)>\mathtt{value}_2(w_2)>\mathtt{value}_2(w_3) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  21. Regular description for {intercal(w1,w2,w3)w1,w2,w3{0,1}    w1=w2=w3    value2(w1)>value2(w2)<value2(w3)}\{ \mathtt{intercal}(w_1,w_2,w_3) \mid w_1,w_2,w_3\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|\;\wedge\;\mathtt{value}_2(w_1)>\mathtt{value}_2(w_2)<\mathtt{value}_2(w_3) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  22. Regular description for {intercal(w1,w3)w2:(w1,w2,w3{0,1}    w1=w2=w3    value2(w1)>value2(w2)>value2(w3))}\{ \mathtt{intercal}(w_1,w_3) \mid \exists w_2: (w_1,w_2,w_3\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|\;\wedge\;\mathtt{value}_2(w_1)>\mathtt{value}_2(w_2)>\mathtt{value}_2(w_3)) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  23. Regular description for {intercal(w1,w2,w3)w1,w2,w3{0,1}    w1=w2=w3    value2(w1)+value2(w2)=value2(w3)}\{ \mathtt{intercal}(w_1,w_2,w_3) \mid w_1,w_2,w_3\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|\;\wedge\;\mathtt{value}_2(w_1)+\mathtt{value}_2(w_2)=\mathtt{value}_2(w_3) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  24. Regular description for {intercal(w1,w2,w3,w4)w1,w2,w3,w4{0,1}    w1=w2=w3=w4    value2(w1)+value2(w2)=value2(w3)>value2(w4)}\{ \mathtt{intercal}(w_1,w_2,w_3,w_4) \mid w_1,w_2,w_3,w_4\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|=|w_4|\;\wedge\;\mathtt{value}_2(w_1)+\mathtt{value}_2(w_2)=\mathtt{value}_2(w_3)>\mathtt{value}_2(w_4) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  25. Regular description for {intercal(w1,w2,w4)w3:(w1,w2,w3,w4{0,1}    w1=w2=w3=w4    value2(w1)+value2(w2)=value2(w3)>value2(w4))}\{ \mathtt{intercal}(w_1,w_2,w_4) \mid \exists w_3: (w_1,w_2,w_3,w_4\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|=|w_4|\;\wedge\;\mathtt{value}_2(w_1)+\mathtt{value}_2(w_2)=\mathtt{value}_2(w_3)>\mathtt{value}_2(w_4)) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda
  26. Regular description for {intercal(w1,w2,w4,w5)w3:(w1,w2,w3,w4,w5{0,1}    w1=w2=w3=w4=w5    value2(w1)+value2(w2)=value2(w3)>value2(w4)+value2(w5))}\{ \mathtt{intercal}(w_1,w_2,w_4,w_5) \mid \exists w_3: (w_1,w_2,w_3,w_4,w_5\in\{0,1\}^*\;\wedge\;|w_1|=|w_2|=|w_3|=|w_4|=|w_5|\;\wedge\;\mathtt{value}_2(w_1)+\mathtt{value}_2(w_2)=\mathtt{value}_2(w_3)>\mathtt{value}_2(w_4)+\mathtt{value}_2(w_5)) \},
    where intercal(a1w1,,anwn)=a1anintercal(w1,,wn)\mathtt{intercal}(a_1w_1,\ldots,a_nw_n)=a_1\ldots a_n\mathtt{intercal}(w_1,\ldots,w_n) and intercal(λ,,λ)=λ\mathtt{intercal}(\lambda,\ldots,\lambda)=\lambda