Skip to content

Instantly share code, notes, and snippets.

@kra3
Last active May 26, 2018 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kra3/fe8b0218e4f43221bad917c2fd782e1a to your computer and use it in GitHub Desktop.
Save kra3/fe8b0218e4f43221bad917c2fd782e1a to your computer and use it in GitHub Desktop.
Mean -> Sum of all elements divided by number of elements. Arithmetic mean = average.
Median -> middle element after sorting all elements. If there are even number of elements, then get the mean of middle elements.
Mod -> Most repeated element (if there is one).
Range -> biggest element minus smallest element.
Standard deviation (sigma) -> how spread out the numbers are. Square root of variance.
Mean diviation - How far, on average, all values are from the middle. square root of absolute variance.
Variance (mu) -> average of squared differences from mean. That is (element - mean) squared for each element and find the mean of it.
If the numbers are a sample, rather than whole population, divide by N-1 instead of N while calculating variance. (Bessel's correction).
Factorial -> n! -> 1x2x..xn. Number of ways to arrange n objects. Each selection reduces available pool for next selection. ie., no repetition.
Permutation -> nPr = n!/(n-r)!. Ways to arrange r objects from a collection of n objects.
Combination -> nCr = n!/r!(n-r)!. Ways to select r bjects from a collection of n objects without considering order.
If repetition is allowed:
Permutation -> n to the power of r.
Combination -> (r+n-1)!/r!(n-1)!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment