Skip to content

Chapter 4: Probability & Statistics

Reason about uncertainty and design statistically sound experiments—essential for ML and data science.


Metadata

Field Value
Track Foundation
Time 8 hours
Prerequisites Chapter 1 (Python Fundamentals)

Learning Objectives

  • Reason about uncertainty using probability
  • Understand distributions and their properties
  • Apply Bayes' theorem and Bayesian thinking
  • Design and interpret hypothesis tests
  • Build and evaluate A/B tests
  • Distinguish correlation from causation

What's Included

Notebooks

Notebook Description
01_introduction.ipynb Probability fundamentals, conditional probability
02_intermediate.ipynb Distributions, Bayes' theorem, Central Limit Theorem
03_advanced.ipynb Hypothesis testing, A/B testing, experiment design

Scripts

  • probability_toolkit.py — Probability and statistical functions

Exercises

  • 5 exercises with solutions (in solutions/ branch)

SVG Diagrams

  • 3 visual diagrams for distributions and concepts


Read Online

You can read the full chapter content right here on the website:

  • 04.1 Introduction -- Probability basics, conditional probability, law of large numbers
  • 04.2 Intermediate -- Distributions, Bayes theorem, Central Limit Theorem
  • 04.3 Advanced -- Hypothesis testing, confidence intervals, A/B testing capstone

Or try the code in the Playground.

How to Use This Chapter

Quick Start

Follow these steps to get coding in minutes.

1. Clone and install dependencies

git clone https://github.com/luigipascal/berta-chapters.git
cd berta-chapters
pip install -r requirements.txt

2. Navigate to the chapter

cd chapters/chapter-04-probability-statistics

3. Launch Jupyter

jupyter notebook notebooks/01_introduction.ipynb

GitHub Folder

All chapter materials live in: chapters/chapter-04-probability-statistics/

SciPy & Pandas

This chapter uses scipy and pandas. Both are in requirements.txt.


Created by Luigi Pascal Rondanini | Generated by Berta AI