All problems

Two Standard Deviations

mediumPythonStatistics

Pemberton Analytics keeps a teaching panel in its onboarding notes that describes one set of numbers two ways: once treating them as the entire population being studied, and once treating them as a sample drawn from a larger population nobody has seen. New analysts routinely reach for whichever function came to hand first, so the panel prints both side by side and lets them see which one comes out larger.

Task: Print the population standard deviation and the sample standard deviation of the values, each on its own labelled line.

Input

The first line holds one integer n, how many values follow; n is at least 2. Each of the next n lines holds one value as a plain number.

Output

Two lines, population first. The first line reads population, one space, then the population standard deviation with exactly two digits after the decimal point. The second line reads sample, one space, then the sample standard deviation in the same format. Both labels are lowercase.

Example:

Input:
4
2
4
6
8

Output:
population 2.24
sample 2.58

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…