Tutorial 3
Tutorial 3
Oct. 2, 2014
Complete the questions below in preparation for your tutorial. You DO NOT need to hand your answers
in, but you should bring them to the tutorial so you can take part in the discussion.
Introduction
In this tutorial, you will have the chance to practice making and analyzing finite state grammars (FSGs).
Remember, a finite state grammar consists of at least one start and end state (they can be the same state),
and any number of states in between, as well as transitions between states. When a transition is taken
from one state to another, a symbol is output. Some things to keep in mind for the problems below:
i.
ii.
iii.
Try to keep your FSGs as simple as possible. You should not have more than one start and end
state for any of the questions below.
Label your start state 0 and your end state with a double circle. The numbers assigned to
other states do not matter.
You should not have any empty transitions; i.e. all transitions must output a symbol/word. No
transition can output more than one symbol (Part A) or one word (Part B).
(a) Make a FSG that generates only the following two strings.
{, }
Your FSG should have a total of four states, four transitions, and only one start and end state.
(b) Modify your previous FSG so that it will generate the strings and , as well as all strings
of the form , i.e. all strings consisting of followed by any number of s followed by
a .
{, , , , , , }
You should only need to add a single transition.
2.
(a) Make a FSG that will generate all and only strings of the form () , that is of repeated
any number of times greater than or equal to one.
() = {, , , , }
Your FSG should have four states, four transitions, and one start and end state.
(b) Make a FSG that will generate all and only strings of the form () , as well as the empty
string (i.e. the string consisting of no symbols at all). Your FSG should have only three states.
3.
(a) Make a FSG that generates all and only those strings that consist of any number (possibly zero)
of s, followed by exactly three s, followed by any number (possibly zero) of s. Example
strings of this form include:
, , , , ,
Your FSG should have only four states and only a single start and end state.
(b) Modify your previous FSG so that it generates all and only those strings that consist of any
number (possibly zero) of s, followed by between one and three s, followed by any number
(possibly zero) of s. Example strings of this form include:
, , , , , , , ,
You should only need to add two transitions to your previous FSG.
4.
FSG 1
Does this FSG provide counter-evidence to the claim that the language cannot be generated
with a FSG? Why or why not?
(a) Make a FSG that generates all and only the following two sentences:
George likes Britney.
George likes the girls.
(b) Modify the FSG you just created so that it generates all and only the following four
sentences:
George likes Britney.
George likes the girls.
The boys like Britney
The boys like the girls.
(c) Is there something unappealing about the last FSG you made? Is it possible to fix this?
6.
FSG 2
FSG 3
(a) List the sentences that each FSG generates. If you cant list all the sentences for a FSG,
describe in words their general form.
(b) Which of the two do you think is a better model grammar of your I-language? Why?
7.
FSG 4
8.
FSG 5
(a) List the sentences that this FSG generates.
(b) Does this FSG seem like a good miniature model of yoda speak? Why or why not?
(c) If you answered no to the last question, do you think you could make a FSG that provides a
better model of yoda speak? Why or why not?