PDA: Symbol in first half
up vote
1
down vote
favorite
How do I construct a PDA where:
$L = {w in {0, 1} ∗ : |w| text{ is even and } w text{ contains at least one 1-Symbol in the first Half}}$
To me it seems impossible to know when I reached the midpoint.
computer-science formal-languages automata
New contributor
add a comment |
up vote
1
down vote
favorite
How do I construct a PDA where:
$L = {w in {0, 1} ∗ : |w| text{ is even and } w text{ contains at least one 1-Symbol in the first Half}}$
To me it seems impossible to know when I reached the midpoint.
computer-science formal-languages automata
New contributor
Parallelly, try also the pumping lemma.
– Berci
Nov 21 at 17:34
The assignment doesn't say that the PDA needs to be deterministic.
– rici
Nov 21 at 19:11
...although a DPDA does exist, too.
– rici
Nov 21 at 21:13
1
Maybe it helps to reformulate the set definition. Equivalently we could say: $|w|$ is even, $w$ contains at least one 1-symbol, and the first 1-symbol that occurs is in the first half of $w$.
– Peter Leupold
2 days ago
figured it out yesterday by myself, but @PeterLeupold reformulation really helps a lot. thanks!
– ZerataX
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
How do I construct a PDA where:
$L = {w in {0, 1} ∗ : |w| text{ is even and } w text{ contains at least one 1-Symbol in the first Half}}$
To me it seems impossible to know when I reached the midpoint.
computer-science formal-languages automata
New contributor
How do I construct a PDA where:
$L = {w in {0, 1} ∗ : |w| text{ is even and } w text{ contains at least one 1-Symbol in the first Half}}$
To me it seems impossible to know when I reached the midpoint.
computer-science formal-languages automata
computer-science formal-languages automata
New contributor
New contributor
edited Nov 22 at 2:45
New contributor
asked Nov 21 at 17:19
ZerataX
164
164
New contributor
New contributor
Parallelly, try also the pumping lemma.
– Berci
Nov 21 at 17:34
The assignment doesn't say that the PDA needs to be deterministic.
– rici
Nov 21 at 19:11
...although a DPDA does exist, too.
– rici
Nov 21 at 21:13
1
Maybe it helps to reformulate the set definition. Equivalently we could say: $|w|$ is even, $w$ contains at least one 1-symbol, and the first 1-symbol that occurs is in the first half of $w$.
– Peter Leupold
2 days ago
figured it out yesterday by myself, but @PeterLeupold reformulation really helps a lot. thanks!
– ZerataX
2 days ago
add a comment |
Parallelly, try also the pumping lemma.
– Berci
Nov 21 at 17:34
The assignment doesn't say that the PDA needs to be deterministic.
– rici
Nov 21 at 19:11
...although a DPDA does exist, too.
– rici
Nov 21 at 21:13
1
Maybe it helps to reformulate the set definition. Equivalently we could say: $|w|$ is even, $w$ contains at least one 1-symbol, and the first 1-symbol that occurs is in the first half of $w$.
– Peter Leupold
2 days ago
figured it out yesterday by myself, but @PeterLeupold reformulation really helps a lot. thanks!
– ZerataX
2 days ago
Parallelly, try also the pumping lemma.
– Berci
Nov 21 at 17:34
Parallelly, try also the pumping lemma.
– Berci
Nov 21 at 17:34
The assignment doesn't say that the PDA needs to be deterministic.
– rici
Nov 21 at 19:11
The assignment doesn't say that the PDA needs to be deterministic.
– rici
Nov 21 at 19:11
...although a DPDA does exist, too.
– rici
Nov 21 at 21:13
...although a DPDA does exist, too.
– rici
Nov 21 at 21:13
1
1
Maybe it helps to reformulate the set definition. Equivalently we could say: $|w|$ is even, $w$ contains at least one 1-symbol, and the first 1-symbol that occurs is in the first half of $w$.
– Peter Leupold
2 days ago
Maybe it helps to reformulate the set definition. Equivalently we could say: $|w|$ is even, $w$ contains at least one 1-symbol, and the first 1-symbol that occurs is in the first half of $w$.
– Peter Leupold
2 days ago
figured it out yesterday by myself, but @PeterLeupold reformulation really helps a lot. thanks!
– ZerataX
2 days ago
figured it out yesterday by myself, but @PeterLeupold reformulation really helps a lot. thanks!
– ZerataX
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
So this is my solution:
I just stack 1s until I find the first 1-Symbol, then I pop them to see if the first 1 was in the first or second half and then I just make sure that the word is even.
New contributor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
So this is my solution:
I just stack 1s until I find the first 1-Symbol, then I pop them to see if the first 1 was in the first or second half and then I just make sure that the word is even.
New contributor
add a comment |
up vote
1
down vote
accepted
So this is my solution:
I just stack 1s until I find the first 1-Symbol, then I pop them to see if the first 1 was in the first or second half and then I just make sure that the word is even.
New contributor
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
So this is my solution:
I just stack 1s until I find the first 1-Symbol, then I pop them to see if the first 1 was in the first or second half and then I just make sure that the word is even.
New contributor
So this is my solution:
I just stack 1s until I find the first 1-Symbol, then I pop them to see if the first 1 was in the first or second half and then I just make sure that the word is even.
New contributor
edited yesterday
New contributor
answered 2 days ago
ZerataX
164
164
New contributor
New contributor
add a comment |
add a comment |
ZerataX is a new contributor. Be nice, and check out our Code of Conduct.
ZerataX is a new contributor. Be nice, and check out our Code of Conduct.
ZerataX is a new contributor. Be nice, and check out our Code of Conduct.
ZerataX is a new contributor. Be nice, and check out our Code of Conduct.
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%2f3008055%2fpda-symbol-in-first-half%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
Parallelly, try also the pumping lemma.
– Berci
Nov 21 at 17:34
The assignment doesn't say that the PDA needs to be deterministic.
– rici
Nov 21 at 19:11
...although a DPDA does exist, too.
– rici
Nov 21 at 21:13
1
Maybe it helps to reformulate the set definition. Equivalently we could say: $|w|$ is even, $w$ contains at least one 1-symbol, and the first 1-symbol that occurs is in the first half of $w$.
– Peter Leupold
2 days ago
figured it out yesterday by myself, but @PeterLeupold reformulation really helps a lot. thanks!
– ZerataX
2 days ago