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

The language ONLYA accepts all words with only a’s in them. The language ONLYB a

ID: 3878642 • Letter: T

Question

The language ONLYA accepts all words with only a’s in them.
The language ONLYB accepts all words with only b’s in them.
The language ONLYAORB accepts all words with only a’s or only b’s in them.


(a) give a word in the language ONLYA and give a string not in the language ONLYA;
(b) give a word in the language ONLYB and give a string not in the language ONLYB;
(c) give a word in the language ONLYAORB and give a string not in the language ONLYAORB;
(d) give a regular expression for the language ONLYA;
(e) give a regular expression for the language ONLYB;
(f) give a regular expression for the language ONLYAORB;
(g) give a Finite Automaton for the language ONLYA;
(h) give a Finite Automaton for the language ONLYB;
(i) give a Finite Automaton for the language ONLYAORB;

Explanation / Answer

(a) Language ONLYA accepts all words with only a's in them.

   Words in language ONLYA is 'aa'

String not in the language ONLYA is 'aab' as ONLYA accepts words with only a's in it but 'aab' has ' b' so it will not be a string in language ONLYA

(b) Language ONLYB accepts all words with only b's in them.

   Words in language ONLYB is 'bbb'

String not in the language ONLYB is 'aab' as ONLYB accepts words with only b's in it but 'aab' has 'a' also so it will not be a string in language ONLYB.

(c) Language ONLYAORB accepts all words with only a's or only b's in them.This means ONLYAORB doesnot accpets words that is combination of a's and b's.

   Word in language ONLYAORB is 'bbb' as it has only b's and not combination of a's and b's.

String not in the language ONLYAORB is 'aab' as ONLYAORB doesnot accpets words that is combination of a's and b's.

d) Regular expression for the language ONLYA is a* as it accpets all words with only a's in them.(null string is accepted)

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