Question: Assignment 3 : 1 . 8 Give regular expressions generating the languages of a . { w | wbegins with a 1 and ends with
Assignment :
Give regular expressions generating the languages of
awwbegins with aand ends with a
bwwcontains at least three s
cwwcontains the substringie wxyfor some x and y
gwthe length of wis at most
iw every odd position of w is a
lw w contains an even number of s or contains exactly twos
Use the procedure described in Lemma : 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 if an NFA recognizes Athen A is regular. to convert the following regular expressions to nondeterministic finite automata.
acup cup
bcup
c
Outline:
from automata.fanfa import NFA
examplenfa NFA
statesqqq
inputsymbols
transitions
q: : qq
q: : q: q
q: : q: q
initialstateq
finalstatesq
examplenfaregex
proba
probb
probc
probg
probi
probl
# proba NFA
#
#
# probb NFA
#
#
# probc NFA
#
#
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
