Exercise 4:

Context-free description for {intercal(w1,w2)w1,w2{a,b}    w1=w2    w1=w1R    w2aa=0}\{ \mathtt{intercal}(w_1,w_2) \mid w_1,w_2\in\{a,b\}^*\;\wedge\;|w_1|=|w_2|\;\wedge\;w_1=w_1^R\;\wedge\;|w_2|_{aa}=0 \},
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
Give a context-free description for the set of words obtained by intercaling two words w1,w2w_1,w_2 over {a,b}\{a,b\} with the same length, where w1w_1 is palindromic and with no occurrences of aaaa in w2w_2.

Intercaling nn words w1,,wnw_1,\ldots,w_n over {a,b}\{a,b\} and with the same length gives as result a word whose sequence of symbols is: the first symbol of w1w_1, the first symbol of w2w_2, …, the first symbol of wnw_n, the second symbol of w1w_1, the second symbol of w2w_2, …, the second symbol of wnw_n, the third symbol of w1w_1, and so on.
Authors: Guillem Godoy / Documentation:
To be able to submit you need to either log in, register, or become a guest.