Home · Lessons · Mathematics

Mathematics

Statistics

Statistics collects and analyzes data to draw numerical conclusions, distinguishes population from sample, and uses central tendency and dispersion measures to describe distributions.

In this lesson
  1. Basic Concepts
  2. Formulas
  3. Examples
  4. SVG
  5. Comparison
  6. Tips
  7. Exercises

Basic Concepts

Statistics is the science of collecting, organizing, presenting, and then analyzing data to draw conclusions based on numbers rather than impressions. The lesson first distinguishes between population, which consists of all elements under study, and sample, which is a part selected to represent it. The reason for this distinction is that the symbols differ: population variance \(\sigma^2\) and sample variance \(S^2\).

To describe any data set, we need two types of measures together: a measure that determines central tendency, and a measure that determines dispersion; the average alone is not sufficient, because two sets may have the same average yet differ enormously in the spread of their values.

First: Measures of Central Tendency

MeasureIdeaIs it affected by outliers?
Arithmetic meanSum of values divided by their countYes
MedianThe middle value after orderingNo
ModeMost frequent valueNo

Second: Measures of dispersion

These measures reveal how far the values deviate from their center; the larger they are, the more scattered the data:

Worked example (1)

Data: \(2, 4, 4, 6, 9\).

  1. Number of values \(n = 5\) and their sum \(25\), so \(\bar{x} = \frac{25}{5} = 5\).
  2. Median: the values are already ordered, so the third value is \(4\).
  3. Mode: \(4\) because it appears twice.
  4. Range: \(9 - 2 = 7\).
  5. Sample variance: \(S^2 = \frac{(2-5)^2 + (4-5)^2 + (4-5)^2 + (6-5)^2 + (9-5)^2}{5-1} = \frac{9+1+1+1+16}{4} = \frac{28}{4} = 7\).
  6. Standard deviation: \(S = \sqrt{7} \approx 2.65\).

Worked Example (2): Effect of an outlier

Data \(10, 12, 14, 16, 18\): sum \(70\) so \(\bar{x} = 14\), median \(14\), range \(18 - 10 = 8\). Then we add the outlier \(90\).

  1. Mean: \(\bar{x} = \frac{160}{6} \approx 26.7\), a very large change.
  2. Median: the two middle values are \(14\) and \(16\), so median \(\frac{14 + 16}{2} = 15\), a slight change.
  3. Range: \(90 - 10 = 80\), a tenfold increase.

Result: The outlier strongly affects the mean and range but leaves the median nearly unchanged, which is the practical criterion for choosing the appropriate measure.

Common Errors

Tips for the CSCA Exam

Formulas

In this section, we learn about the basic statistical measures used to describe data distribution, whether they represent an entire statistical population or a sample from it. These measures include the arithmetic mean, variance, standard deviation, and interquartile range (IQR). Each measure has a specific formula used depending on the nature of the data (population or sample), and understanding the differences between them is essential to avoid common errors in statistical analysis.

Definitions and Formulas

Below are the definitions and mathematical formulas for each measure, with clarification of the symbols used:

Reason for using \( n-1 \) in sample variance

When calculating sample variance, we use \( n-1 \) in the denominator instead of \( n \) to obtainan unbiased estimatorof the population variance \( \sigma^2 \). If we used \( n \), the estimate would tend to be lower than the true population variance, especially when the sample size is small. This adjustment is calledBessel's correctionand ensures that the expected value of the sample variance equals the actual population variance.

