Day 1: Basic Statistics - A Warmup

Submissions will no longer be placed on the leaderboard. You may still attempt this problem for practice.

Objective
In this challenge, we practice calculating the mean, median, mode and standard deviation in statistics. Check out the Resources tab for helpful videos!

Task
Given a single line of space-separated integers describing an array, calculate and print the following:

  1. Mean (m): The average of all the integers.

    where is the element of the array.

  2. Array Median: If the number of integers is odd, display the middle element. Otherwise, display the average of the two middle elements.

  3. Mode: The element(s) that occur most frequently. If multiple elements satisfy this criteria, display the numerically smallest one.

  4. Standard Deviation ():

    where is the element of the array.

Other than the modal values (which should all be integers), the answers should be in decimal form, correct to a single decimal point, format. An error margin of will be tolerated for the standard deviation. The mean, mode and median values should match the expected answers exactly.

Assume the numbers were sampled from a normal distribution. The sample is a reasonable representation of the distribution. A user can approximate that the population standard deviation standard deviation computed for the given points with the understanding that assumptions of normality are convenient approximations.

Scoring
Scoring is proportional to the number of test cases cleared.

Input Format

The first line contains an integer, , denoting the number of elements in the array.
The second line contains space-separated numbers describing the elements of the array.

Constraints

Output Format

A total of five lines are required (in the following order:

  1. Mean (format: 0.0) on the first line.
  2. Median (format: 0.0) on the second line.
  3. Mode(s) (numerically smallest integer in the case of multiple integers)
  4. Standard Deviation (format: 0.0)

Sample Input

10
64630 11735 14216 99233 14470 4978 73429 38120 51135 67060

Sample Output

43900.6
44627.5
4978
30466.9
Line: 1 Col: 1
  1. Challenge Walkthrough
    Let's walk through this sample challenge and explore the features of the code editor.1 of 6
  2. Review the problem statement
    Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
  3. Choose a language
    Select the language you wish to use to solve this challenge.3 of 6
  4. Enter your code
    Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
  5. Test your code
    You can compile your code and test it for errors and accuracy before submitting.5 of 6
  6. Submit to see results
    When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
  1. Check your score