Data and probability — supplement

6 visual steps · 3 worked examples · 5 exercises with solutions

First, let’s see the idea.

Why is P(A and B) different from P(B given A)?

Move forward one step at a time. Change the values and observe what happens.

Change the reference group20 students: choose one at randomInitial universe: all 20 studentsA: 12Outside: 8
Drawing description

There are 20 circles, one for each student in the fictional sample: 12 in group A on the upper row and 8 outside A on the lower row.

Step 1 of 6

Define who can be selected

Count totals shown in both zones: together they give 20 students.

The 20 circles represent 20 fictional students. The upper zone contains group A; the lower contains everyone outside A. We draw one student so each has the same chance of selection.

12 + 8 = 20
Sample
20 students
Group A
12
Outside A
8

What if you change this?

4 of 2016 of 20
0 % requested100 % requested
0 % requested100 % requested

Before moving on

There are 12 students in A and 6 have B in a sample of 20. What are P(A and B) and P(B | A) in the uniform draw?

Compare with the explanation

P(A and B) = 6/20 = 30%. P(B | A) = 6/12 = 50%. The numerator is the same; the reference universe changes.

You decide when to mark this lesson as studied.

Change the reference group

Slide the drawing to see the details.

Explore the full explanationThe foundations, principles, worked examples and all the exercises, at your own pace.

What you will understand

  • Distinguish population, sample, variable and frequency and evaluate data collection.
  • Calculate and interpret measures of center and spread without hiding the distribution.
  • Use union, intersection and conditional probabilities while distinguishing independence from mutual exclusivity.
  • Interpret association between variables without concluding causation from correlation alone.

Before you start

You do not need to know everything by heart. The explanation revisits the necessary ideas and shows how they connect. If a foundation is still unclear, you can return to these lessons:

Foundations: what and whom are we observing?

The population is the set we want to learn about; a sample is the part we observe. If we want to study travel times of all students at a school, that is the population. The 40 students interviewed form a sample. Sample size matters, but so does selection: choosing only those arriving very early can bias collected times.

A variable is the characteristic recorded for each observed unit. Transport mode is qualitative; number of siblings is discrete quantitative; travel time is continuous quantitative even when rounded to minutes. Numerical category codes do not turn categories into quantities: averaging bus and walking codes does not produce a useful measure.

A random sample does not guarantee perfection, but helps avoid choices systematically favoring certain results. Randomly selecting people differs from randomly assigning a treatment: the first helps represent a population; the second helps compare causes in an experimental study. Survey nonresponse and different measurement methods can also distort conclusions.

Organize and represent a distribution

A value or class's absolute frequency is the number of observations belonging to it. Relative frequency divides that count by total n; percentage multiplies by 100. If 9 of 30 students use bicycles, relative frequency is 9/30 = 0,3 and percentage 30%. Absolute frequencies should sum to n and relative frequencies to 1, apart from small rounding effects.

For categories, a chart with separated bars shows counts or proportions. For a continuous variable grouped into intervals, a histogram uses adjoining bars. If class widths differ, each bar's area, not simply height, must represent frequency; an appropriate density is used. Always declare class boundaries so no observation belongs to no class or to two classes.

A graph needs a title, axes, units and readable scales. Truncating the vertical axis on a bar chart can exaggerate visual differences. Grouping data helps reading but loses information about values within each class. A mean calculated using class midpoints is generally an approximation, not the exact mean of the original data.

Mean, median and mode answer different questions

The arithmetic mean is the sum of values divided by observation count: x̄ = (x₁ + … + xₙ)/n. It can be interpreted as equal redistribution of the total. If each value xᵢ appears fᵢ times, the mean is the sum of products fᵢxᵢ divided by the sum of frequencies. Do not take the simple average of group means when group sizes differ.

The median requires ordered data. For odd n it is the middle value; for even n the average of the two middle values. A mode is a value with greatest frequency and may not be unique. In 2, 3, 3, 4, 18, the mean is 30/5 = 6, median 3 and mode 3. The extreme value 18 pulls the mean even though four of five values lie between 2 and 4.

No single measure is always best. The mean uses all magnitudes and is useful for totals; the median describes a central position less sensitive to the magnitude of extremes; the mode can describe the most frequent category. A conclusion should state which measure it uses and, where relevant, show distribution shape.

The same mean can hide variability

The lists 4, 5, 6 and 0, 5, 10 have mean 5, but the second is more spread out. Range is maximum minus minimum: 2 for the first and 10 for the second. This measure uses only two values. Interquartile range, Q₃ − Q₁, describes spread of the central half; the quartile calculation procedure must be declared because small samples have different conventions.

