Let $L_4$ be the language over alphabet ${0, 1}$ defined by $L_3 = {x : #_1(x) = 2 cdot #_{10}(x)}$ design...
up vote
0
down vote
favorite
Let $L_4$ be the language over alphabet ${0, 1}$ defined by
$L_4 = {x : #_1(x) = 2 cdot #_{10}(x)}$
Here is a design for a PDA that accepts $L_4$. See diagram below, where we use e to donote $epsilon$
-For a string $x$, we use k to stand for the quantity $#_1(x) - 2 cdot#_{10}(x)$
-If $k = 0$, then the stack should be empty
-If $k neq 0$, then the stack should have a $Y$ at the bottom and $|k| - 1$ Xs on top.
-$q_0, q_1$ are for $x$ where $k = 0$. $q_0$ is for $x$ that does not end with 1. $q_1$ is for $x$ that ends with $1.$
-$q_2, q_3, q_4$ are for $x$ where $k > 0$. $q_2$ is for $x$ that ends with $1.$ $q_3$ is an extra state to sllow for popping 2 items off the stack. $q_4$ is for x that ends with $0$.
$q_5, q_6, q_7$ are for x where $k < 0$. $q_5$ is for x that ends with $0$. $q_6$ is an extra state to allow for pushing 2 items on the stack. $q_7$ is for x that ends with $1$.
Complete the PDA by adding appropiate transitions. To help you get started initial state is indicated some transitions are given, and accepting states are indicated by double parentheses.
My attempt:
Not sure how to really go about this. I tried to satisfy very easy cases like the empty string is already accepted. 101 is accepted. But keep ending up stuck because I need to have k-1 x's
formal-languages
add a comment |
up vote
0
down vote
favorite
Let $L_4$ be the language over alphabet ${0, 1}$ defined by
$L_4 = {x : #_1(x) = 2 cdot #_{10}(x)}$
Here is a design for a PDA that accepts $L_4$. See diagram below, where we use e to donote $epsilon$
-For a string $x$, we use k to stand for the quantity $#_1(x) - 2 cdot#_{10}(x)$
-If $k = 0$, then the stack should be empty
-If $k neq 0$, then the stack should have a $Y$ at the bottom and $|k| - 1$ Xs on top.
-$q_0, q_1$ are for $x$ where $k = 0$. $q_0$ is for $x$ that does not end with 1. $q_1$ is for $x$ that ends with $1.$
-$q_2, q_3, q_4$ are for $x$ where $k > 0$. $q_2$ is for $x$ that ends with $1.$ $q_3$ is an extra state to sllow for popping 2 items off the stack. $q_4$ is for x that ends with $0$.
$q_5, q_6, q_7$ are for x where $k < 0$. $q_5$ is for x that ends with $0$. $q_6$ is an extra state to allow for pushing 2 items on the stack. $q_7$ is for x that ends with $1$.
Complete the PDA by adding appropiate transitions. To help you get started initial state is indicated some transitions are given, and accepting states are indicated by double parentheses.
My attempt:
Not sure how to really go about this. I tried to satisfy very easy cases like the empty string is already accepted. 101 is accepted. But keep ending up stuck because I need to have k-1 x's
formal-languages
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Let $L_4$ be the language over alphabet ${0, 1}$ defined by
$L_4 = {x : #_1(x) = 2 cdot #_{10}(x)}$
Here is a design for a PDA that accepts $L_4$. See diagram below, where we use e to donote $epsilon$
-For a string $x$, we use k to stand for the quantity $#_1(x) - 2 cdot#_{10}(x)$
-If $k = 0$, then the stack should be empty
-If $k neq 0$, then the stack should have a $Y$ at the bottom and $|k| - 1$ Xs on top.
-$q_0, q_1$ are for $x$ where $k = 0$. $q_0$ is for $x$ that does not end with 1. $q_1$ is for $x$ that ends with $1.$
-$q_2, q_3, q_4$ are for $x$ where $k > 0$. $q_2$ is for $x$ that ends with $1.$ $q_3$ is an extra state to sllow for popping 2 items off the stack. $q_4$ is for x that ends with $0$.
$q_5, q_6, q_7$ are for x where $k < 0$. $q_5$ is for x that ends with $0$. $q_6$ is an extra state to allow for pushing 2 items on the stack. $q_7$ is for x that ends with $1$.
Complete the PDA by adding appropiate transitions. To help you get started initial state is indicated some transitions are given, and accepting states are indicated by double parentheses.
My attempt:
Not sure how to really go about this. I tried to satisfy very easy cases like the empty string is already accepted. 101 is accepted. But keep ending up stuck because I need to have k-1 x's
formal-languages
Let $L_4$ be the language over alphabet ${0, 1}$ defined by
$L_4 = {x : #_1(x) = 2 cdot #_{10}(x)}$
Here is a design for a PDA that accepts $L_4$. See diagram below, where we use e to donote $epsilon$
-For a string $x$, we use k to stand for the quantity $#_1(x) - 2 cdot#_{10}(x)$
-If $k = 0$, then the stack should be empty
-If $k neq 0$, then the stack should have a $Y$ at the bottom and $|k| - 1$ Xs on top.
-$q_0, q_1$ are for $x$ where $k = 0$. $q_0$ is for $x$ that does not end with 1. $q_1$ is for $x$ that ends with $1.$
-$q_2, q_3, q_4$ are for $x$ where $k > 0$. $q_2$ is for $x$ that ends with $1.$ $q_3$ is an extra state to sllow for popping 2 items off the stack. $q_4$ is for x that ends with $0$.
$q_5, q_6, q_7$ are for x where $k < 0$. $q_5$ is for x that ends with $0$. $q_6$ is an extra state to allow for pushing 2 items on the stack. $q_7$ is for x that ends with $1$.
Complete the PDA by adding appropiate transitions. To help you get started initial state is indicated some transitions are given, and accepting states are indicated by double parentheses.
My attempt:
Not sure how to really go about this. I tried to satisfy very easy cases like the empty string is already accepted. 101 is accepted. But keep ending up stuck because I need to have k-1 x's
formal-languages
formal-languages
asked yesterday
Tree Garen
31519
31519
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2996400%2flet-l-4-be-the-language-over-alphabet-0-1-defined-by-l-3-x-1%23new-answer', 'question_page');
}
);
Post as a guest
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
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
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