Example situation
After each exam, the professor provides the following information.
- Minimum Score
- [Arithmetic] Mean
- Median
- Maximum Score
- Standard Deviation
I also know what my score was as well as how many students took the exam.
Restating question in light of example
Is there a known way in Python to take this other information into account such that calculating the mean, median, minimum, st. deviation, and maximum of the resulting dataset is an exact match for the given actual mean, median, minimum, and maximum AND that my score is among the output dataset?
numpy.random.normal()
doesn't give me what I want
I know that I can use numpy.random.normal
to generate random data that tends toward a given distribution, e.g., numpy.random.normal(loc=median_of_scores, scale=sigma_of_scores, size=num_of_scores)
, but that only tends toward the statistical parameters. Also, it doesn't take into account known pieces of information (my score, the median, the minimum score, and the maximum score). Adding my score, the minimum score, and the maximum score would further warp the randomly-generated data away from the known population numbers.
Other use-cases
While my example is specific to a college course, I imagine this problem is also faced by any Python developer who works with datasets that they're only allowed to know the statistics of (for privacy reasons). For quality testing, I imagine these developers would want a way to create statistically-indistinguishable data.