Homework: (work in groups of two)
Do two of the following: (Bonus of 4 pts each for doing more than
two- but tell me which is bonus)
1) a) Modify str3.m to print out the average number of times a
winning streak of length k occurs only if that average is greater than
.01. Format your output nicely as
streak length average
number of times in a trial of length n
1
XXXX
2
XXXX
etc
b) Graph the average number of times a winning streak of length k
occurs as a function of k. Only use those k's for which that average is
greater than .001.
2) Modify winningstreak2.m to determine the percentage of
times that the maximum length winning streak in a trail of length
n is 0,1,2, .up through n. Note that for 0-n this number will be less
than 1. Plot these values as a function of the maximum length winning
streak.
3) Modify winningstreak2.m to additionally allow the user to input a
number less than n. It then determines the average number of winning
streaks of length greater than k in a trial of length n.
4) Modify winningstreak1.m so that it creates a random "DNA string"
of a,c,g,t's and computes the longest streak of each a,c,g,t.
e.g.
For aaccccggaaatgaggggg
maxstra is 3
maxstrc is 4
maxstrg is 5
maxstrt is 1