regular-language

Is a*b* regular?

对着背影说爱祢 提交于 2019-11-26 20:58:32
I know a n b n for n > 0 is not regular by the pumping lemma but I would imagine a*b* to be regular since both a,b don't have to be the same length. Is there a proof for it being regular or not? Grijesh Chauhan Answer to your question: imagine a*b* to be regular, Is there a proof for it being regular or not? No need to imagine, expression a*b* is called r egular e xpression (re), and regular expressions are possible only for regular languages. If a language is not a regular then regular expression is also not possible for that and if a language is regular language then we can always represent

What will be the DFA for the regular expression 0(0+1)*0+1(0+1)*1?

♀尐吖头ヾ 提交于 2019-11-26 18:36:37
问题 This is the DFA i have drawn- Is it correct? I am confused because q4 state has 2 different transitions for same input symbol which violates the rule of DFA , but I can't think of any other solution. 回答1: Your DFA is not correct. your DFA is completely wrong so I don't comment DFA for RE: 0(1 + 0)*0 + 1(1 + 0)*1 Language Description : if string start with 0 it should end with 0 or if string start with 1 it should end with 1 . hence two final states (state-5, state-4). state-4 : accepts 1(1 +

Pumping lemma for regular language

倖福魔咒の 提交于 2019-11-26 17:49:44
问题 I have a little confusion in checking whether the given language is regular or not using pumping lemma. Suppose we have to check whether: L. The language accepting even number of 0 's in regular or not? We know that it is regular because we can construct a DFA for L. But I want to prove this with pumping lemma. Now suppose, I take a String w= "0000" : Now will divide the string as x = 0 , y = 0 , and z = 00 . Now on applying pumping lemma for i = 2 , I will get the string "00000" , which is

Why is {a^nb^n | n >= 0} not regular?

左心房为你撑大大i 提交于 2019-11-26 16:59:36
问题 In a CS course I'm taking there is an example of a language that is not regular: {a^nb^n | n >= 0} I can understand that it is not regular since no Finite State Automaton/Machine can be written that validates and accepts this input since it lacks a memory component. (Please correct me if I'm wrong) The wikipedia entry on Regular Language also lists this example, but does not provide a (mathematical) proof why it is not regular. Can anyone enlighten me on this and provide proof for this, or

Left-Linear and Right-Linear Grammars

南楼画角 提交于 2019-11-26 14:14:35
I need help with constructing a left-linear and right-linear grammar for the languages below? a) (0+1)*00(0+1)* b) 0*(1(0+1))* c) (((01+10)*11)*00)* For a) I have the following: Left-linear S --> B00 | S11 B --> B0|B1|011 Right-linear S --> 00B | 11S B --> 0B|1B|0|1 Is this correct? I need help with b & c. Constructing an equivalent Regular Grammar from a Regular Expression First, I start with some simple rules to construct Regular Grammar(RG) from Regular Expression(RE). I am writing rules for Right Linear Grammar (leaving as an exercise to write similar rules for Left Linear Grammar) NOTE:

Need Regular Expression for Finite Automata: Even number of 1s and Even number of 0s

点点圈 提交于 2019-11-26 09:34:19
问题 My problem may sounds different to you. I am a beginner and I am learning Finite Automata. I am googing over Internet to find the Regular Expression for Finite Automata of Given Machine Below. Can anyone help me to write \"Regular Expression for Finite Automata\" of above machine Any help will be appreciated 回答1: How to write regular expression for a DFA using Arden theorem Lets instead of language symbols 0 , 1 we take Σ = {a, b} and following is new DFA. Notice start state is Q 0 You have

Finding the complement of a DFA?

巧了我就是萌 提交于 2019-11-26 08:13:30
问题 I am asked to show DFA diagram and RegEx for the complement of the RegEx (00 + 1)* . In the previous problem I had to prove that the complement of a DFA is closed and is a regular expression also, so I know that to convert a DFA, M to the complement, M`, I just need to swap the initial accepting states and final accepting states. However, it appears that the initial accepting states for the RegEx are {00, 1, ^} and the final accepting states are {00, 1, ^} as well. So swapping them will just

Left-Linear and Right-Linear Grammars

天涯浪子 提交于 2019-11-26 03:49:27
问题 I need help with constructing a left-linear and right-linear grammar for the languages below? a) (0+1)*00(0+1)* b) 0*(1(0+1))* c) (((01+10)*11)*00)* For a) I have the following: Left-linear S --> B00 | S11 B --> B0|B1|011 Right-linear S --> 00B | 11S B --> 0B|1B|0|1 Is this correct? I need help with b & c. 回答1: Constructing an equivalent Regular Grammar from a Regular Expression First, I start with some simple rules to construct Regular Grammar(RG) from Regular Expression(RE). I am writing