Problem 5. (20 points) A regular grammar is a grammar G = (V,T,S,P) in which production rules are of the form A → a or A → aB, where a ∈ T and A, B ∈ V. The rule S → λ is allowed, where S is the start variable. Regular grammars generate regular languages. Give a regular grammar for the following regular languages:
L1 = L(a*b* + (a + b)(a + b))
L2 = {w ∈ {a, b}* : |w| = 3k, for some k ≥ 0}