Question: Assignment 3 : 1 . 8 Give regular expressions generating the languages of a . { w | wbegins with a 1 and ends with

Assignment 3:
1.8 Give regular expressions generating the languages of
a.{w|wbegins with a1and ends with a0}
b.{w|wcontains at least three 1s}
c.{w|wcontains the substring0101(i.e., w=x0101yfor some x and y)}
g.{w|the length of wis at most 5}
i.{w | every odd position of w is a1}
l.{w | w contains an even number of 0s, or contains exactly two1s}
1.19 Use the procedure described in Lemma 1.55: If a language is described by a regular expression, then it is regular. PROOF IDEA: Say that we have a regular expression R describing some language A. We show how to convert R into an NFA recognizing A. By Corollary 1.40, if an NFA recognizes Athen A is regular. to convert the following regular expressions to nondeterministic finite automata.
a.(0\cup 1)000(0\cup 1)
b.(((00)(11))\cup 01)
c.
Outline:
from automata.fa.nfa import NFA
example_nfa = NFA(
states={'q0','q1','q2'},
input_symbols={'0','1'},
transitions={
'q0': {'': {'q1','q2'}},
'q1': {'0': {'q1'},'1': {'q2'}},
'q2': {'0': {'q1'},'1': {'q2'}}
},
initial_state='q0',
final_states={'q1'}
)
example_nfa_regex ="(1*0)?(11*0|0)*"
prob_1_18a =""
prob_1_18b =""
prob_1_18c =""
prob_1_18g =""
prob_1_18i =""
prob_1_18l =""
# prob_1_19a = NFA(
#
# )
# prob_1_19b = NFA(
#
# )
# prob_1_19c = NFA(
#
# )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!