Questions tagged [statistics]

For questions that relate to probability or measurements, either outputting or parsing.

Filter by
Sorted by
Tagged with
33
votes
56answers
4k views

Compute the Median

Challenge Given a nonempty list of real numbers, compute its median. Definitions The median is computed as follows: First sort the list, if the number of entries is odd, the median is the value in ...
21
votes
32answers
3k views

Calculate Standard Deviation

Challenge Given a list of numbers, calculate the population standard deviation of the list. Use the following equation to calculate population standard deviation: Input The input will a list of ...
35
votes
2answers
1k views

The PPCG Handicap System

As we all know, meta is overflowing with complaints about scoring code-golf between languages (yes, each word is a separate link, and these may be just the tip of the iceberg). With so much jealousy ...
23
votes
22answers
2k views

Frequency Distribution of Multiple Dice Rolls

Given two positive integers a and b, output the frequency distribution of rolling a b-sided ...
13
votes
21answers
1k views

Mode length of a sentence

The task is simple. You are given a string with alphabetical words (say "Hello world, this are tests"). You have to return the mode of the lengths of ...
6
votes
4answers
282 views

Find the smallest number of participants with resulting percentages

Programs often list outcome statistics, such as this: 54% of participants received an award 69% of participants got a promotion 85% of participants increased their salary These percentages are the ...
24
votes
22answers
2k views

Frequency Distribution of Mixed Dice Rolls

A follow-up to this challenge Given a set of mixed dice, output the frequency distribution of rolling all of them and summing the rolled numbers on each die. For example, consider ...
17
votes
36answers
2k views

An Array of Challenges #3: Moving Averages

Note: This is #3 in a series of array-manipulation challenges. For the previous challenge, click here. Moving Average of a List The moving average of a list is a calculation resulting in a new, ...
16
votes
9answers
1k views

Fivenum and a little bit

(a paradox, a paradox, a most ingenious paradox) This is the first part of a multipart series inspired by different R functions. The Task Given a dataset \$D\$ of positive integers, I need you to ...
12
votes
1answer
375 views

Iterated Moving Average

If we have a list, say the list [9, 2, 4, 4, 5, 5, 7], we can do a moving average across it. Taking a window of say, 3 elements, each element is replaced by a ...
8
votes
1answer
4k views

Calculate the average and standard deviation, rubiks cube style

Introduction When solving a rubiks cube, one often write down the times like this 11.91, (11.28), (12.32) This is called a average of 3, while a average of 5 ...
7
votes
5answers
500 views

Fun with strings and string lengths

Introduction Inspired by Dyalog Ltd.'s 2016 student competition. The challenge there is to write good APL code, but this is a code-golf and it is open to all languages. Derived from this closed ...
8
votes
9answers
697 views

Calculate the correlation coefficient

Given a series of numbers for events X and Y, calculate Pearson's correlation coefficient. The probability of each event is equal, so expected values can be calculated by simply summing each series ...