Question

Question 5. Let S = {a,b}, and consider the language L = {a : n is even} U{b : n is odd}. Draw a graph representing a DFA (

0 0
Add a comment Improve this question Transcribed image text
Answer #1

L = {a : n is even} U{ : n is odd}.

The given language accepts strings of the form

  • empty string, aa, aaaa, aaaaaa, ....where number of a's are even
  • b, bbb, bbbbb, ..... where number of b's are odd

Strings containing both a's and b's should be rejected.

Strings containing only a's but odd number must be rejected.

Strings containing only b's but even number must be rejected.

The DFA is as follows:

Start а b q1 b а q2 q3 a,b a,b b b 96 o 97 ат a a b 95 q4

State

q1: Start state, accepts empty string  (ACCEPTING STATE)

q2: Strings containing only a's but odd number

q3: Strings containing only b's and odd number (ACCEPTING STATE)

q4: Strings containing only a's and even number (ACCEPTING STATE)

q5 Strings containing only b's but even number

q6: Strings containing both a's and b's

q7: Strings containing both a's and b's

Hence for the given DFA q1, q3, q4 are accepting states and

The given DFA accepts strings of the form

  • empty string, aa, aaaa, aaaaaa, ....where number of a's are even
  • b, bbb, bbbbb, ..... where number of b's are odd

------------------------------------------------------

I hope this helps you,

Please rate this answer if it helped you,

Thanks for the opportunity

Add a comment
Know the answer?
Add Answer to:
Question 5. Let S = {a,b}, and consider the language L = {a" : n is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 5. Let Σ = {a, b}, and consider the language L = {a^n : n...

    Question 5. Let Σ = {a, b}, and consider the language L = {a^n : n is even} ∪ {b^n : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language.

  • Question 5. Let Σ = {a, b}, and consider the language L = {a n :...

    Question 5. Let Σ = {a, b}, and consider the language L = {a n : n is even} ∪ {b n : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 6. Give a brief description of the language generated by the following production rules. S → abc S → aXbc Xb → bX Xc → Ybcc bY → Yb aY → aa aY → aaX

  • Let Σ = { a, b } , and consider the language L = { a...

    Let Σ = { a, b } , and consider the language L = { a n : n is even } ∪ { b n : n is odd } . Draw a graph representing a DFA (not NFA) that accepts this language.

  • Question 1. Let S = {a,b}, and consider the language L = {w E E* :...

    Question 1. Let S = {a,b}, and consider the language L = {w E E* : w contains at least one b and an even number of a's}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a”62m : n > 0} = {1, abb, aabbbb, aaabbbbbb, ...} Find production rules for a grammar that generates L.

  • Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ...

    Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ ∗ : w contains at least one b and an even number of a’s}. Draw a graph representing a DFA (not NFA) that accepts this language.

  • . Let Σ = { a, b } , and consider the language L = {...

    . Let Σ = { a, b } , and consider the language L = { w ∈ Σ ∗ : w contains at least one b and an even number of a’s } . Draw a graph representing a DFA (not NFA) that accepts this language.

  • Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ...

    Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ ∗ : w contains at least one b and an even number of a’s}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a n b 2n : n ≥ 0} = {λ, abb, aabbbb, aaabbbbbb, . . .} Find production rules for a grammar that generates L.

  • (g) If there is an NFA with s states which accepts a language L, then we...

    (g) If there is an NFA with s states which accepts a language L, then we can construct a DFA which accepts the same language and has: (circle the smallest correct answer a) s states b) 2s states d) 2 states (h) If there is a DFA which accepts a language A with s states and another whiclh accepts language B with t states, then we can construct a DFA which accepts An B which has (circle the smallest correct...

  • Consider the language L below. (a) Is L a regular language? – Yes, or No. (b)...

    Consider the language L below. (a) Is L a regular language? – Yes, or No. (b) If L is a regular language, design the DFA (using a State Table) to accept the language L, with the minimum number of states.  Assume , (c) Suppose the input is “101100”. Is this input string in the language L? Σ = {0,1} L={w l w has both an even number of O's and an odd number of 1's}

  • Consider the NFA N with states labeled q1, q2 and q3, where q1 is the start...

    Consider the NFA N with states labeled q1, q2 and q3, where q1 is the start state and q2 and q3 are the final (accepting) states. The transition function for N is δ(q1,a) = {q1}, δ(q1,b) = {q1,q2},  δ(q2,a) = {q3}, δ(q2,b)= ∅, δ(q3,a)= ∅, and δ(q3,b)= ∅. Let L be the language recognized by N i.e. L(N). a) Draw the state diagram for N. b) Describe in plain English what's in the language L. c) Via the construction NFA to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT