Statistics

In this topic, we will look at statistics.

Algorithm X.1: Mean

Input: a sequence of $n$ values $x_1$, \ldots, $x_n$.
Output: a number.

Given the collection of values:

$x_1, x_2, x_3, \ldots, x_n$,

describe algorithms for finding the mean of this data.

Algorithm X.2: Median

Input: a sequence of $n$ values $x_1$, \ldots, $x_n$.
Output: a number.

Given the collection of values:

$x_1, x_2, x_3, \ldots, x_n$,

describe algorithms for finding the median of this data.

Algorithm X.3: Mode

Input: a sequence of $n$ values $x_1$, \ldots, $x_n$.
Output: a list of one or more numbers.

Given the collection of values:

$x_1, x_2, x_3, \ldots, x_n$,

describe algorithms for finding the mode of this data.

Algorithm X.4: Range

Input: a sequence of $n$ values $x_1$, \ldots, $x_n$.
Output: the end-points of an interval.

Given the collection of values:

$x_1, x_2, x_3, \ldots, x_n$,

describe algorithms for finding the range of this data.

Algorithm X.5: Standard deviation

Input: a sequence of $n$ values $x_1$, \ldots, $x_n$.
Output: a non-negative number.

Given the collection of values:

$x_1, x_2, x_3, \ldots, x_n$,

describe algorithms for finding the standard deviation of this data.

Suppose you know that the probability of a failure occuring is $p$ where $0 \le p \le 1$. Given that $n$ tests occurred, describe an algorithm for determining the probability of there being $k$ failures in those $n$ tests.