MATH 314 Quiz 15

Given on 2026-02-25

I tried really hard to make exactly 5 things wrong in each code chuck of each of the problems below, but counting is hard.

Please cross out the wrong character(s) and write an ordered, comma separated list of replacement characters after the comment #. Place a line through nothing to denote that you want to add characters at that point. To delete characters without replacement, use under-scores (e.g. ____) as empty replacements of the characters you cross out.

If you don't know the correct Python syntax for the replacement characters you want, make something not unreasonable up.

You will not receive credit if you cross out an entire line, even if your fix is correct.

You should assume the following import statements precede each code chunk in each question.

import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as spicy

Use matplotlib to to make a convergence plot of an estimate of for .

Remember, the formula for the expectation for the variance is

rng = np.random.default_rng()
n = 11
p = 0.3
R = 501
x = rng.binomial(n, p, size = n)
m = n * p
rdx = np.arange(R + 1)
cv = np.cumsum(abs(x - m))
plt.plot(cv, x)