Stop 02 · Math FoundationsTopics · 3/9

Probability Theory

Part of the Data Science Roadmap

In short

Data is full of chance: who clicks, who pays late, which delivery is delayed. Probability gives you a clear way to talk about 'how likely' instead of guessing.

The mathematical language for reasoning about uncertainty — combining probabilities, conditional probability, and Bayes' theorem — foundational for everything from Naive Bayes to model confidence.

The mascot throws a big dice over a colourful Ludo board.

Think of it like this

A game of Ludo

Everyone at home knows you need a six to start in Ludo, and that it feels rare. Probability puts a number on that feeling: 1 out of 6 faces. It also tells you how rare two sixes in a row are.

Watch it happen

One dice, a few events

1
0
2
1
3
2
4
3
5
4
6
5

1/5Six equally likely outcomes. Each has probability 1/6.

The big ideas

What you need to know

Between 0 and 1

0 means impossible, 1 means certain. All outcomes together add up to exactly 1.

Independent events multiply

If one doesn't affect the other, P(A and B) = P(A) × P(B).

Conditional probability

P(A | B) is the chance of A once you know B happened. It's how you update with new information.

Long-run frequency

Roll enough times and the share of sixes settles near 1/6. Simulations use this idea.

See it in code

Walk through the code

python
1import numpy as np2 3rng = np.random.default_rng(42)4rolls = rng.integers(1, 7, size=100_000)5 6print((rolls == 6).mean())           # close to 1/6 = 0.1677print((rolls % 2 == 0).mean())       # close to 0.58 9two = rng.integers(1, 7, size=(100_000, 2))10print((two == 6).all(axis=1).mean()) # close to 1/36 = 0.028

1/3Roll a fair dice 100,000 times. The upper limit 7 is excluded, so values are 1 to 6.

When maths gets tricky, simulate. A lakh of fake dice rolls lands very close to the exact answers.

Save yourself the pain

Common mistakes

Oops

Believing a six is 'due' after many rolls without one.

Do this instead

Dice have no memory. Each roll is still 1/6. This is the gambler's fallacy.

Oops

Adding probabilities of events that can happen together.

Do this instead

Add only for events that can't both happen. Otherwise subtract the overlap: P(A) + P(B) − P(A and B).

Your mission

Simulate a birthday surprise

~25 min

Quick check

A coin lands heads five times in a row. What's the chance the next flip is heads?

Go deeper

  1. 1Work through basic probability problems (dice, cards, simple events).
  2. 2Learn conditional probability with a concrete, worked example.
  3. 3Study Bayes' theorem and one classic application (e.g. medical testing false positives).

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge