All problems

A Single Bootstrap Resample

hardPythonNumPyResampling

Northgate Water has only a handful of readings for one stretch of river and needs a feel for how much the average of a handful could have wobbled by luck alone. The standard trick is to build a fresh set of readings the same size as the real one by drawing from the readings it already has, taking every draw from the full set — so a reading can turn up two or three times in the rebuilt set while another does not appear at all. Repeating that thousands of times maps out the wobble; this exercise builds one rebuilt set and reports its average. The draw runs from a seed so the figure can be checked: the classic global random stream is set from that seed after the readings have been read in.

Task: Print the average of one rebuilt set.

Input

The first line holds an integer n, the number of real readings. Each of the next n lines holds one reading. The last line holds the seed.

Output

One line holding the rebuilt set's average, written with exactly two decimal places.

Example:

Input:
5
10
20
30
40
50
1

Output:
32.00

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

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…