Step-by-step solved examples

  1. Example 1: Calculating the mean, variance, and standard deviation of a population

    Given: A population consisting of the following values: \( 2, 4, 6, 8 \).

    Solution:

    • Step 1: Calculate the mean \( \mu \):
      • \( \mu = \frac{2 + 4 + 6 + 8}{4} = \frac{20}{4} = 5 \)
    • Step 2: Calculate the variance \( \sigma^2 \):
      • We compute the deviations from the mean: \( (2-5)^2 = 9 \), \( (4-5)^2 = 1 \), \( (6-5)^2 = 1 \), \( (8-5)^2 = 9 \)
      • Sum of squares: \( 9 + 1 + 1 + 9 = 20 \)
      • \( \sigma^2 = \frac{20}{4} = 5 \)
    • Step 3: Calculate the standard deviation \( \sigma \):
      • \( \sigma = \sqrt{5} \)

    Result: \( \mu = 5 \), \( \sigma^2 = 5 \), \( \sigma = \sqrt{5} \)

  2. Example 2: Calculating the sample variance and comparing it to the population variance

    Given: A sample of values: \( 3, 5, 7 \).

    Solution:

    • Step 1: Calculate the sample mean \( \bar{x} \):
      • \( \bar{x} = \frac{3 + 5 + 7}{3} = \frac{15}{3} = 5 \)
    • Step 2: Calculate the sample variance \( S^2 \):
      • Deviations from the mean: \( (3-5)^2 = 4 \), \( (5-5)^2 = 0 \), \( (7-5)^2 = 4 \)
      • Sum of squares: \( 4 + 0 + 4 = 8 \)
      • \( S^2 = \frac{8}{3-1} = \frac{8}{2} = 4 \)
    • Step 3: Calculate what the variance would be if we used \( n \) instead of \( n-1 \) (for comparison):
      • \( \frac{8}{3} \approx 2.67 \), which is less than 4, so using n underestimates the true variance if the sample represents the population.

    Result: \( \bar{x} = 5 \), \( S^2 = 4 \), and we note that using \( n-1 \) gives a larger, more unbiased estimate of the population variance.

Common errors and how to correct them

Common mistakeCorrection
Using \( n \) in the denominator of sample variance instead of \( n-1 \)Always use \( n-1 \) when calculating sample variance to obtain an unbiased estimator of population variance.
Confusing the symbols \( \mu \) and \( \bar{x} \)The symbol \( \mu \) represents the population mean, while \( \bar{x} \) represents the sample mean. They cannot be substituted for each other in formulas.
Calculating standard deviation as the mean of absolute values instead of the square root of varianceStandard deviation is defined as \( \sqrt{\text{variance}} \), not the mean of absolute values. The definition must be followed precisely.
Considering IQR equal to \( \frac{Q_3 + Q_1}{2} \) or any other operation besides subtractionIQR is explicitly defined as the difference: \( Q_3 - Q_1 \). Any other operation (such as addition or averaging) is incorrect.

Test tips


Examples

Example 1

Set: \(3,7,5,13,20,23,39,23,40,23,14,12,56,23,29\).

Mean: \(\frac{3+7+5+13+20+23+39+23+40+23+14+12+56+23+29}{15} = \frac{330}{15} = 22\).

Median: After sorting: \(3,5,7,12,13,14,20,23,23,23,23,29,39,40,56\). The eighth term (since \(n=15\) is odd) is \(23\).

Mode: The most frequent value is \(23\) (appears \(4\) times).

Mean=\(22\), Median=\(23\), Mode=\(23\).


Example 2

Set: \(4,8,6,5,3\).

Mean: \(\frac{4+8+6+5+3}{5} = \frac{26}{5} = 5.2\).

Deviations from the mean: \(4-5.2=-1.2\), \(8-5.2=2.8\), \(6-5.2=0.8\), \(5-5.2=-0.2\), \(3-5.2=-2.2\).

Squared deviations: \((-1.2)^2=1.44\), \((2.8)^2=7.84\), \((0.8)^2=0.64\), \((-0.2)^2=0.04\), \((-2.2)^2=4.84\).

Sum of squared deviations: \(1.44+7.84+0.64+0.04+4.84=14.8\).

Variance: \(S^2=\frac{14.8}{5-1}=\frac{14.8}{4}=3.7\).

Standard deviation: \(S=\sqrt{3.7}\approx1.92\).


Example 3

Data set: \(1,3,3,6,7,8,9,11,12,15,18\).

Number \(n=11\) (odd).

Median \(Q_2\): the sixth value after ordering (already sorted) is \(8\).

First quartile \(Q_1\): median of lower half (excluding median): \(1,3,3,6,7\) → the third value is \(3\).

Third quartile \(Q_3\): median of upper half: \(9,11,12,15,18\) → the third value is \(12\).

Interquartile range: \(IQR=Q_3-Q_1=12-3=9\).


Example 4

