Mean of a Random Sample
Northgate Depot audits its stock by spot-checking bins rather than counting everything. A warehouse has some number of bins, numbered from 1 upwards, and the audit software picks a few of them at random for the team to count by hand.
The pick has to be reproducible: the auditor, the warehouse manager and the external reviewer must all end up looking at the same bins, so the random number generator is started from a seed recorded on the audit sheet. Northgate runs this across several warehouses, which differ in how many bins they hold and how many the audit plan calls for, and the seed is written down fresh for each audit.
Task: Print the mean of the drawn bin numbers, as a plain number rather than as a numpy object. No rounding is asked for.
Input
Three lines: the seed recorded on the audit sheet, the number of bins in the warehouse, and how many bins the plan says to check. All three are whole numbers of at least 1, and bins are numbered 1 to the warehouse's bin count inclusive.
Output
One line holding the mean of the drawn bin numbers as a plain float - 58.6, never np.float64(58.6).
Example:
Input:
42
100
5
Output:
58.6
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in