Standard deviation uses deviations from the mean. For a complete population of N values, variance is σ² = [Σ(xᵢ − μ)²]/N and standard deviation σ = √σ². The symbol Σ means summing the indicated terms and μ is population mean. Squares prevent positive and negative deviations cancelling. The root returns the data's original unit.

When using a sample of n > 1 values to estimate population variance, the usual formula is s² = [Σ(xᵢ − x̄)²]/(n − 1), and s = √s². The different denominator serves estimation; the formula used must be stated. Zero standard deviation means all values are equal, not that their mean is zero.

Outcomes, events and observed frequencies

Sample space Ω contains possible outcomes of a random experiment. Event A is a subset of Ω. Probability P(A) lies between 0 and 1, with P(Ω) = 1. If elementary outcomes are finite and equally likely, P(A) = number of favorable outcomes divided by number of possible outcomes. Equal likelihood is an assumption, not a consequence of simply listing outcomes.

For an ideal six-sided die, Ω = {1, 2, 3, 4, 5, 6}. The event “even” has three outcomes, hence probability 3/6 = 1/2. Complement Aᶜ contains outcomes outside A and has probability 1 − P(A). In union A ∪ B, either event occurring is sufficient; in intersection A ∩ B, both must occur.

The rule P(A ∪ B) = P(A) + P(B) − P(A ∩ B) subtracts the part counted twice. An observed frequency of 47 even results in 100 throws is 0,47, not an automatic change in theoretical probability 0,5. Over many independent repetitions under the same model, relative frequencies tend to approach probability; there is no requirement to immediately compensate for a sequence of results.

Conditional probability: who stays in the denominator

P(A | B) means probability of A given B occurred. The information restricts the universe to B. The denominator therefore becomes the probability of B, which must be positive:

P(A | B) = P(A ∩ B)/P(B), for P(B) > 0.

If we randomly choose a student among 40, of whom 25 use public transport and 10 of those 25 arrive before 7, the probability of arrival before 7 given public-transport use is 10/25. Dividing by 40 would answer “uses public transport and arrives before 7”, not the conditional question.

The multiplication rule is P(A ∩ B) = P(B)P(A | B). A and B are independent when knowing one does not change the other's probability; equivalently P(A ∩ B) = P(A)P(B). They are mutually exclusive if they cannot occur together, meaning A ∩ B is empty. Two positive-probability mutually exclusive events are not independent: knowing one occurred makes the other impossible.

In draws without replacement, the set's composition changes and subsequent probabilities must be recalculated. With replacement and a new random selection under the same conditions, independence is possible. The assumption needs justification; “they happen at different times” is insufficient.

Correlation, causation and critical reading

A scatterplot places observation pairs (x, y) and helps reveal positive or negative association, absence of a linear pattern or a curved relationship. Linear correlation coefficient r, when defined, ranges from −1 to 1 and describes direction and strength of linear association. A value near zero does not rule out a nonlinear relationship.

Correlation does not demonstrate causation. In a hypothetical observation, students with more study hours may achieve higher results, but motivation, available support or prior knowledge can influence both variables. Reverse causation or participant selection may also occur. A fitted line describes association; it does not prove that changing x alone will produce the predicted change in y.

Before generalizing, ask who was observed, how data were obtained, which comparisons are fair and which factors were omitted. Do not extrapolate a trend to ages, times or quantities far beyond the data without an additional reason. A responsible statistical answer combines calculation, description of conditions and clear limits on what observations allow us to conclude.

Worked examples, without skipping steps

Follow the reasoning first. Then cover the solution and try to reconstruct it in your own words.

Example 1

Center and spread with a declared population

Consider the five values 2, 4, 4, 4, 6 as the entire population studied. Calculate mean, median, mode, range and population standard deviation.
  1. The sum is 20 and N = 5, so μ = 20/5 = 4. In the ordered list, the middle value is 4 and the mode is also 4.
  2. Range is 6 − 2 = 4. Deviations from the mean are −2, 0, 0, 0, 2.
  3. Squares sum to 4 + 0 + 0 + 0 + 4 = 8. Population variance is 8/5 = 1,6 and σ = √1,6 ≈ 1,265.
Result
Mean 4, median 4, mode 4, range 4 and population standard deviation approximately 1,265.
Check the result
The deviations sum to zero. If these data were a sample used to estimate variance, the divisor would be 4, not 5.