Weighted mean: \(85\times40\%+70\times30\%+90\times30\%\).

Calculation: \(85\times0.4=34\), \(70\times0.3=21\), \(90\times0.3=27\).

Sum: \(34+21+27=82\).

Weighted mean: \(82\).


Example 5

Data set: \(5,7,8,9,10,11,12,13,15,42\).

Number \(n=10\) (even).

Mean: \(\frac{5+7+8+9+10+11+12+13+15+42}{10}=\frac{132}{10}=13.2\).

Median: average of the fifth and sixth elements after sorting: \(10\) and \(11\) → \(\frac{10+11}{2}=10.5\).

First quartile \(Q_1\): median of the lower half (\(5,7,8,9,10\)) → \(8\).

Third quartile \(Q_3\): median of the upper half (\(11,12,13,15,42\)) → \(13\).

Interquartile range: \(IQR=Q_3-Q_1=13-8=5\).

Lower bound for non-outliers: \(Q_1-1.5\timesIQR=8-1.5\times5=8-7.5=0.5\).

Upper bound for non-outliers: \(Q_3+1.5\timesIQR=13+1.5\times5=13+7.5=20.5\).

The value \(42\) is greater than \(20.5\), so it is an outlier.

Upper bound: \(20.5\).


Definitions

Arithmetic mean: sum of values divided by number of values, denoted by \(\bar{x}=\frac{\sum x_i}{n}\).

Median: the value that divides the ordered data set into two equal halves; if \(n\) is odd, it is the \(\frac{n+1}{2}\)th value; if even, it is the average of the \(\frac{n}{2}\)th and \(\frac{n}{2}+1\)th values.

Mode: the value that appears most frequently in the data set; there may be no mode or more than one mode.

Variance: the average of the squared deviations from the mean; for a sample, it is computed as \(S^2=\frac{\sum (x_i-\bar{x})^2}{n-1}\).

Standard deviation: the square root of the variance, \(S=\sqrt{S^2}\).

Quartiles: divide the ordered data set into four equal parts; \(Q_1\) is the median of the lower half, \(Q_2\) is the median, \(Q_3\) is the median of the upper half.

Interquartile range: \(IQR=Q_3-Q_1\), measures the spread of the middle half of the data.

Outliers: values that lie outside the interval \([Q_1-1.5\times IQR,\; Q_3+1.5\times IQR]\).

Weighted mean: \(\sum (x_i\times w_i)\) where \(w_i\) are the weights summing to \(1\) (or \(100\%\) if percentages are used).


Common Mistakes


Test tips

SVG

Box Plot

The box plot (Box Plot) is a graphical representation used to summarize the distribution of a numerical dataset by displaying key statistical values: the minimum (min), the first quartile (Q₁), the second quartile or median (Q₂), the third quartile (Q₃), and the maximum (max). This plot also shows the spread of the data and the presence of symmetry or skewness, and helps visually identify outliers.

In the box plot:

From the accompanying figure:

Thus, we can calculate:

Example 1: Reading values from a box plot

Solution: Step by step

  1. Locate the minimum on the horizontal axis: it is the leftmost line, at x = 80 → \( \text{min} = 80 \).
  2. Locate the first quartile Q₁: it is the left edge of the box, at x = 140 → \( Q₁ = 140 \).
  3. Locate the median Q₂: it is the line inside the box, at x = 190 → \( Q₂ = 190 \).
  4. Locate the third quartile Q₃: it is the right edge of the box, at x = 240 → \( Q₃ = 240 \).
  5. Locate the maximum: it is the farthest right line, at x = 300 → \( \text{max} = 300 \).
  6. Calculate IQR: \( \text{IQR} = Q₃ - Q₁ = 240 - 140 = 100 \).
  7. Calculate the range: \( \text{Range} = \text{max} - \text{min} = 300 - 80 = 220 \).

Answer: \( \text{min} = 80 \), \( Q₁ = 140 \), \( Q₂ = 190 \), \( Q₃ = 240 \), \( \text{max} = 300 \), \( \text{IQR} = 100 \), \( \text{Range} = 220 \).

Example 2: Interpreting the Box Plot Shape

Solution: Step by Step

  1. Notice that the line inside the box (Q₂) is not exactly centered: it is closer to the left edge of the box (between Q₁ and Q₃).
  2. This indicates that the data are right-skewed (positively skewed), because the median is closer to the first quartile.
  3. Also note that the maximum (300) is farther from Q₃ (240) than the minimum (80) is from Q₁ (140):
    • Distance from Q₃ to max: \( 300 - 240 = 60 \)
    • Distance from min to Q₁: \( 140 - 80 = 60 \)
  4. In this case, the distances are equal, but the position of Q₂ near Q₁ indicates a greater concentration of values in the lower quartile.
  5. Therefore, the distribution is slightly skewed to the right (positively skewed).

Answer: The distribution is skewed to the right (positively skewed) because the median is closer to the first quartile.

Common Errors

Test Tips


Comparison

In this section, we study measures of central tendency (mean, median, mode) and measures of dispersion (population variance and sample variance). We explain the definition of each measure, its properties, and how to calculate it, with detailed step-by-step examples, warnings about common mistakes, and test-taking tips.

Mean vs Median vs Mode

Property Mean Median Mode
Definition \(\frac{\sum_{i=1}^{n} x_i}{n}\) The value that divides the ordered data into two equal halves The value that occurs most frequently in the data set
Affected by outliers It is heavily affected by outliers because every value contributes to the sum. It is not affected by outliers because it depends only on the position of the value in the ordered list. It is not affected by outliers unless the outlier occurs more frequently than the original value.
A calculation for individual data. Sum all values and divide by the number of values. Arrange the data in ascending order; if \(n\) is odd, the median is the value at position \(\frac{n+1}{2}\); if \(n\) is even, the median is the average of the two values at positions \(\frac{n}{2}\) and \(\frac{n}{2}+1\). Count the frequency of each value; the value with the highest frequency is the mode; there may be no mode or there may be more than one mode.

Example 1: Calculating the mean, median, and mode for an individual data set.

Solution: Step by step.

  1. Given: The data set \( \{3, 7, 7, 2, 9\} \).
  2. Calculating the mean: we sum the values \(3+7+7+2+9 = 28\). The number of values \(n=5\). Therefore, the mean \(= \frac{28}{5} = 5.6\).
  3. Calculating the median: we arrange the data in ascending order: \( \{2, 3, 7, 7, 9\} \). Since \(n=5\) is odd, the middle position is \(\frac{5+1}{2}=3\). The value at the third position is \(7\). Therefore, the median \(=7\).
  4. Calculating the mode: we count the frequencies: \(2\) appears once, \(3\) appears once, \(7\) appears twice, \(9\) appears once. The highest frequency is \(2\) for the value \(7\). Therefore, the mode \(=7\).

Results: the mean \(=5.6\), the median \(=7\), the mode \(=7\).

Example 2: Calculating the mean, median, and mode for an even data set with an outlier

Solution: step by step

  1. Given: the data set \( \{10, 12, 14, 15, 100\} \).
  2. Calculating the mean: we sum the values \(10+12+14+15+100 = 151\). The number of values \(n=5\). Therefore, the mean \(= \frac{151}{5} = 30.2\).
  3. Calculating the median: we arrange the data in ascending order: \( \{10, 12, 14, 15, 100\} \). The middle position is \(\frac{5+1}{2}=3\). The value at the third position is \(14\). Therefore, the median \(=14\).
  4. Calculating the mode: each value appears only once, so there is no mode (or we say the data set has no mode).

Results: mean \(=30.2\) (affected by outlier \(100\)), median \(=14\) (unaffected), no mode.

Common Errors

Test Tips

Population variance vs sample variance

M Population σ² Sample S²
Definition \(\sigma^2 = \frac{\sum_{i=1}^{N} (x_i - \mu)^2}{N}\) where \(\mu\) is the population mean \(S^2 = \frac{\sum_{i=1}^{n} (x_i - \bar{x})^2}{n-1}\) where \(\bar{x}\) is the sample mean
Denominator \(N\) (population size) \(n-1\) (sample size minus one)
Purpose Measures the true variance of the entire population Provides an unbiased estimate of the population variance based on a sample

Example 3: Calculating population variance and sample variance for a complete dataset (population)

