Given a transition table do digraph, determine if it is DFA or NFA and build grammar












2












$begingroup$


For the next transition table:



$$begin{array}{|c|c|c|c|}hline&0&1&2\hline a&a&b&d\hline b&a&b&c\hline c&c&d&a\hline d&c&c&a\hlineend{array}\atext{ is initial state}\{a,d}text{ are final states}$$




  1. Make the digraph of the finite automaton and indicate if it is DFA (deterministic) or NDFA (non-deterministic).


  2. Build a regular grammar that generates the language recognized by the automaton and indicate it.






  1. The digraph I made is:


Digraph



where $mathrm{start}=a$, $,s0=b$, $,s1=c$, $,s2=d$ and the states marked with a tick are final states.



The finite state machine (which is an automaton) $A=({a,b,c,d},{0,1,2},delta,a,{a,d})$, where $delta:{a,b,c,d}times{0,1,2}to{a,b,c,d}$ is deterministic because each state has at most one change of state for each letter of the alphabet and there are no state changes for the null word.




  1. A regular $require{cancel}cancel{text{grammar}}text{ expression}$ could be: $$require{cancel}xcancel{begin{align*}L(A)&=0^*\&vee2^*\&vee(220^*2^*)^*\&vee(11^*0)^*\&vee(11^*20^*vee2)^*\&vee(11^*20^*vee(12))^*\&vee(11^*20^*vee1)^*.end{align*}}$$ begin{align*}a&=0^*vee1bvee2dveelambda\b&=1^*vee0avee2c\c&=1dvee2avee0^*\d&=1cvee0cvee2aveelambdaend{align*} and from here I do not know how to build the regular expression and then build the regular grammar (I have seen this and this links but I do not understand them since I could not even get the regular expression) because I have never seen an automaton with $2$ final states!!


Also, the statement what does it mean by indicating the regular grammar?



Everything is correct?



Thanks!



External link:




  1. Automaton created by automatonsimulator.com. You can test it introducing words here.










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    Technically you've given a regular expression, not a regular grammar.
    $endgroup$
    – Math1000
    Dec 25 '18 at 0:09










  • $begingroup$
    @Math1000 oh you are right. Do I have to create the set of productions?
    $endgroup$
    – manooooh
    Dec 25 '18 at 0:21










  • $begingroup$
    I am not sure if $L(A)$ was done correctly because, for example, $12122notin L(A)$ :/.
    $endgroup$
    – manooooh
    Dec 26 '18 at 5:21
















2












$begingroup$


For the next transition table:



$$begin{array}{|c|c|c|c|}hline&0&1&2\hline a&a&b&d\hline b&a&b&c\hline c&c&d&a\hline d&c&c&a\hlineend{array}\atext{ is initial state}\{a,d}text{ are final states}$$




  1. Make the digraph of the finite automaton and indicate if it is DFA (deterministic) or NDFA (non-deterministic).


  2. Build a regular grammar that generates the language recognized by the automaton and indicate it.






  1. The digraph I made is:


Digraph



where $mathrm{start}=a$, $,s0=b$, $,s1=c$, $,s2=d$ and the states marked with a tick are final states.



The finite state machine (which is an automaton) $A=({a,b,c,d},{0,1,2},delta,a,{a,d})$, where $delta:{a,b,c,d}times{0,1,2}to{a,b,c,d}$ is deterministic because each state has at most one change of state for each letter of the alphabet and there are no state changes for the null word.




  1. A regular $require{cancel}cancel{text{grammar}}text{ expression}$ could be: $$require{cancel}xcancel{begin{align*}L(A)&=0^*\&vee2^*\&vee(220^*2^*)^*\&vee(11^*0)^*\&vee(11^*20^*vee2)^*\&vee(11^*20^*vee(12))^*\&vee(11^*20^*vee1)^*.end{align*}}$$ begin{align*}a&=0^*vee1bvee2dveelambda\b&=1^*vee0avee2c\c&=1dvee2avee0^*\d&=1cvee0cvee2aveelambdaend{align*} and from here I do not know how to build the regular expression and then build the regular grammar (I have seen this and this links but I do not understand them since I could not even get the regular expression) because I have never seen an automaton with $2$ final states!!


Also, the statement what does it mean by indicating the regular grammar?



Everything is correct?



Thanks!



External link:




  1. Automaton created by automatonsimulator.com. You can test it introducing words here.










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    Technically you've given a regular expression, not a regular grammar.
    $endgroup$
    – Math1000
    Dec 25 '18 at 0:09










  • $begingroup$
    @Math1000 oh you are right. Do I have to create the set of productions?
    $endgroup$
    – manooooh
    Dec 25 '18 at 0:21










  • $begingroup$
    I am not sure if $L(A)$ was done correctly because, for example, $12122notin L(A)$ :/.
    $endgroup$
    – manooooh
    Dec 26 '18 at 5:21














2












2








2





$begingroup$


For the next transition table:



$$begin{array}{|c|c|c|c|}hline&0&1&2\hline a&a&b&d\hline b&a&b&c\hline c&c&d&a\hline d&c&c&a\hlineend{array}\atext{ is initial state}\{a,d}text{ are final states}$$




  1. Make the digraph of the finite automaton and indicate if it is DFA (deterministic) or NDFA (non-deterministic).


  2. Build a regular grammar that generates the language recognized by the automaton and indicate it.






  1. The digraph I made is:


Digraph



where $mathrm{start}=a$, $,s0=b$, $,s1=c$, $,s2=d$ and the states marked with a tick are final states.



The finite state machine (which is an automaton) $A=({a,b,c,d},{0,1,2},delta,a,{a,d})$, where $delta:{a,b,c,d}times{0,1,2}to{a,b,c,d}$ is deterministic because each state has at most one change of state for each letter of the alphabet and there are no state changes for the null word.




  1. A regular $require{cancel}cancel{text{grammar}}text{ expression}$ could be: $$require{cancel}xcancel{begin{align*}L(A)&=0^*\&vee2^*\&vee(220^*2^*)^*\&vee(11^*0)^*\&vee(11^*20^*vee2)^*\&vee(11^*20^*vee(12))^*\&vee(11^*20^*vee1)^*.end{align*}}$$ begin{align*}a&=0^*vee1bvee2dveelambda\b&=1^*vee0avee2c\c&=1dvee2avee0^*\d&=1cvee0cvee2aveelambdaend{align*} and from here I do not know how to build the regular expression and then build the regular grammar (I have seen this and this links but I do not understand them since I could not even get the regular expression) because I have never seen an automaton with $2$ final states!!


Also, the statement what does it mean by indicating the regular grammar?



Everything is correct?



Thanks!



External link:




  1. Automaton created by automatonsimulator.com. You can test it introducing words here.










share|cite|improve this question











$endgroup$




For the next transition table:



$$begin{array}{|c|c|c|c|}hline&0&1&2\hline a&a&b&d\hline b&a&b&c\hline c&c&d&a\hline d&c&c&a\hlineend{array}\atext{ is initial state}\{a,d}text{ are final states}$$




  1. Make the digraph of the finite automaton and indicate if it is DFA (deterministic) or NDFA (non-deterministic).


  2. Build a regular grammar that generates the language recognized by the automaton and indicate it.






  1. The digraph I made is:


Digraph



where $mathrm{start}=a$, $,s0=b$, $,s1=c$, $,s2=d$ and the states marked with a tick are final states.



The finite state machine (which is an automaton) $A=({a,b,c,d},{0,1,2},delta,a,{a,d})$, where $delta:{a,b,c,d}times{0,1,2}to{a,b,c,d}$ is deterministic because each state has at most one change of state for each letter of the alphabet and there are no state changes for the null word.




  1. A regular $require{cancel}cancel{text{grammar}}text{ expression}$ could be: $$require{cancel}xcancel{begin{align*}L(A)&=0^*\&vee2^*\&vee(220^*2^*)^*\&vee(11^*0)^*\&vee(11^*20^*vee2)^*\&vee(11^*20^*vee(12))^*\&vee(11^*20^*vee1)^*.end{align*}}$$ begin{align*}a&=0^*vee1bvee2dveelambda\b&=1^*vee0avee2c\c&=1dvee2avee0^*\d&=1cvee0cvee2aveelambdaend{align*} and from here I do not know how to build the regular expression and then build the regular grammar (I have seen this and this links but I do not understand them since I could not even get the regular expression) because I have never seen an automaton with $2$ final states!!


Also, the statement what does it mean by indicating the regular grammar?



Everything is correct?



Thanks!



External link:




  1. Automaton created by automatonsimulator.com. You can test it introducing words here.







discrete-mathematics automata regular-language






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 26 '18 at 6:19







manooooh

















asked Dec 24 '18 at 22:53









manoooohmanooooh

6201517




6201517








  • 2




    $begingroup$
    Technically you've given a regular expression, not a regular grammar.
    $endgroup$
    – Math1000
    Dec 25 '18 at 0:09










  • $begingroup$
    @Math1000 oh you are right. Do I have to create the set of productions?
    $endgroup$
    – manooooh
    Dec 25 '18 at 0:21










  • $begingroup$
    I am not sure if $L(A)$ was done correctly because, for example, $12122notin L(A)$ :/.
    $endgroup$
    – manooooh
    Dec 26 '18 at 5:21














  • 2




    $begingroup$
    Technically you've given a regular expression, not a regular grammar.
    $endgroup$
    – Math1000
    Dec 25 '18 at 0:09










  • $begingroup$
    @Math1000 oh you are right. Do I have to create the set of productions?
    $endgroup$
    – manooooh
    Dec 25 '18 at 0:21










  • $begingroup$
    I am not sure if $L(A)$ was done correctly because, for example, $12122notin L(A)$ :/.
    $endgroup$
    – manooooh
    Dec 26 '18 at 5:21








2




2




$begingroup$
Technically you've given a regular expression, not a regular grammar.
$endgroup$
– Math1000
Dec 25 '18 at 0:09




$begingroup$
Technically you've given a regular expression, not a regular grammar.
$endgroup$
– Math1000
Dec 25 '18 at 0:09












$begingroup$
@Math1000 oh you are right. Do I have to create the set of productions?
$endgroup$
– manooooh
Dec 25 '18 at 0:21




$begingroup$
@Math1000 oh you are right. Do I have to create the set of productions?
$endgroup$
– manooooh
Dec 25 '18 at 0:21












$begingroup$
I am not sure if $L(A)$ was done correctly because, for example, $12122notin L(A)$ :/.
$endgroup$
– manooooh
Dec 26 '18 at 5:21




$begingroup$
I am not sure if $L(A)$ was done correctly because, for example, $12122notin L(A)$ :/.
$endgroup$
– manooooh
Dec 26 '18 at 5:21










2 Answers
2






active

oldest

votes


















1





+50







$begingroup$

At the time of writing this, the crossed out answer in the question is a regular expression, but your new answer is almost the correct regular grammar! (almost because production rules should not have Kleene star, unlike as you wrote in $a=0^* ...$) Using your notation, a full specification/"indication" of the regular grammar should be the following:




  • Terminal Symbols: $0,1,2$

  • Non-terminal Symbols: $a,b,c,d$

  • Production Rules (incomplete; please fill-in):


$$begin{align*}a&rightarrow0avee1bvee2dveelambda\b&rightarrow 1bvee0avee2c\c&rightarrow ...\d&rightarrow ...end{align*}$$




  • Start Symbol: $a$


Edit: Now I see that the "indicating it" part of question #2 is confusing. Unless "indicating" is formally defined in your class (very unlikely), I think the better thing to do in case something like this happened in exam is to ask the examiner for clarification (e.g. "Does indicate mean to show the tuple?").



On my comment about "if I were to take the exam", treat it as "according to my own understanding of the question" and as I understand question #2, indicating the grammar just means complete specification of the 4-tuple.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:29












  • $begingroup$
    As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:30






  • 1




    $begingroup$
    Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 20:00










  • $begingroup$
    Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
    $endgroup$
    – manooooh
    Dec 28 '18 at 20:21








  • 1




    $begingroup$
    The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
    $endgroup$
    – Poypoyan
    Dec 29 '18 at 8:08



















2












$begingroup$

Using FSM2Regex, I encoded your transition table:



#states
a
b
c
d
#initial
a
#accepting
a
d
#alphabet
0
1
2
#transitions
a:0>a
b:0>a
c:2>a
d:2>a
a:1>b
b:1>b
b:2>c
c:0>c
d:0>c
d:1>c
a:2>d
c:1>d


The resulting state transition graph:



enter image description here



And the generated regular expression:



2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+(0+$+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))(0+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))*(2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+0+$)+0+$


In FSM2Regex syntax, a valid regex consists of alphanumeric characters representing the set of input symbols (here 0, 1, 2), the $ character representing the empty string, the choice operator +, the Kleene operator *, and parentheses ( and ).



The state machine is deterministic. There are no ambiguous state transitions where the machine has a choice which state to assume next.



See here for a definition of a regular grammar. Note that a grammar and a regular expression possibly can be converted to each other but are different concepts.



To derive a regular expression, several algorithms or visual methods exist. See this post for a detailed explanation. Basically, internal (= non-initial and non-final) states are removed step-by-step. Result is a state transition diagram or table with only the initial and one or more final states. The transition condition from initial to a final state is the regular expression.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
    $endgroup$
    – manooooh
    Dec 27 '18 at 17:42






  • 1




    $begingroup$
    For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 14:27












  • $begingroup$
    I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:53












  • $begingroup$
    I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:54










  • $begingroup$
    I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:07











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3051700%2fgiven-a-transition-table-do-digraph-determine-if-it-is-dfa-or-nfa-and-build-gra%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1





+50







$begingroup$

At the time of writing this, the crossed out answer in the question is a regular expression, but your new answer is almost the correct regular grammar! (almost because production rules should not have Kleene star, unlike as you wrote in $a=0^* ...$) Using your notation, a full specification/"indication" of the regular grammar should be the following:




  • Terminal Symbols: $0,1,2$

  • Non-terminal Symbols: $a,b,c,d$

  • Production Rules (incomplete; please fill-in):


$$begin{align*}a&rightarrow0avee1bvee2dveelambda\b&rightarrow 1bvee0avee2c\c&rightarrow ...\d&rightarrow ...end{align*}$$




  • Start Symbol: $a$


Edit: Now I see that the "indicating it" part of question #2 is confusing. Unless "indicating" is formally defined in your class (very unlikely), I think the better thing to do in case something like this happened in exam is to ask the examiner for clarification (e.g. "Does indicate mean to show the tuple?").



On my comment about "if I were to take the exam", treat it as "according to my own understanding of the question" and as I understand question #2, indicating the grammar just means complete specification of the 4-tuple.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:29












  • $begingroup$
    As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:30






  • 1




    $begingroup$
    Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 20:00










  • $begingroup$
    Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
    $endgroup$
    – manooooh
    Dec 28 '18 at 20:21








  • 1




    $begingroup$
    The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
    $endgroup$
    – Poypoyan
    Dec 29 '18 at 8:08
















1





+50







$begingroup$

At the time of writing this, the crossed out answer in the question is a regular expression, but your new answer is almost the correct regular grammar! (almost because production rules should not have Kleene star, unlike as you wrote in $a=0^* ...$) Using your notation, a full specification/"indication" of the regular grammar should be the following:




  • Terminal Symbols: $0,1,2$

  • Non-terminal Symbols: $a,b,c,d$

  • Production Rules (incomplete; please fill-in):


$$begin{align*}a&rightarrow0avee1bvee2dveelambda\b&rightarrow 1bvee0avee2c\c&rightarrow ...\d&rightarrow ...end{align*}$$




  • Start Symbol: $a$


Edit: Now I see that the "indicating it" part of question #2 is confusing. Unless "indicating" is formally defined in your class (very unlikely), I think the better thing to do in case something like this happened in exam is to ask the examiner for clarification (e.g. "Does indicate mean to show the tuple?").



On my comment about "if I were to take the exam", treat it as "according to my own understanding of the question" and as I understand question #2, indicating the grammar just means complete specification of the 4-tuple.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:29












  • $begingroup$
    As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:30






  • 1




    $begingroup$
    Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 20:00










  • $begingroup$
    Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
    $endgroup$
    – manooooh
    Dec 28 '18 at 20:21








  • 1




    $begingroup$
    The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
    $endgroup$
    – Poypoyan
    Dec 29 '18 at 8:08














1





+50







1





+50



1




+50



$begingroup$

At the time of writing this, the crossed out answer in the question is a regular expression, but your new answer is almost the correct regular grammar! (almost because production rules should not have Kleene star, unlike as you wrote in $a=0^* ...$) Using your notation, a full specification/"indication" of the regular grammar should be the following:




  • Terminal Symbols: $0,1,2$

  • Non-terminal Symbols: $a,b,c,d$

  • Production Rules (incomplete; please fill-in):


$$begin{align*}a&rightarrow0avee1bvee2dveelambda\b&rightarrow 1bvee0avee2c\c&rightarrow ...\d&rightarrow ...end{align*}$$




  • Start Symbol: $a$


Edit: Now I see that the "indicating it" part of question #2 is confusing. Unless "indicating" is formally defined in your class (very unlikely), I think the better thing to do in case something like this happened in exam is to ask the examiner for clarification (e.g. "Does indicate mean to show the tuple?").



On my comment about "if I were to take the exam", treat it as "according to my own understanding of the question" and as I understand question #2, indicating the grammar just means complete specification of the 4-tuple.






share|cite|improve this answer











$endgroup$



At the time of writing this, the crossed out answer in the question is a regular expression, but your new answer is almost the correct regular grammar! (almost because production rules should not have Kleene star, unlike as you wrote in $a=0^* ...$) Using your notation, a full specification/"indication" of the regular grammar should be the following:




  • Terminal Symbols: $0,1,2$

  • Non-terminal Symbols: $a,b,c,d$

  • Production Rules (incomplete; please fill-in):


$$begin{align*}a&rightarrow0avee1bvee2dveelambda\b&rightarrow 1bvee0avee2c\c&rightarrow ...\d&rightarrow ...end{align*}$$




  • Start Symbol: $a$


Edit: Now I see that the "indicating it" part of question #2 is confusing. Unless "indicating" is formally defined in your class (very unlikely), I think the better thing to do in case something like this happened in exam is to ask the examiner for clarification (e.g. "Does indicate mean to show the tuple?").



On my comment about "if I were to take the exam", treat it as "according to my own understanding of the question" and as I understand question #2, indicating the grammar just means complete specification of the 4-tuple.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Dec 29 '18 at 7:59

























answered Dec 28 '18 at 19:18









PoypoyanPoypoyan

483411




483411












  • $begingroup$
    Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:29












  • $begingroup$
    As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:30






  • 1




    $begingroup$
    Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 20:00










  • $begingroup$
    Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
    $endgroup$
    – manooooh
    Dec 28 '18 at 20:21








  • 1




    $begingroup$
    The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
    $endgroup$
    – Poypoyan
    Dec 29 '18 at 8:08


















  • $begingroup$
    Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:29












  • $begingroup$
    As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:30






  • 1




    $begingroup$
    Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 20:00










  • $begingroup$
    Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
    $endgroup$
    – manooooh
    Dec 28 '18 at 20:21








  • 1




    $begingroup$
    The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
    $endgroup$
    – Poypoyan
    Dec 29 '18 at 8:08
















$begingroup$
Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
$endgroup$
– manooooh
Dec 28 '18 at 19:29






$begingroup$
Thanks for the answer! Please look at this comment. That is how they defined me to build a regular grammar from a DFA. As you can see, a grammar $G$ is a $4$-tuple. Do you think that just by mentioning the productions the section b) is solved, or on the contrary, we have to also mention the language generated by $G$ i.e. $ L(G)$ (which is probably very long)?
$endgroup$
– manooooh
Dec 28 '18 at 19:29














$begingroup$
As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
$endgroup$
– manooooh
Dec 28 '18 at 19:30




$begingroup$
As an example, a language generated by a grammar could be $L(G)={0^j1^k(0^l1^m)^r,j,k,mgeq1,rgeq0}$. Just so you know how I should write the set $L(G)$ of our case.
$endgroup$
– manooooh
Dec 28 '18 at 19:30




1




1




$begingroup$
Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
$endgroup$
– Poypoyan
Dec 28 '18 at 20:00




$begingroup$
Oh! Now I am also confused by that indicating it part... But if I were to take the exam, I will not specify the explicit language as a set anymore, because the regular grammar (and actually the FSA) already represents a certain regular language.
$endgroup$
– Poypoyan
Dec 28 '18 at 20:00












$begingroup$
Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
$endgroup$
– manooooh
Dec 28 '18 at 20:21






$begingroup$
Ok. Please let's recap: a) The digraph is the image that we already know is fine, and also the finite automaton is deterministic. b) To build a regular grammar, we have to consider the $4$-tuple $G=({a,b,c,d},{0,1,2},P,{a,d})$, where $P$ is given by $$P:begin{cases}ato0a/1b/2d/lambda\bto0a/1b/2c\cto2a/0c/1d\dto0c/1c/2a/lambda,end{cases}$$ and we have already indicated the regular grammar. Do you think that is the correct answer?
$endgroup$
– manooooh
Dec 28 '18 at 20:21






1




1




$begingroup$
The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
$endgroup$
– Poypoyan
Dec 29 '18 at 8:08




$begingroup$
The start symbol should only be $a$, not ${a,d}$. Also, see my edit on my answer.
$endgroup$
– Poypoyan
Dec 29 '18 at 8:08











2












$begingroup$

Using FSM2Regex, I encoded your transition table:



#states
a
b
c
d
#initial
a
#accepting
a
d
#alphabet
0
1
2
#transitions
a:0>a
b:0>a
c:2>a
d:2>a
a:1>b
b:1>b
b:2>c
c:0>c
d:0>c
d:1>c
a:2>d
c:1>d


The resulting state transition graph:



enter image description here



And the generated regular expression:



2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+(0+$+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))(0+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))*(2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+0+$)+0+$


In FSM2Regex syntax, a valid regex consists of alphanumeric characters representing the set of input symbols (here 0, 1, 2), the $ character representing the empty string, the choice operator +, the Kleene operator *, and parentheses ( and ).



The state machine is deterministic. There are no ambiguous state transitions where the machine has a choice which state to assume next.



See here for a definition of a regular grammar. Note that a grammar and a regular expression possibly can be converted to each other but are different concepts.



