00:01
We are given languages and we are asked to find phrase structure grammars for each of these languages.
00:11
In part a, we're given the set consisting of the bit strings 0, 1, and 1.
00:20
So we know that our grammar g is going to be a 4 -touple with components v, t, s, and p, where v is the vocabulary.
00:46
T is a set of terminal symbols, s is the start symbol, and p is the set of productions.
00:59
So i'm actually going to identify the set of productions first, and then i'll use these to find v and t.
01:11
So to obtain the bit string 0, i want to include the production s produces 0, to obtain the bitstream 1, we want to also include the production s produces 1.
01:28
And to obtain the bit string 1 -1, we want to include the production s produces 1 -1.
01:37
So we have 3 productions, and we see that our vocabulary v is going to include 0, 1, and the start symbol s.
01:51
And the set of terminals is simply going to be 0 and 1.
02:02
Now, in part b, we are given the set of bit strings containing only ones.
02:19
Once again, our grammar g is a four tuple with components v, t, s, and p, where v is the vocabulary, t is the set of terminal symbols, s is the start symbol, and p is the set of productions.
02:38
So to determine our vocabulary first, i'll determine the set of production.
02:43
We know that our set of terminal symbols is going to be simply one, since our strings are only going to contain ones.
03:00
Now to obtain the set of bit strings containing only ones, i want to include, well, we could have an empty string, so i want to include the production s produces lambda, and we also want to include the production s produces 1s.
03:21
So this enables us with this, along with lambda, to produce any string of arbitrary length, which is all ones.
03:32
And so these are all the productions we need.
03:37
And we see that our vocabulary is simply going to be the set 1s...