Solution: Step by step

  1. Given: A population consisting of the values \({4, 6, 8, 10}\). Population size \(N=4\).
  2. Calculate the population mean \(\mu\): \(\mu = \frac{4+6+8+10}{4} = \frac{28}{4} = 7\).
  3. Calculating deviations from the mean: \(4-7=-3\), \(6-7=-1\), \(8-7=1\), \(10-7=3\).
  4. Calculating squared deviations: \((-3)^2=9\), \((-1)^2=1\), \(1^2=1\), \(3^2=9\).
  5. Sum of squared deviations: \(9+1+1+9 = 20\).
  6. Calculating population variance \(\sigma^2\): \(\sigma^2 = \frac{20}{4} = 5\).

Results: Population mean \(\mu=7\), Population variance \(\sigma^2=5\).

Example 4: Calculating sample variance for a sample drawn from the previous population

Solution: Step by step

  1. Given: A random sample from the previous population: \( \{4, 8, 10\} \). Sample size \(n=3\).
  2. Calculating sample mean \(\bar{x}\): \(\bar{x} = \frac{4+8+10}{3} = \frac{22}{3} \approx 7.333\).
  3. Calculating deviations from the sample mean: \(4-\frac{22}{3} = -\frac{10}{3}\), \(8-\frac{22}{3} = \frac{2}{3}\), \(10-\frac{22}{3} = \frac{8}{3}\).
  4. Calculation of squared deviations: \(\left(-\frac{10}{3}\right)^2 = \frac{100}{9}\), \(\left(\frac{2}{3}\right)^2 = \frac{4}{9}\), \(\left(\frac{8}{3}\right)^2 = \frac{64}{9}\).
  5. Sum of squared deviations: \(\frac{100}{9} + \frac{4}{9} + \frac{64}{9} = \frac{168}{9} = \frac{56}{3} \approx 18.667\).
  6. Calculation of sample variance \(S^2\): \(S^2 = \frac{\frac{56}{3}}{3-1} = \frac{\frac{56}{3}}{2} = \frac{56}{6} = \frac{28}{3} \approx 9.333\).

Results: Sample mean \(\bar{x} \approx 7.333\), Sample variance \(S^2 = \frac{28}{3} \approx 9.333\).

Common Errors

Test Tips


Tips

CSCA Tips and Key Ideas

Practical shortcuts

Common Errors

ErrorCorrection
Dividing by \(n\) in sample variance\(S^2=\frac{\sum (x_i-\bar{x})^2}{n-1}\)
Confusing variance with standard deviation\(S=\sqrt{S^2}\)
Neglecting to order the data before computing the medianArrange the data in ascending order, then select the rank
Confusing the range with \(\text{IQR}\)\(\text{IQR}=Q_3-Q_1\)

Explanation and reason for each rule

  1. Reason for using \(n-1\) in sample variance: When calculating the sample mean \(\bar{x}\), one degree of freedom is lost because \(\sum (x_i-\bar{x})=0\) always holds, so the number of independent variables remaining is \(n-1\) only, and dividing by this number gives an unbiased estimate of the population variance \(\sigma^2\).
  2. Reason for defining standard deviation as the square root of variance: Variance is measured in squared units of the original data, so to restore the original unit of measurement, we take the square root. For example, if the data are in centimeters, the variance is in square centimeters and the standard deviation is in centimeters.
  3. Reason for calculating the median via ordering: The median divides the data into two equal halves after ordering, so it cannot be determined without first sorting; when the number of observations is odd, there is a single middle value, and when even, there is no unique middle value but rather the average of the two middle values.
  4. Reason for using \(1.5\,\text{IQR}\) in outlier detection: This criterion is based on the approximate normal distribution of data, where about \(99.3\%\) of the data lie within \([Q_1-1.5\,\text{IQR}, Q_3+1.5\,\text{IQR}]\), so values outside this range are considered very rare and likely due to errors or exceptional phenomena.