To derive a regular expression, several algorithms or visual methods exist. See this post for a detailed explanation. Basically, internal (= non-initial and non-final) states are removed step-by-step. Result is a state transition diagram or table with only the initial and one or more final states. The transition condition from initial to a final state is the regular expression.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
    $endgroup$
    – manooooh
    Dec 27 '18 at 17:42






  • 1




    $begingroup$
    For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 14:27












  • $begingroup$
    I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:53












  • $begingroup$
    I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:54










  • $begingroup$
    I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:07
















2












$begingroup$

Using FSM2Regex, I encoded your transition table:



#states
a
b
c
d
#initial
a
#accepting
a
d
#alphabet
0
1
2
#transitions
a:0>a
b:0>a
c:2>a
d:2>a
a:1>b
b:1>b
b:2>c
c:0>c
d:0>c
d:1>c
a:2>d
c:1>d


The resulting state transition graph:



enter image description here



And the generated regular expression:



2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+(0+$+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))(0+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))*(2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+0+$)+0+$


In FSM2Regex syntax, a valid regex consists of alphanumeric characters representing the set of input symbols (here 0, 1, 2), the $ character representing the empty string, the choice operator +, the Kleene operator *, and parentheses ( and ).



The state machine is deterministic. There are no ambiguous state transitions where the machine has a choice which state to assume next.



See here for a definition of a regular grammar. Note that a grammar and a regular expression possibly can be converted to each other but are different concepts.



To derive a regular expression, several algorithms or visual methods exist. See this post for a detailed explanation. Basically, internal (= non-initial and non-final) states are removed step-by-step. Result is a state transition diagram or table with only the initial and one or more final states. The transition condition from initial to a final state is the regular expression.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
    $endgroup$
    – manooooh
    Dec 27 '18 at 17:42






  • 1




    $begingroup$
    For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 14:27












  • $begingroup$
    I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:53












  • $begingroup$
    I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:54










  • $begingroup$
    I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:07














2












2








2





$begingroup$

Using FSM2Regex, I encoded your transition table:



#states
a
b
c
d
#initial
a
#accepting
a
d
#alphabet
0
1
2
#transitions
a:0>a
b:0>a
c:2>a
d:2>a
a:1>b
b:1>b
b:2>c
c:0>c
d:0>c
d:1>c
a:2>d
c:1>d


The resulting state transition graph:



enter image description here



And the generated regular expression:



2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+(0+$+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))(0+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))*(2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+0+$)+0+$


In FSM2Regex syntax, a valid regex consists of alphanumeric characters representing the set of input symbols (here 0, 1, 2), the $ character representing the empty string, the choice operator +, the Kleene operator *, and parentheses ( and ).



The state machine is deterministic. There are no ambiguous state transitions where the machine has a choice which state to assume next.



See here for a definition of a regular grammar. Note that a grammar and a regular expression possibly can be converted to each other but are different concepts.



To derive a regular expression, several algorithms or visual methods exist. See this post for a detailed explanation. Basically, internal (= non-initial and non-final) states are removed step-by-step. Result is a state transition diagram or table with only the initial and one or more final states. The transition condition from initial to a final state is the regular expression.






share|cite|improve this answer











$endgroup$



Using FSM2Regex, I encoded your transition table:



#states
a
b
c
d
#initial
a
#accepting
a
d
#alphabet
0
1
2
#transitions
a:0>a
b:0>a
c:2>a
d:2>a
a:1>b
b:1>b
b:2>c
c:0>c
d:0>c
d:1>c
a:2>d
c:1>d


The resulting state transition graph:



enter image description here



And the generated regular expression:



2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+(0+$+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))(0+2(2+(0+1)(0+1(0+1))*(2+12))+11*(0+2(0+1(0+1))*(2+12)))*(2+2((0+1)(0+1(0+1))*(1+2+12)+2)+11*(2(0+1(0+1))*(1+2+12)+0)+0+$)+0+$


In FSM2Regex syntax, a valid regex consists of alphanumeric characters representing the set of input symbols (here 0, 1, 2), the $ character representing the empty string, the choice operator +, the Kleene operator *, and parentheses ( and ).



The state machine is deterministic. There are no ambiguous state transitions where the machine has a choice which state to assume next.



See here for a definition of a regular grammar. Note that a grammar and a regular expression possibly can be converted to each other but are different concepts.



To derive a regular expression, several algorithms or visual methods exist. See this post for a detailed explanation. Basically, internal (= non-initial and non-final) states are removed step-by-step. Result is a state transition diagram or table with only the initial and one or more final states. The transition condition from initial to a final state is the regular expression.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Dec 28 '18 at 11:46

























answered Dec 27 '18 at 13:09









Axel KemperAxel Kemper

3,33611418




3,33611418












  • $begingroup$
    Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
    $endgroup$
    – manooooh
    Dec 27 '18 at 17:42






  • 1




    $begingroup$
    For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 14:27












  • $begingroup$
    I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:53












  • $begingroup$
    I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:54










  • $begingroup$
    I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:07


















  • $begingroup$
    Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
    $endgroup$
    – manooooh
    Dec 27 '18 at 17:42






  • 1




    $begingroup$
    For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
    $endgroup$
    – Poypoyan
    Dec 28 '18 at 14:27












  • $begingroup$
    I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:53












  • $begingroup$
    I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
    $endgroup$
    – manooooh
    Dec 28 '18 at 18:54










  • $begingroup$
    I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
    $endgroup$
    – manooooh
    Dec 28 '18 at 19:07
















$begingroup$
Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
$endgroup$
– manooooh
Dec 27 '18 at 17:42




$begingroup$
Thanks!! I see that we agree with the digraph (nice!). I would like to know 1) how to get to the regular expression, 2) what rules should be used to build the regular grammar, which is what the second section asks for, and 3) once done 2), what does "indicate the grammar" mean?
$endgroup$
– manooooh
Dec 27 '18 at 17:42




1




1




$begingroup$
For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
$endgroup$
– Poypoyan
Dec 28 '18 at 14:27






$begingroup$
For your question 3), I guess "indicate the grammar" simply means to list your final answer (which is the set of production rules), after you build it.
$endgroup$
– Poypoyan
Dec 28 '18 at 14:27














$begingroup$
I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
$endgroup$
– manooooh
Dec 28 '18 at 18:53






$begingroup$
I have read the section of a book that I have and it says the following: Construction of a regular grammar from a deterministic finite automaton. Given the deterministic finite automaton $A=(Q,V,delta,q,F)$, to construct the regular grammar $G=(V_n,V_t,P,s)$ that generates the regular language $L(G)$ such that $L(G)=L(A)$ is produced in the following way: i) $V_n=Q$, ii) $V_t=V$, iii) $s=q$, and the productions of $P$ are given by: i) $pto adelta(p,a)$, ii) $ptolambdatext{ if }pin F$.
$endgroup$
– manooooh
Dec 28 '18 at 18:53














$begingroup$
I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
$endgroup$
– manooooh
Dec 28 '18 at 18:54




$begingroup$
I would like to know if instead of finding the regular expression and then using the regular language, you can do the productions (the transitions that you used) to then generate the grammar and thus its language. What method do you think is most confusing?
$endgroup$
– manooooh
Dec 28 '18 at 18:54












$begingroup$
I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
$endgroup$
– manooooh
Dec 28 '18 at 19:07




$begingroup$
I ask because the regular expression is very extensive, which makes it very difficult (at least for me) to reach the regular grammar. If you prefer not to answer the message that is above this is fine. Actually this is an examination exercise, there must be some typing error because nobody could dedicate as much time to a single exercise as this in an exam...
$endgroup$
– manooooh
Dec 28 '18 at 19:07


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3051700%2fgiven-a-transition-table-do-digraph-determine-if-it-is-dfa-or-nfa-and-build-gra%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Ellipse (mathématiques)

Quarter-circle Tiles

Mont Emei