Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a X e- C Secure I h ps://us encs concordia ca ers grahne/o comp335/assign Apps R

ID: 3787124 • Letter: A

Question

a X e- C Secure I h ps://us encs concordia ca ers grahne/o comp335/assign Apps R Facebook D operating system Cor r COMP 335 Introd D Introduction To Auto G internship computers Programming problen P Perfect Resume Builde D sec71.70pdf A Dr. Aiman Hanna De assgn1.pdf for any state a and strings r and y. Hint: Perform an induction on ly 3. Construct an NFA for the set of strings over alphabet (a,b, c that have a substring of length 3 containing each of the symbols in any order 4. Let L tw E 10, at least one of the last two positions of w is a 1 (a) Give an NFA that accepts L. (b) Construct a DFA equivalent to your NFA of (a) 5. Consider the following NFA A t 3119081.0 pd a cover letter pdf n Ana ConnectPa mp4 A Show all X assgn1.pdf Silberschatz 9th e...pp 40 ENG 2 PM 410 US 2017-01-24 O Ask me anything

Explanation / Answer

Note that we have a tendency to unseen a number of the states (e.g., ) in P(Q) from our diagram of the
DFA M since they're not accessible from the beginning state . Also, we have a tendency to had to feature
an arc from state to itself labeled with “a, b” in order that this state has associate arc deed it
corresponding to every image within the alphabet , that could be a demand for any DFA.
The rule given within the notes associated textbook can continually properly construct an
equivalent DFA from a given NFA, however we have a tendency to don’t continually have to be compelled to bear all the
steps of the rule to get the same DFA. as an example, on this downside, we
begin by working out what states the NFA may be in while not reading any symbols. In
this case, this can be E() = since one is that the beginning state of the NFA, and the
NFA will jump from one to two while not reading any symbols by taking the -transition.
Thus, we have a tendency to 1st produce a DFA state akin to the set :

The state is that the begin state of the DFA since {this is|this is often|this may be} wherever the NFA can be
without reading any symbols. The state is additionally associate acceptive state for the DFA
since it contains two, that is acceptive for the NFA.
Now for DFA state , confirm wherever the NFA will prolong associate a from every NFA
state among this DFA state, and wherever the NFA will prolong a b from every NFA state
within this DFA state. On an a, the NFA will go from state one to state 3; additionally, the
NFA will go from state two to one, so it can also go beyond one to two on the .
So from NFA states one and a pair of on associate a, the NFA will find yourself in states one, 2, and 3, so
draw a transition within the DFA from state to a replacement state , that is associate
accepting state since it contains two F:
4

a
Similarly, to work out wherever the DFA moves on b from DFA state , determine
all the probabilities of wherever the NFA will go from NFA states one and a pair of on b. From
state 1, the NFA can’t go anyplace on a b; additionally, the NFA can’t go anyplace from
state two on b. Thus, the NFA can’t go anyplace from states two and three on a b, so we add
a b-edge within the DFA from state to a replacement DFA state , that isn't acceptive
since it contains no settle for states of the NFA:

a
b
Now anytime we have a tendency to add a replacement DFA state, we've got to work out all the probabilities of
where the NFA will prolong associate a from every NFA state among that DFA state, and where
the NFA will prolong a b from every NFA state among that DFA state. For DFA state
, we have a tendency to next confirm wherever the NFA will prolong associate a from every of the NFA
states 1, 2 and 3. From NFA state one, the NFA on associate a will head to NFA state 3; from
NFA state two, the NFA on associate a will head to NFA state one, so it may any
jump to two on ; from NFA state three, the NFA on associate a will head to NFA state two. Thus, if
the NFA is in states one, 2 and 3, it will prolong associate a to states one, 2 and 3, thus we have a tendency to raise
the DFA associate a-edge from to .

a
b
a
Now we have a tendency to confirm wherever the b-edge from DFA state goes to. To do this,
we examine what happens to the NFA from states one, two and three on a b. If the NFA is
in state 1, then there's obscurity to travel on a b; if the NFA is in state two, then there's
nowhere to travel on a b; if the NFA is in state three, then the NFA will head to two or three on b.
Hence, if the NFA is in states one, 2 and 3, the NFA on b will finish in states two and three.
Thus, in the DFA, draw a grip from state to a replacement state , which is
accepting since it contains two F:
5


a
b
b
a
Now do a similar for DFA states and . If any new DFA states arise, then we
need to confirm the a and b transitions out of these states also. we have a tendency to stop once
every DFA state has associate a-transition and a b-transition out of it. acceptive states
in the DFA ar any DFA states that contain a minimum of one acceptive NFA state. We
eventually find yourself with the DFA below as before:


a
b
a b
a, b
b
a
For the DFA state , there are not any versions of the NFA presently active, i.e., all “threads”
have “crashed,” that the NFA cannot proceed and also the input string won't be accepted.
However, in step with the definition of a DFA, every state should have edges deed it
corresponding to every image within the alphabet . Thus, we have a tendency to add a loop from the DFA
state back to itself labeled with , that in our case could be a, b.
4. provide regular expressions that generate every of the subsequent languages. all told cases,
the alphabet is = .
6
(a) The language w.
Answer: (a b)((a b)(a b))
(b) The language { w
| w has associate odd variety of a’s }.
Answer: b
a(aba b)

(c) The language { w | w contains a minimum of 2 a’s, or precisely 2 b’s }.
Answer: b
aba(a b)
a

ba
ba
(d) The language w ends {in a double letter }. (A string contains a double
letter if it contains aa or BB shot as a substring.)
Answer: (a b)
(aa bb)
(e) The language doesn't finish in a very double letter }.
Answer: a b (a b)
(ab ba)
(f) The language { w
| w contains precisely one double letter }. as an example,
baaba has precisely one double letter, however baaaba has 2 double letters.
Answer: ( b)(ab)
aa(ba)
( b) ( a)(ba)

bb(ab)
( a)
5. Suppose we have a tendency to outline a restricted version of the Java programing language i

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote