The long-awaited Homework 3 is out now. The intent of this homework is to get you some hands on experience with Markov chains and serve as introduction to queueing theory. The problems will vary in difficulty from those that you should be able to solve in a couple of minutes, to those that require more thought. Consider the problems in the homework as a preparation for the midterm.

Submission Instructions

You are to submit this homework in hard-copy at the start of class on Thursday November 1, 2018. The number of points on each problem should reflect how much time you should be spending on the problem, this should serve as a good exercise for the midterm.

You can always use the course’s template for typesetting your solution.

Source code

The source code for problem 9 is shown below. The dataset to use for this problem can be downloaded from here**.

import string
import numpy as np
import pprint

def tokenize(line):
    lline = line.rstrip().lower()
    pline = lline.translate(None, string.punctuation)
    return pline.split()

if __name__ == "__main__":
    with open('lyrics.txt') as fp:
        for line in fp:
            if not line.isspace():
                pprint.pprint(tokenize(line))

Due Date: At the start of class on Thursday 11/01/2018.

**Lyrics are the property and copyright of their owners, they are only used for educational purposes and are not to be sold or redistributed. Lyrics were obtained from https://www.azlyrics.com/.