University of Sydney · FACULTY OF STATISTICS

STAT5002 Chap.6 Probability Rules and Simulation

- one subject, every graph, every model, every mark
10 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 6 of 12 · STAT5002

Probability Rules and Simulation

Probability is the language every later topic in the unit is written in, from the box model to p-values, so this chapter makes the basic rules automatic. You start with the frequentist meaning of probability as a long-run proportion, then the set notation the notes use: the sample space, events, complements, unions and intersections. Four rules carry almost every calculation.

The complement rule turns hard "at least one" questions into easy "none" questions. Conditional probability, P(A | B) = P(A ∩ B) / P(B), restricts attention to the cases where B happened. The multiplication rule gives the chance that both events occur, and the addition rule gives the chance that at least one occurs once the overlap is subtracted.

The heart of the chapter is a clinic on two ideas that students routinely merge: mutually exclusive events cannot happen together, while independent events do not change each other's chances. A counter-example shows that two exclusive events with positive probability are always dependent, and a side-by-side grid lists which shortcut each condition allows. The last part moves to R.

You model a chance process as a box of tickets, draw from it with sample(), choose between replace = TRUE and replace = FALSE, wrap one experiment in a function and repeat it with replicate(). Taking mean() of the TRUE and FALSE results gives a simulated probability you can compare with the exact answer from the multiplication rule.

Along the way you will see the classic slip of multiplying unchanged chances when draws are made without replacement, and why the with-replacement answer is a different, larger number in that example. A library loans picture turns conditional probability into areas you can see. All scenarios and numbers are our own.

In this chapter

What this chapter covers

  • 01

    Frequentist definition of probability

  • 02

    Sample space, events, union, intersection and complement

  • 03

    Complement rule for at least one questions

  • 04

    Conditional probability as a share of the conditioning event

  • 05

    Multiplication rule, general and independent forms

  • 06

    Addition rule, general and mutually exclusive forms

  • 07

    Mutually exclusive versus independent events

  • 08

    Why exclusive events are dependent

  • 09

    Box models with and without replacement

  • 10

    Simulating probabilities in R with sample() and replicate()

Worked example · free

Bus then train: combining two chances that depend on each other

Q [5 marks]. A commuter takes a bus and then a train. On a given morning the bus is late with probability 0.2, the train is late with probability 0.3, and when the bus is late the train is late with probability 0.5. (a) Find the chance both are late. (b) Find the chance at least one is late. (c) Find the chance neither is late. (d) Are the two delays independent? (e) Given the train is late, what is the chance the bus was late? (5 marks. The mark allocation is ours, not the University's.)
A library example of our own, to scale.A library example of our own, to scale. Columns are borrower groups; each shaded height is a conditional probability, so each shaded area is a joint one. Unequal heights mean lateness and group are not independent.postgraduatewidth 0.40undergraduatewidth 0.600.060.180.15010.30late and postgraduatelate and undergraduateP(late) = 0.06 + 0.18 = 0.24P(postgraduate | late)= 0.06 / 0.24 = 0.25shaded height = P(late | group)shaded area = width × height
A library example of our own, to scale. Columns are borrower groups; each shaded height is a conditional probability, so each shaded area is a joint one. Unequal heights mean lateness and group are not independent.
  • +1Multiplication rule: P(both late) = P(bus late) × P(train late | bus late) = 0.2 × 0.5 = 0.10.
  • +1Addition rule: P(at least one late) = 0.2 + 0.3 − 0.10 = 0.40. The overlap is subtracted once because it was counted in both terms.
  • +1Complement: P(neither late) = 1 − 0.40 = 0.60.
  • +1Independence check: P(train late | bus late) = 0.5 but P(train late) = 0.3. They differ, so the delays are not independent; equivalently 0.2 × 0.3 = 0.06, which is not 0.10.
  • +1Conditional probability: P(bus late | train late) = P(both late) / P(train late) = 0.10 / 0.3 = 0.333.
Both late 0.10, at least one late 0.40, neither late 0.60; the delays are dependent, and P(bus late | train late) = 0.333.
Sia tip — Before you multiply two probabilities, write the word "given" in the second one; only drop it after you have checked that P(B | A) equals P(B), otherwise use the conditional value.
Glossary

Key terms

Sample space
The set of everything that can occur in a chance process, written Ω; every event is a subset of it.
Complement
The event that A does not occur, written Aᶜ, with probability 1 − P(A).
Conditional probability
The chance that A occurs given that B has occurred, equal to P(A ∩ B)/P(B) when P(B) is not zero.
Mutually exclusive events
Events that cannot occur together, so P(A ∩ B) = 0 and the addition rule reduces to P(A) + P(B).
Independent events
Events where one occurring does not change the chance of the other, so P(A ∩ B) = P(A)P(B), or equivalently P(A | B) = P(A).
Sampling without replacement
A way of drawing from a box where tickets are not put back, so each draw changes the box and the draws are dependent.
Random seed
A starting value set with set.seed() so that a simulation in R produces the same random draws every time it is run.
FAQ

Probability Rules and Simulation FAQ

What is the difference between mutually exclusive and independent events?

Mutually exclusive events cannot both happen, so their joint probability is zero. Independent events can happen together, and knowing one occurred leaves the chance of the other unchanged. Two exclusive events that each have positive probability are therefore always dependent.

When can I just multiply two probabilities together?

Only when the events are independent, for example separate draws made with replacement. In general the multiplication rule is P(A) times P(B given A), so if the first outcome changes the second chance you must use the conditional value.

How do I work out the probability of at least one success?

Work out the chance of no successes and subtract it from one. With independent trials, the chance of none is the failure probability raised to the number of trials. Adding the single-trial chances overcounts, and can even exceed one.

Why should I call set.seed() before simulating in R?

Functions such as sample() produce different random draws on every run, so a simulated probability changes slightly each time. Setting a seed first fixes the starting point, which means you, a marker or a classmate can rerun the code and see exactly the same table and proportion.

What does replace = FALSE do in sample() in R?

It draws tickets from the box without putting them back, so each draw changes what is left and the draws become dependent. Use replace = TRUE to model repeated independent trials such as die rolls or coin tosses.

Study strategy

Exam move

Write the four rules (complement, conditional, multiplication, addition) on one card, each with its general form and its shortcut, and next to each shortcut write the condition it needs. Practise on two-way count tables you invent: compute a joint probability, both conditionals and the product of the marginals, then decide on independence from the numbers rather than from intuition.

For every pair of events you meet, ask separately whether they can overlap and whether one changes the chance of the other. In R, write a five-line simulation for a problem you can also solve exactly, run it with set.seed(), compare mean() of the results with your hand answer, then switch between replace = TRUE and replace = FALSE and explain the change in one sentence.

Working through Probability Rules and Simulation in STAT5002? Sia is AskSia’s AI Statistics tutor — ask any STAT5002 Probability Rules and Simulation question and get a clear, step-by-step explanation grounded in how STAT5002 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 196 of your University of Sydney subjects - and 1,000+ Bibles across every Australian university.
Sia - your STAT5002 tutor, unlimited, worked the way the exam marks it
The full 3-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works