This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS51 Project 1c: An Infinite Number of Monkeys Due: Tuesday, 3 March 2009 at 11:59 PM Total Points: 45 (including 5 style points) This is the third part of Project 1. By now, youve worked a bit with dictionaries and queues in the process of learning about interfaces, and then built a generative grammar (Arrr!). In this piece of the project, we will implement a Markov chain babbler. 1 Downloads This project will require you to download multiple files. You will still only need to submit your .scm file. Download the following files from the website and place them in the same directory in which you will be saving your work. proj1cutils.ss: I/O functions. graph.ss: Undirected graphs with weighted edges. rjtext: Act I of Romeo and Juliet. You may use any subset of this file for your babble. (Or any other text you feel like using, but this one has been preformatted for you.) 2 What you must do From now on, well be doing our best to provide an upfront description of what you must actually turn in. The first part of these assignments tends to be writeup, which can be pretty long, and sometimes its hard to tell what the actual exercises are. 2.1 Writeup Markov Chain Babbler Random walk on a graph 1 3 MARKOV CHAIN BABBLER CS51 Project 1c: An Infinite Number of Monkeys Our chosen implementation Logistics and utilities 2.2 Exercises Helper functions and tests for tokenstograph . Helper functions and tests for babblengrams . Actual babbling, minutesspent and feedback. Challenge problem, worth no points. Feel free to skip any parts of the writeup that you already understand, but do be sure you dont miss anything youll need for the assignment. The actual exercises begin on page 5. 3 Markov Chain Babbler For this portion of the problem set, you will implement a babbler in Scheme using a probabilistic algorithm. A Markov chain is, loosely defined, a chain built by choosing each link with a probability based on no more memory than a few preceding links in the chain. A Markov chain is thus essentially a random walk on a graph. You start with a graph with some nodes and edges (links) between them; at each node, you choose semirandomly where to move based on some information you have about the probabilities associated with each of the edges that you might choose to follow. This algorithm can be used to model natural language, where each link is a clearly defined piece of the language. Such links could be phonemes, letters, words, or even phrases. For this assignment, we will use words, punctuation marks, and endofparagraph ( eop ) for our links. All of our words, including eop , will be represented in Scheme as symbols , which is a data type that we havent discussed yet this semester. You dont need to know much about symbols; basically, eop may appear in your Scheme interpreter with a single quote in front of it. Note also that Scheme might represent lists with a single quote in front; this isfront of it....
View
Full
Document
 Spring '09
 GREGMORRISETT
 Romeo and Juliet

Click to edit the document details