Exact sampling distribution
To quantify how the point estimate (sample statistic) you are interested in varies, you need to know all the possible values it can take and how often. That is, you need to know its distribution.
The distribution of a sample statistic is called the sampling distribution. When we can calculate this exactly, rather than using an approximation, it is known as the exact sampling distribution.
Let's take another look at the sampling distribution of dice rolls. This time, we'll look at five eight-sided dice. (These have the numbers one to eight.)
pandas
, numpy
, and matplotlib.pyplot
are loaded with their usual aliases. The expand_grid()
function is also available, which expects a dictionary of key-value pairs as its argument. The definition of the expand_grid()
function is provided in the pandas documentation.
This exercise is part of the course
Sampling in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Expand a grid representing five 8-sided dice
dice = ____(
{____,
____,
____,
____,
____,
})
# Print the result
print(dice)