Question

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.

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

Given language is

L = { a^n : n is even } U { b^n : n is odd }

Consider the given Language L = L1 U L2 where

L1 = { a^n : n is even } and

L2 = {b^n : n is odd}.

Strings in languages

L1 = {e,aa,aaaa,aaaaaa,..................} and

L2 = {b,bbb,bbbbb,bbbbbbb,...................}

L = L1 U L2

L = {e,b,aa,bbb,aaaa,bbbbb,aaaaaa,................} # e is empty string epsilon

DFA:

This DFA accepts L

Starting state(initial state) = A

Set of States = {A,B,C,D,DEAD(OPTIONAL)}

Set of final states = {A,C}

Transition Table:

States a b
A B C
B A Dead
C Dead D
D Dead C
Dead Dead Dead

DFA Graph:

Da,b. b Dead, B A b. b

If you have any doubts please leave a comment!!!!!!!!

Add a comment
Know the answer?
Add Answer to:
Question 5. Let Σ = {a, b}, and consider the language L = {a^n : n...
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
  • 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 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

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

    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 (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.

  • . 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.

  • 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 7. Let Σ = {a}, and consider the language L = {a^n : n is...

    Question 7. Let Σ = {a}, and consider the language L = {a^n : n is a prime number} = {a 2 , a3 , a5 , a7 , a11 , . . .}. Is L a regular language? Why or why not? (Hint: L contains a 11 , a 17 , a 23 , a 29, but not a 77 since 77 is divisible by 11. . . )

  • 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}

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

    Let Σ = { a } , and consider the language L = { a n : n is a prime number } = { a 2 , a 3 , a 5 , a 7 , a 11 , . . . } . Is L a regular language? Why or why not? (Hint: L contains a 11 , a 17 , a 23 , a 29 , but not a 77 since 77 is divisible by 11. ....

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