00:04
We are given a vocabulary and a set of terminal symbols, and we are asked to find the language generated by a grammar, vtsp, and the set of productions consists of a given set of productions.
00:23
So in part a we're given the set of productions is s can be replaced by ab, a can be replaced by ab, and b can be replaced by b b.
00:40
So to determine the language generated first, let's just think about the different words we can derive.
01:00
So starting at our start symbol s, we must derive from this ab.
01:08
From a, we must derive a, b, and then we still have b.
01:15
And from b, we must derive ab, b.
01:21
And there are no other sentences possible.
01:31
Follows the language of the grammar with this set of productions is simply sentence a, b, b, b.
01:46
In part b, we're given the set of productions s replaced by a b, s replaced by a replaced by a, a replaced by a, and b, a replaced by b a.
02:37
To determine the language generated by the grammar with these productions, let's just try to derive some sentence.
02:44
So starting with our start symbol s, we must derive.
02:50
Well, we have two different cases.
02:52
We can use our first production to derive ab.
02:56
From a we must derive a, and then from b we must derive b.
03:06
So we get as the final sentence a -b -a, and no other sentences can be derived using our first production.
03:17
Now suppose instead that we use our second production so that from s we derive a.
03:24
Then from this we must derive a -a.
03:28
And so it follows that the language generated by this grammar is simply the set of sentences a -b -a -a -a -a.
03:45
In part c, we're given the set of productions s replaced by ab, s replaced by aa, a replaced by a, a replaced by a b, a replaced by ab, a replaced by ab, and b replaced by b.
04:39
So we see that beginning with our start symbol s, there are two possible derivations here.
04:47
So using our first production, we have the derivation ab.
04:54
And from a a, there are two more possible derivations.
04:59
So if we use our third production, from this we derive abb, and from b we must derive b.
05:13
So we obtain the sentence abb.
05:16
On the other hand, with our start symbol, we can also derive ab again.
05:25
But this time, instead of deriving ab from a, we could instead derive a b from a.
05:32
So we get ab, b.
05:37
Notice that this is actually going to give us the same outcome.
05:40
We still end up with abb, so you must derive b from b.
05:49
Let's suppose instead that we derive from saa.
05:55
So this is our second production.
05:59
Then we have a few different options.
06:01
Suppose that for both a's, well, for the first a, we're going to use production 3.
06:07
So we get the derivation a -b -a, and then we know from the b we must derive b, so we can do that.
06:22
And now from this second a, we can again use our third production to derive a -b -a -b, which we must derive a -b, a -b.
06:36
So we end up with a new sentence, a -b -b.
06:42
Now let's suppose instead that we're starting with our start symbol s and we derive a -a again.
06:51
And this time we're again going to derive ab followed by a.
07:01
And again we must derive a -b -a.
07:05
But this time, instead of using our third production, use the fourth, this is just a faster way of getting a -b -b.
07:19
So again, not a new sentence...