Step-by-step solved examples

  1. Example 1: Calculating sample variance and standard deviation for the data \(\{2,4,6,8\}\)
    Step 1: Calculate the mean \(\bar{x}=\frac{2+4+6+8}{4}=5\)
    Step 2: Calculate squared deviations from the mean \((2-5)^2=9\), \((4-5)^2=1\), \((6-5)^2=1\), \((8-5)^2=9\)
    Step 3: Sum the squares \(\sum (x_i-\bar{x})^2=9+1+1+9=20\)
    Step 4: Calculate the sample variance \(S^2=\frac{20}{4-1}=\frac{20}{3}\approx6.6667\)
    Step 5: Calculate the standard deviation \(S=\sqrt{\frac{20}{3}}=\frac{2\sqrt{15}}{3}\approx2.58199\)
    Result: The variance \(\frac{20}{3}\) and the standard deviation \(\frac{2\sqrt{15}}{3}\).
  2. Example 2: Determine the median and outliers of the data \(\{1,3,3,6,7,8,9,10,12\}\)
    Step 1: Ensure the data is sorted in ascending order (it is).
    Step 2: Calculate the number of elements \(n=9\) (odd)
    Step 3: Calculate the median rank \(\frac{n+1}{2}=\frac{9+1}{2}=5\)
    Step 4: The value at the fifth rank is \(7\), so the median \(=7\)
    Step 5: Calculate the first quartile \(Q_1\): median of lower half \(\{1,3,3,6\}\) is \(\frac{3+3}{2}=3\)
    Step 6: Calculate the third quartile \(Q_3\): median of upper half \(\{8,9,10,12\}\) is \(\frac{9+10}{2}=9.5\)
    Step 7: Calculate \(\text{IQR}=Q_3-Q_1=9.5-3=6.5\)
    Step 8: Calculate the lower outlier bound \(Q_1-1.5\,\text{IQR}=3-1.5\times6.5=3-9.75=-6.75\)
    Step 9: Calculate the upper outlier bound \(Q_3+1.5\,\text{IQR}=9.5+1.5\times6.5=9.5+9.75=19.25\)
    Step 10: Check each value: all values lie between \(-6.75\) and \(19.25\), so there are no outliers.
    Result: The median \(=7\), \(Q_1=3\), \(Q_3=9.5\), \(\text{IQR}=6.5\), and there are no outliers.

List of "Common Mistakes" with correction for each error

Test Tips

  1. Always check whether the required variance is population variance or sample variance; if the data are a sample from a larger population, use \(n-1\) in the denominator.
  2. After computing any variance, ask yourself: Are the units squared? If so, take the square root to obtain the standard deviation in the original data units.
  3. Before calculating the median or quartiles, sort the data in ascending order without exception; this prevents common sorting errors.
  4. When searching for outliers, first compute \(\text{IQR}\), then multiply by \(1.5\), and do not use the range for this purpose.
  5. When comparing the spread of two data sets with different units (e.g., centimeters and kilograms), compute the coefficient of variation \(\frac{S}{\bar{x}}\) for each set, then compare the dimensionless values.
  6. In questions containing frequency tables, remember that the median may lie within a class; use the formula \(L+\left(\frac{\frac{n}{2}-F}{f}\right)\times w\) where \(L\) is the lower limit of the median class, \(F\) is the cumulative frequency before the median class, \(f\) is the frequency of the median class, and \(w\) is the class width.
  7. Be sure to write symbols only inside \( ... \), and do not write any LaTeX commands outside the brackets; do not use * for multiplication, but use \(\times\) if necessary.

Exercises

Exercise 1

Given: \(12,15,18,20,22,25,30\). Mean ≈ \(20.29\). Median = \(20\).


Exercise 2

Given: \(2,4,6,8,10\). Variance \(S^2=10\). Standard deviation \(S≈3.16\).


Exercise 3

Given: \(2,4,4,5,6,7,8,9,10,12\). First quartile \(Q_1=4\). Second quartile (median) \(Q_2=6.5\). Third quartile \(Q_3=9\).


Exercise 4

Frequency table: \(5(2),6(4),7(6),8(5),9(3)\). Mean = \(\frac{143}{20}=7.15\).


Exercise 5

Given: \(5,7,8,9,10,11,12,13,15,42\). The value \(42\) is an outlier because the upper bound for non-outliers is \(20.5\).

Practise this lesson

Free · three languages · works offline

CSCA Academy — Independent CSCA exam preparation. الدروس · CSCA