Hui Jeong(Hailyee) Ha

Human Mobility, Transportation & Spatial Data Science

All Geocomputation lectures

Lecture 4 · Probability

What are the chances?

What happens if we flip a fair coin, then try the same number of flips with a biased one?

From the lecture slides

Fair and biased coins · Slide 39
Fair and biased coins · Slide 39
The area under a normal curve · Slide 43
The area under a normal curve · Slide 43
Why a 95% interval uses 1.96 · Slide 54
Why a 95% interval uses 1.96 · Slide 54

Hi everyone! If the probability notation is hard to follow, try saying the question first. In the tea and coffee example, are we looking at everyone, or only at people who drink tea? Once we know which group we’re in, the calculation is easier to set up.

Follow the event through the example

We start with the prize spinner and then work through tea and coffee and car ownership. When the question gives you a condition, start by finding the group it tells you to look at. The denominator belongs to that group.

What would 100 flips usually look like?

In the coin graph, most results are near 50 heads when the coin is fair. Change the chance of heads to 0.75 and the results are now mostly near 75. Later, when we take many samples and draw their means, the standard error tells us how much the mean varies from sample to sample.

In R

These two calls answer different questions about five trials with a 0.40 success probability.

dbinom(2, size = 5, prob = 0.40)  # exactly 2
pbinom(2, size = 5, prob = 0.40)  # at most 2
pbinom(2, size = 5, prob = 0.40,
       lower.tail = FALSE)        # more than 2

Say the event in words first. That makes the difference between exactly, at most and more than easy to check.

Key takeaways

  • Write the event in words before you calculate its probability.
  • Standard deviation describes the spread of observations. Standard error describes how a statistic varies across samples.