Example 2

The denominator depends on information

Among 50 participants, 30 play sport, 20 play an instrument and 12 do both. One person is chosen at random. Calculate P(instrument | sport) and P(sport ∪ instrument).
  1. Define D as sport and I as instrument. Given D, we have 30 people, of whom 12 also belong to I.
  2. P(I | D) = 12/30 = 0,4. The intersection in the whole population has probability 12/50 = 0,24.
  3. The union contains 30 + 20 − 12 = 38 people; P(D ∪ I) = 38/50 = 0,76.
Result
Conditional probability is 40% and union probability 76%.
Check the result
P(D)P(I | D) = (30/50)(12/30) = 12/50, recovering the intersection. Eight people play an instrument without sport; adding them to 30 gives 38.

Example 3

Drawing without replacement

A bag contains 4 blue and 3 white tokens, indistinguishable by touch. Two are drawn randomly without replacement. What is the probability both are blue?
  1. On the first draw, blue probability is 4/7, assuming all tokens equally selectable.
  2. If the first was blue, 3 blue tokens remain among 6 total; conditional probability of a second blue is 3/6.
  3. Multiply along this sequence: (4/7)(3/6) = 12/42 = 2/7.
Result
Probability is 2/7, approximately 28,57%.
Check the result
With replacement it would be (4/7)² = 16/49, a different value. Without replacement, removing a blue reduces the blue proportion for the second selection.

Now try it yourself

There is no timer. Write what you know, choose a relationship and justify each step. Hints and solutions are available whenever you need them.

Exercise 1

Does a survey among friends of a sports team automatically represent the whole school?
A hint
Evaluate selection method, not just response count.
See the worked solution
No. The group may share interests and habits differing from other students, creating selection bias. Increasing the number of friends from the same team does not necessarily eliminate it. A sample covering the population of interest must be planned.

Exercise 2

A group of 10 students has mean 12 and another group of 30 has mean 16. What is their combined mean?
A hint
Recover the total values in each group.
See the worked solution
Total is 10 × 12 + 30 × 16 = 120 + 480 = 600. There are 40 students, so combined mean is 600/40 = 15. The simple mean 14 would treat differently sized groups as equally weighted.

Exercise 3

For an ideal die, A is an even result and B a number greater than 4. Calculate union probability.
A hint
The intersection contains outcome 6.
See the worked solution
P(A) = 3/6 and P(B) = 2/6. Since A ∩ B = {6}, P(A ∪ B) = 3/6 + 2/6 − 1/6 = 4/6 = 2/3. The union is {2, 4, 5, 6}, confirming the count.

Exercise 4

If P(A) = 0,5, P(B) = 0,4 and P(A ∩ B) = 0,2, are the events independent? Are they mutually exclusive?
A hint
Compare the intersection with the product and with zero.
See the worked solution
The product is 0,5 × 0,4 = 0,2, equal to the intersection, so they are independent. They are not mutually exclusive because the intersection has positive probability. Also, P(A | B) = 0,2/0,4 = 0,5 = P(A).

Exercise 5

A study finds association between books at home and grades. Can it claim that giving books alone necessarily increases grades?
A hint
Distinguish observed association from an intervention's effect.
See the worked solution
No. The association may involve reading habits, family support, resources and prior knowledge. Estimating a causal effect would require a study design addressing these factors and relationship direction. Correlation can suggest a hypothesis, but is insufficient to prove an intervention's effect.

Mistakes worth avoiding

A large sample eliminates every bias.
Systematically partial selection can retain bias even with many observations.
The mean describes the whole distribution.
Spread, asymmetry, extremes and context must be examined.
In a conditional probability, always divide by the initial total.
Divide by the set or probability of the known condition.
Independence means two events cannot occur together.
That is mutual exclusivity; independence means information about one does not change the other's probability.
Correlation proves one variable causes the other.
Observed association permits confounding, reverse causation and other explanations.

The essentials to take with you

  • Collection and selection affect conclusion quality.
  • Center and spread describe different aspects of data.
  • Observed frequency and theoretical probability are not the same thing.
  • Conditioning information changes the relevant universe and denominator.
  • Independence, mutual exclusivity and causation are different ideas.

If you still cannot explain one of these ideas, return to the corresponding section and work through an example again. Recognising the difficulty is part of studying.

References for further study

Text and examples prepared for this learning path. These sources help check the principles and continue studying:

The organisation by school year is a study proposal. Pedagogical review by teachers remains a stage of the project.