YCP Logo Lab 2: Finite Automata

Use JFLAP to construct finite automata that recognize the following languages over the alphabet {a, b}.

Note: although we have been using the symbol ε (epsilon) to label transitions that do not consume an input symbol, JFLAP uses λ (lambda).

Language 1 - Easy

The language of all strings generated by the regular expression

a(ba)+a

Test your automaton on the following input strings:

Input String Expected Result
a rejected
aa rejected
abaa accepted
ababaa accepted
ababa rejected

Language 2 - A Bit Harder

The language of all strings generated by the regular expression

(ab|aab)*

Hint: a nondeterministic finite automaton might be easier to construct.

Test your automaton on the following input strings:

Input String Expected Result
ε accept
ab accept
aab accept
bab reject
aaab reject
aabab accept

Language 3 - More Difficult

The language of all strings that start with a and do not end with ba.

Test your automaton on the following input strings:

Input String Expected Result
a accepted
ab accepted
aba rejected
abba rejected
abb accepted
baa rejected