import matplotlib.pyplot as plt
import numpy as np
= np.arange(6) + 1
x = np.ones(6) * 1/6 fx
(array([1, 2, 3, 4, 5, 6]),
array([0.16666667, 0.16666667, 0.16666667, 0.16666667, 0.16666667,
0.16666667]))
= "orange", label = "uniform density")
plt.scatter(x, fx, color 5) + 1, np.ones(5) / 5, label = "other")
plt.scatter(np.arange("density")
plt.ylabel("support")
plt.xlabel( plt.legend()
= np.random.default_rng()
rng 5, size = 10) rng.integers(
array([3, 2, 3, 2, 0, 1, 3, 1, 1, 2])