$L_n = {x in Sigma^{*} | exists w, y, z in Sigma^*, x = ywz, w^r = w, |w| = n }$. x is palindrome of length...
up vote
1
down vote
favorite
$L_n = {x in Sigma^{*} | exists w, y, z in Sigma^*, x = ywz, w^r = w, |w| = n }$
Informally x is palindrome of length n
where $Sigma = {0,1}$
I'm having a hard time understanding this could someone please explain.
For $n = 1$
$L_1 = (0+1)^*(0+1)^*$ (Why? What does this mean?)
$L_1^c = sigma$ (What would the compliment mean)
For $n = 2$
$L_2 = (0+1)^*(00+11)(0+1)^*$
$L_2^c = (10)^*(epsilon + 1) + (01)^*(epsilon + 0)$
So my attempt on $n = 3$ (the above two were given)
$L_3 = (0+1)^* (000 + 111 + 101 + 010) (0+1)^*$
$L_3^c = (100)^*(epsilon + 1) + (011)^*(epsilon + 0)$
I get how regexes work I just don't understand how $L_1$ is the regex for palindrome of length one. Not sure what the compliment means. Same for $L_2$
regular-language
add a comment |
up vote
1
down vote
favorite
$L_n = {x in Sigma^{*} | exists w, y, z in Sigma^*, x = ywz, w^r = w, |w| = n }$
Informally x is palindrome of length n
where $Sigma = {0,1}$
I'm having a hard time understanding this could someone please explain.
For $n = 1$
$L_1 = (0+1)^*(0+1)^*$ (Why? What does this mean?)
$L_1^c = sigma$ (What would the compliment mean)
For $n = 2$
$L_2 = (0+1)^*(00+11)(0+1)^*$
$L_2^c = (10)^*(epsilon + 1) + (01)^*(epsilon + 0)$
So my attempt on $n = 3$ (the above two were given)
$L_3 = (0+1)^* (000 + 111 + 101 + 010) (0+1)^*$
$L_3^c = (100)^*(epsilon + 1) + (011)^*(epsilon + 0)$
I get how regexes work I just don't understand how $L_1$ is the regex for palindrome of length one. Not sure what the compliment means. Same for $L_2$
regular-language
1
$L_n$ is not the set of all palindromes of length $n$; it it the set of all words that contain a palindrome of length $n$.
– Magdiragdag
Nov 10 at 22:53
So I assume it only preserves the middle value? The compliments would preserve y, z?
– Tree Garen
Nov 10 at 22:54
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
$L_n = {x in Sigma^{*} | exists w, y, z in Sigma^*, x = ywz, w^r = w, |w| = n }$
Informally x is palindrome of length n
where $Sigma = {0,1}$
I'm having a hard time understanding this could someone please explain.
For $n = 1$
$L_1 = (0+1)^*(0+1)^*$ (Why? What does this mean?)
$L_1^c = sigma$ (What would the compliment mean)
For $n = 2$
$L_2 = (0+1)^*(00+11)(0+1)^*$
$L_2^c = (10)^*(epsilon + 1) + (01)^*(epsilon + 0)$
So my attempt on $n = 3$ (the above two were given)
$L_3 = (0+1)^* (000 + 111 + 101 + 010) (0+1)^*$
$L_3^c = (100)^*(epsilon + 1) + (011)^*(epsilon + 0)$
I get how regexes work I just don't understand how $L_1$ is the regex for palindrome of length one. Not sure what the compliment means. Same for $L_2$
regular-language
$L_n = {x in Sigma^{*} | exists w, y, z in Sigma^*, x = ywz, w^r = w, |w| = n }$
Informally x is palindrome of length n
where $Sigma = {0,1}$
I'm having a hard time understanding this could someone please explain.
For $n = 1$
$L_1 = (0+1)^*(0+1)^*$ (Why? What does this mean?)
$L_1^c = sigma$ (What would the compliment mean)
For $n = 2$
$L_2 = (0+1)^*(00+11)(0+1)^*$
$L_2^c = (10)^*(epsilon + 1) + (01)^*(epsilon + 0)$
So my attempt on $n = 3$ (the above two were given)
$L_3 = (0+1)^* (000 + 111 + 101 + 010) (0+1)^*$
$L_3^c = (100)^*(epsilon + 1) + (011)^*(epsilon + 0)$
I get how regexes work I just don't understand how $L_1$ is the regex for palindrome of length one. Not sure what the compliment means. Same for $L_2$
regular-language
regular-language
edited Nov 10 at 22:59
asked Nov 10 at 22:45
Tree Garen
34319
34319
1
$L_n$ is not the set of all palindromes of length $n$; it it the set of all words that contain a palindrome of length $n$.
– Magdiragdag
Nov 10 at 22:53
So I assume it only preserves the middle value? The compliments would preserve y, z?
– Tree Garen
Nov 10 at 22:54
add a comment |
1
$L_n$ is not the set of all palindromes of length $n$; it it the set of all words that contain a palindrome of length $n$.
– Magdiragdag
Nov 10 at 22:53
So I assume it only preserves the middle value? The compliments would preserve y, z?
– Tree Garen
Nov 10 at 22:54
1
1
$L_n$ is not the set of all palindromes of length $n$; it it the set of all words that contain a palindrome of length $n$.
– Magdiragdag
Nov 10 at 22:53
$L_n$ is not the set of all palindromes of length $n$; it it the set of all words that contain a palindrome of length $n$.
– Magdiragdag
Nov 10 at 22:53
So I assume it only preserves the middle value? The compliments would preserve y, z?
– Tree Garen
Nov 10 at 22:54
So I assume it only preserves the middle value? The compliments would preserve y, z?
– Tree Garen
Nov 10 at 22:54
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
$L_n$ is the set of strings in $Sigma^*$ that have a palindrome of length $n$ as a substring. The complement of a language $L^C$ on an alphabet $Sigma$ is the set of strings in $Sigma^*$ that are not in $L$.
For $L_1$, every string of length $1$ is a palindrome, namely $1$ and $0$. Any nonempty string is in $L_1$, so $$
L_1=L((0+1)(0+1)^*)
$$
since any nonempty string is either a $1$ or $0$ followed by some number of $1$'s and $0$'s. The complement of the language is just the empty string (which we denote $epsilon$). $$
L_1^C={epsilon}
$$
For $L_2$, the palindromes of length $2$ are $11$ and $00$, so the language is any string with either $11$ or $00$ preceded and followed by some number of $1$'s and $0$'s. $$
L_2=L((0+1)^*(00+11)(0+1)^*)
$$
The complement of $L_2$ is the set of strings that don't contain $11$ or $00$, so these are just strings of alternating $1$'s and $0$'s. These could begin or end with $0$ or $1$, but the string must alternate characters. $$
L_2^C=L((01)^*(0+epsilon) + (10)^*(1+epsilon))
$$
For $L_3$, the palindromes of length $3$ are $000$, $010$, $101$, and $111$, so$$
L_3=L((0+1)^*(000+010+101+111)(0+1)^*)
$$
The complement of $L_3$, the strings that do not contain $000$, $010$, $101$, or $111$, is more difficult. Consider such a string that begin with $00$. The next character must be $1$ since if it was $0$, the string would contain $000$. Now, the next character for string $001$ must be $1$ since if it was $0$, the string would contain $010$. We can continue this argument to get $00110011...$ for arbitrarily long strings. From this, we can see that if the string has at least $4$ characters, it can be represented as some number of repetitions of $0011$, $0110$, $1100$, or $1001$ followed by a prefix of that string. Otherwise, if it has less than $4$ characters, it is a substring of one of these. $$
L_3^C=((0011)^*(epsilon+0+00+001)+(0110)^*(epsilon+0+01+011) \
+(1100)^*(epsilon+1+11+110)+(1001)^*(epsilon+1+10+100))
$$
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
$L_n$ is the set of strings in $Sigma^*$ that have a palindrome of length $n$ as a substring. The complement of a language $L^C$ on an alphabet $Sigma$ is the set of strings in $Sigma^*$ that are not in $L$.
For $L_1$, every string of length $1$ is a palindrome, namely $1$ and $0$. Any nonempty string is in $L_1$, so $$
L_1=L((0+1)(0+1)^*)
$$
since any nonempty string is either a $1$ or $0$ followed by some number of $1$'s and $0$'s. The complement of the language is just the empty string (which we denote $epsilon$). $$
L_1^C={epsilon}
$$
For $L_2$, the palindromes of length $2$ are $11$ and $00$, so the language is any string with either $11$ or $00$ preceded and followed by some number of $1$'s and $0$'s. $$
L_2=L((0+1)^*(00+11)(0+1)^*)
$$
The complement of $L_2$ is the set of strings that don't contain $11$ or $00$, so these are just strings of alternating $1$'s and $0$'s. These could begin or end with $0$ or $1$, but the string must alternate characters. $$
L_2^C=L((01)^*(0+epsilon) + (10)^*(1+epsilon))
$$
For $L_3$, the palindromes of length $3$ are $000$, $010$, $101$, and $111$, so$$
L_3=L((0+1)^*(000+010+101+111)(0+1)^*)
$$
The complement of $L_3$, the strings that do not contain $000$, $010$, $101$, or $111$, is more difficult. Consider such a string that begin with $00$. The next character must be $1$ since if it was $0$, the string would contain $000$. Now, the next character for string $001$ must be $1$ since if it was $0$, the string would contain $010$. We can continue this argument to get $00110011...$ for arbitrarily long strings. From this, we can see that if the string has at least $4$ characters, it can be represented as some number of repetitions of $0011$, $0110$, $1100$, or $1001$ followed by a prefix of that string. Otherwise, if it has less than $4$ characters, it is a substring of one of these. $$
L_3^C=((0011)^*(epsilon+0+00+001)+(0110)^*(epsilon+0+01+011) \
+(1100)^*(epsilon+1+11+110)+(1001)^*(epsilon+1+10+100))
$$
add a comment |
up vote
0
down vote
accepted
$L_n$ is the set of strings in $Sigma^*$ that have a palindrome of length $n$ as a substring. The complement of a language $L^C$ on an alphabet $Sigma$ is the set of strings in $Sigma^*$ that are not in $L$.
For $L_1$, every string of length $1$ is a palindrome, namely $1$ and $0$. Any nonempty string is in $L_1$, so $$
L_1=L((0+1)(0+1)^*)
$$
since any nonempty string is either a $1$ or $0$ followed by some number of $1$'s and $0$'s. The complement of the language is just the empty string (which we denote $epsilon$). $$
L_1^C={epsilon}
$$
For $L_2$, the palindromes of length $2$ are $11$ and $00$, so the language is any string with either $11$ or $00$ preceded and followed by some number of $1$'s and $0$'s. $$
L_2=L((0+1)^*(00+11)(0+1)^*)
$$
The complement of $L_2$ is the set of strings that don't contain $11$ or $00$, so these are just strings of alternating $1$'s and $0$'s. These could begin or end with $0$ or $1$, but the string must alternate characters. $$
L_2^C=L((01)^*(0+epsilon) + (10)^*(1+epsilon))
$$
For $L_3$, the palindromes of length $3$ are $000$, $010$, $101$, and $111$, so$$
L_3=L((0+1)^*(000+010+101+111)(0+1)^*)
$$
The complement of $L_3$, the strings that do not contain $000$, $010$, $101$, or $111$, is more difficult. Consider such a string that begin with $00$. The next character must be $1$ since if it was $0$, the string would contain $000$. Now, the next character for string $001$ must be $1$ since if it was $0$, the string would contain $010$. We can continue this argument to get $00110011...$ for arbitrarily long strings. From this, we can see that if the string has at least $4$ characters, it can be represented as some number of repetitions of $0011$, $0110$, $1100$, or $1001$ followed by a prefix of that string. Otherwise, if it has less than $4$ characters, it is a substring of one of these. $$
L_3^C=((0011)^*(epsilon+0+00+001)+(0110)^*(epsilon+0+01+011) \
+(1100)^*(epsilon+1+11+110)+(1001)^*(epsilon+1+10+100))
$$
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
$L_n$ is the set of strings in $Sigma^*$ that have a palindrome of length $n$ as a substring. The complement of a language $L^C$ on an alphabet $Sigma$ is the set of strings in $Sigma^*$ that are not in $L$.
For $L_1$, every string of length $1$ is a palindrome, namely $1$ and $0$. Any nonempty string is in $L_1$, so $$
L_1=L((0+1)(0+1)^*)
$$
since any nonempty string is either a $1$ or $0$ followed by some number of $1$'s and $0$'s. The complement of the language is just the empty string (which we denote $epsilon$). $$
L_1^C={epsilon}
$$
For $L_2$, the palindromes of length $2$ are $11$ and $00$, so the language is any string with either $11$ or $00$ preceded and followed by some number of $1$'s and $0$'s. $$
L_2=L((0+1)^*(00+11)(0+1)^*)
$$
The complement of $L_2$ is the set of strings that don't contain $11$ or $00$, so these are just strings of alternating $1$'s and $0$'s. These could begin or end with $0$ or $1$, but the string must alternate characters. $$
L_2^C=L((01)^*(0+epsilon) + (10)^*(1+epsilon))
$$
For $L_3$, the palindromes of length $3$ are $000$, $010$, $101$, and $111$, so$$
L_3=L((0+1)^*(000+010+101+111)(0+1)^*)
$$
The complement of $L_3$, the strings that do not contain $000$, $010$, $101$, or $111$, is more difficult. Consider such a string that begin with $00$. The next character must be $1$ since if it was $0$, the string would contain $000$. Now, the next character for string $001$ must be $1$ since if it was $0$, the string would contain $010$. We can continue this argument to get $00110011...$ for arbitrarily long strings. From this, we can see that if the string has at least $4$ characters, it can be represented as some number of repetitions of $0011$, $0110$, $1100$, or $1001$ followed by a prefix of that string. Otherwise, if it has less than $4$ characters, it is a substring of one of these. $$
L_3^C=((0011)^*(epsilon+0+00+001)+(0110)^*(epsilon+0+01+011) \
+(1100)^*(epsilon+1+11+110)+(1001)^*(epsilon+1+10+100))
$$
$L_n$ is the set of strings in $Sigma^*$ that have a palindrome of length $n$ as a substring. The complement of a language $L^C$ on an alphabet $Sigma$ is the set of strings in $Sigma^*$ that are not in $L$.
For $L_1$, every string of length $1$ is a palindrome, namely $1$ and $0$. Any nonempty string is in $L_1$, so $$
L_1=L((0+1)(0+1)^*)
$$
since any nonempty string is either a $1$ or $0$ followed by some number of $1$'s and $0$'s. The complement of the language is just the empty string (which we denote $epsilon$). $$
L_1^C={epsilon}
$$
For $L_2$, the palindromes of length $2$ are $11$ and $00$, so the language is any string with either $11$ or $00$ preceded and followed by some number of $1$'s and $0$'s. $$
L_2=L((0+1)^*(00+11)(0+1)^*)
$$
The complement of $L_2$ is the set of strings that don't contain $11$ or $00$, so these are just strings of alternating $1$'s and $0$'s. These could begin or end with $0$ or $1$, but the string must alternate characters. $$
L_2^C=L((01)^*(0+epsilon) + (10)^*(1+epsilon))
$$
For $L_3$, the palindromes of length $3$ are $000$, $010$, $101$, and $111$, so$$
L_3=L((0+1)^*(000+010+101+111)(0+1)^*)
$$
The complement of $L_3$, the strings that do not contain $000$, $010$, $101$, or $111$, is more difficult. Consider such a string that begin with $00$. The next character must be $1$ since if it was $0$, the string would contain $000$. Now, the next character for string $001$ must be $1$ since if it was $0$, the string would contain $010$. We can continue this argument to get $00110011...$ for arbitrarily long strings. From this, we can see that if the string has at least $4$ characters, it can be represented as some number of repetitions of $0011$, $0110$, $1100$, or $1001$ followed by a prefix of that string. Otherwise, if it has less than $4$ characters, it is a substring of one of these. $$
L_3^C=((0011)^*(epsilon+0+00+001)+(0110)^*(epsilon+0+01+011) \
+(1100)^*(epsilon+1+11+110)+(1001)^*(epsilon+1+10+100))
$$
answered 2 days ago
Joey Kilpatrick
67118
67118
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2993228%2fl-n-x-in-sigma-exists-w-y-z-in-sigma-x-ywz-wr-w-w%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$L_n$ is not the set of all palindromes of length $n$; it it the set of all words that contain a palindrome of length $n$.
– Magdiragdag
Nov 10 at 22:53
So I assume it only preserves the middle value? The compliments would preserve y, z?
– Tree Garen
Nov 10 at 22:54