Course Level
CS1
Knowledge Unit
Fundamental Programming Concepts
Collection Item Type
Assignment
Synopsis

In this assignment students work either individually or in pairs to implement Markov text generation. Students must prompt the user for files to use as a model and then parse the files to create a k-th order Markov model, represented as a map of key words to the k words that can follow those words. Students then generate a random text using this map. In addition reviewing strings, dictionaries, and file i/o, this assignment requires students to design their own algorithm given basic specifications.

Recommendations

Integrate pair programming when it is appropriate for students to collaborate on a lab, assignment, or project. The “driver” controls the mouse and the keyboard, while the “navigator” makes suggestions, points out errors, and asks questions. Partners routinely switch roles to gain the benefits of each role.

Engagement Highlights

Incorporates Student Choice by allowing the students to select which texts will be used in the analysis. Uses sentence composition to Employ Meaningful and Relevant Content.

Materials and Links

Computer Science Details

Programming Language
Python

Material Format and Licensing Information

Creative Commons License
CC BY-NC