00:02
We are given two context -free grammars which generate two languages l of g one and l of g two and we are given sets and we are asked to show that there is a context -free grammar generating each of these sets so in part a we're given the set, which is the union of l of g1 and l of g2.
00:41
Well, to make this a little bit simpler, suppose that the non -termal symbols of g1 and g2 are disjoint.
01:21
And if this is not the case, we can obviously just give the symbols, say those in g2, new names, so that the symbols will be destroyed.
01:34
And this won't change the language that the grammar generates.
01:42
And we have start symbols s1 and s2.
02:17
And now we'll want to take, we'll define our new grammar, g, by taking all the rules of production from g1 and g2, along with the symbols.
02:47
So all the rules and symbols from g1 and g2, add a new symbol s, which is the start symbol for g.
03:20
And in part a, so you're trying to find grammar that generates lg1, you mean lg2.
03:31
Well, we want strings that generate that either grammar g1 or grammar g2 generate.
03:37
So i want to add the rules s produces s1 and the rule s produces s2...