Assignment NO1 NLP
Assignment NO1 NLP
1. a∗abb∗a^*ab b^*a∗abb∗:
• Solution: The NFA accepts strings where any number of 'a's is followed by "ab", and
then followed by any number of 'b's.
Diagram:
2. Strings ending in "00" or "11":
• Solution: The NFA accepts strings over the alphabet {0, 1} that end in either "00" or
"11".
Diagram:
3. Strings containing "the":
• Solution: The NFA accepts strings over the alphabet {a-z} that contain the substring
"the" anywhere in the input.
Diagram:
4. Strings ending in "ing":
• Solution: The NFA accepts strings over the alphabet {a-z} that end with the substring
"ing".
Diagram:
Q2. Design the DFA for the following language sets:
• Solution: The DFA accepts strings that contain at least one 'a' and must end with 'a'.
Diagram:
• Solution: The DFA accepts strings that match any of the given patterns.
Diagram:
THE END