prob-stats-lab course outline · Fundamentals of Probability & Statistics

Fundamentals of Probability and Statistics

Bachelor in Computer Science & Artificial Intelligence (BCSAI) · IE University · a 30-session, 6-ECTS first-year course on turning raw data into actionable information.

Statistics is the science of data — a mathematically grounded discipline that builds models, summarises and processes data, and quantifies uncertainty. The course opens with descriptive statistics, moves into probability, then studies the distributions of discrete and continuous random variables, and closes with joint distributions and sampling distributions. A parallel Python track (Colab, NumPy, SciPy, Monte Carlo) bridges theory and practice.

It lays the groundwork for later BCSAI courses — Fundamentals of Data Analysis, Algorithms and Data Structures, and Probability for Computer Science. The interactive demos on this site mirror the syllabus topics; each session below links to the matching visual where one exists.

Program
BCSAI — Computer Science & AI
Course code
FPS-CSAI.1.M.A
Area
Mathematics
Sessions
30
Credits
6.0 ECTS
Academic year
25–26
Degree course
First · Semester 1
Category
Basic
Language
English
Professor
Guillermo Corredor
Contact
gcorredor@faculty.ie.edu
Office hours
On request, by email

Learning objectives

The course provides the tools to delve into data sets and use that information at both a theoretical and an applied level. By the end, students should be able to:

Generic skills reinforced

Think analytically Think critically Solve problems in groups Use statistical software

Teaching methodology & assessment

IE's method is collaborative, active and applied: students build knowledge through a mix of lectures, discussion, in-class exercises and group work. The total workload is 150 hours.

Learning-activity workload

Lectures20.0% · 30h
Discussions6.7% · 10h
Exercises · async · field work13.3% · 20h
Group work30.0% · 45h
Individual studying30.0% · 45h

Total — 100% · 150 hours of dedicated student time.

Evaluation criteria

Final exam (closed-book, S30)30%
Computer exam (open-book, S29)20%
Midterm exam (closed-book, S15)20%
Problem sets20%
Class participation10%

A minimum of 3.5/10 on the Final Exam is required to pass, regardless of the weighted average. Exams are closed-book; Computer Exam & Problem Sets are open-book and permit GenAI.

What each component asks of you

AI policy, attendance & re-sit rules

Program — full session-by-session structure

Six topics across four modules, plus a parallel Python track and three assessment points, spanning all 30 live in-person sessions. Reading tags reference Devore (DEV) and Sundnes (Python).

live lecture session Python / lab session exam / review
M1 Descriptive Statistics Sessions 1–5 · Topic 1

Summarising data effectively: graphical methods and numerical summary measures, with the first hands-on Python set-up for scientific computing.

By the end of this module you can

  • Choose and read the right display (stem-and-leaf, dotplot, histogram, boxplot, scatterplot, bar/contingency) for a given data type.
  • Compute and interpret measures of location (mean, median, trimmed mean, quartiles) and of spread (range, IQR, variance, standard deviation).
  • Diagnose distribution shape and skew, and explain why the mean and median diverge under asymmetry.
  • Set up a reproducible Python/Colab notebook and reproduce these summaries with NumPy.
  • S1Introduction to the course · Descriptive Statistics

    Course set-up and start of Topic 1 — describing one- and two-variable data.

    • Graphical methods. Stem-and-leaf displays and dotplots preserve raw values; histograms bin them to reveal shape; boxplots compress a batch to its five-number summary; scatterplots and contingency tables/bar plots expose relationships between two variables.
    • Numerical summaries. The mean is the balance point of the data; the median is its midpoint; the sample proportion is a mean of 0/1 indicators; the variance measures average squared spread.

    Sample mean $\bar x=\frac{1}{n}\sum_{i=1}^{n}x_i$  ·  sample variance $s^2=\frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar x)^2$.

    Key ideaThe mean uses every value and is pulled by outliers; the median only depends on rank order and is robust. Comparing them is the quickest read on skew.

    Devore Ch.1 §1.1–1.4

    Populations & samples, pictorial/tabular displays, measures of location and of variability — the whole descriptive toolkit (S1–S3).

    ↳ demo: descriptive stats & boxplot
  • S2Descriptive Statistics (cont.)

    Continues graphical methods and numerical summaries — location, spread and variance.

    • Five-number summary & boxplots. Minimum, $Q_1$, median, $Q_3$, maximum; the box spans the interquartile range and whiskers flag potential outliers (beyond $1.5\times\mathrm{IQR}$).
    • Spread. Variance vs standard deviation, and why $n-1$ (degrees of freedom) makes $s^2$ an unbiased estimator of $\sigma^2$.

    Interquartile range $\mathrm{IQR}=Q_3-Q_1$; an observation is a suspected outlier if $xQ_3+1.5\,\mathrm{IQR}$.

    WorkedFor $\{2,4,4,4,5,5,7,9\}$: $\bar x=5$, $s^2=\tfrac{1}{7}\big[(2{-}5)^2+\dots+(9{-}5)^2\big]=4.57$, so $s\approx2.14$. The median is $4.5$ — slightly below the mean, hinting at a right tail.

    Devore Ch.1 §1.1–1.4

    Same sections — focus shifts to §1.3–1.4 (measures of location and variability).

    ↳ demo: mean vs median
  • S3Descriptive Statistics (cont.)

    Wrap-up of Topic 1: shape, skew and the relationship between measures of centre.

    • Shape & skew. Symmetric, right- (positive) and left- (negative) skewed distributions, and how tails drag the mean.
    • Centre under asymmetry. Right-skew typically gives mean $>$ median $>$ mode; the reverse for left-skew.

    Key idea"The mean chases the tail." Reporting median + IQR alongside mean + SD guards against a single summary misrepresenting a skewed batch.

    Devore Ch.1 §1.1–1.4

    Consolidation reading of Ch.1; revisit histogram shape descriptions in §1.2.

    ↳ demo: histogram, dotplot & skew
  • S4Python Intro — Jupyter & Google ColabPython

    Python Topic 0/1 set-up: scientific computing environment and notebooks.

    • Notebooks. Cells, kernels and the read–eval–print workflow; running Python in the cloud with Google Colab (no local install).
    • Python basics. Variables, types, lists and functions — the vocabulary the rest of the track builds on.

    Key ideaA notebook interleaves code, output and prose, which makes statistical work reproducible and easy to narrate — the same habit professional data analysts rely on.

    Sundnes — Scientific Programming with Python

    Sundnes Ch.1–2: getting started, variables, loops and functions; the Colab "technical note".

  • S5Python Topic 1 — Descriptive Statistics with PythonPython

    Implement descriptive statistics in code using NumPy.

    • NumPy arrays. Vectorised operations replace explicit loops; np.mean, np.median, np.std(ddof=1), np.percentile.
    • From formula to code. Re-deriving Topic 1's summaries on real arrays and checking them against hand calculations.

    Workedx = np.array([2,4,4,4,5,5,7,9]); x.mean()5.0; np.var(x, ddof=1)4.57 — matching the S2 example, now in one line.

    Sundnes — Scientific Programming with Python

    Sundnes Ch.5 (arrays & plotting with NumPy/Matplotlib) applied to descriptive statistics.

M2 Probability Sessions 6–8 · Topic 2

A mathematical framework for randomness and uncertainty — quantifying the likelihoods of outcomes.

By the end of this module you can

  • Model an experiment with a sample space and events, and apply the axioms and addition/complement rules of probability.
  • Count outcomes with the product rule, permutations and combinations, and use them for equally-likely probabilities.
  • Compute conditional probabilities, apply the multiplication rule, the law of total probability and Bayes' theorem.
  • Test events for independence and distinguish it from mutual exclusivity.
  • S6Probability — foundations

    Topic 2 begins: building the probabilistic model of an experiment.

    • Sample spaces & events. The sample space $S$ is the set of all outcomes; an event is a subset of $S$, combined with union, intersection and complement.
    • Axioms & properties. $P(A)\ge 0$, $P(S)=1$, countable additivity for disjoint events — yielding the complement and addition rules.

    Addition rule: $P(A\cup B)=P(A)+P(B)-P(A\cap B)$; complement: $P(A')=1-P(A)$.

    Key ideaEverything else in the chapter is bookkeeping on top of three axioms. For equally-likely outcomes, probability collapses to counting: $P(A)=|A|/|S|$.

    Devore Ch.2 — all sections

    Ch.2 §2.1–2.2: sample spaces, events and the axioms/properties of probability.

    ↳ demo: permutations vs combinations
  • S7Probability (cont.) — conditional & independence

    Conditional probability, the multiplication rule and independence in depth.

    • Conditioning. $P(A\mid B)$ rescales probability to the world in which $B$ has occurred; the multiplication rule reverses it.
    • Bayes & independence. Total probability partitions $S$; Bayes inverts conditioning; independence means $P(A\cap B)=P(A)P(B)$.

    $P(A\mid B)=\dfrac{P(A\cap B)}{P(B)}$  ·  Bayes: $P(A_i\mid B)=\dfrac{P(B\mid A_i)P(A_i)}{\sum_j P(B\mid A_j)P(A_j)}$.

    WorkedA test is 99% sensitive/95% specific for a disease with 1% prevalence. By Bayes, a positive result gives $P(\text{disease}\mid +)=\frac{.99(.01)}{.99(.01)+.05(.99)}\approx 0.17$ — the base rate dominates.

    Devore Ch.2 — all sections

    Ch.2 §2.4–2.5: conditional probability, Bayes' theorem and independence.

    ↳ demo: conditional probability & independence
  • S8Probability (cont.) — counting & applications

    Counting techniques applied to probability computations; consolidation of Topic 2.

    • Counting. The product rule, permutations (order matters) and combinations (order ignored) feed equally-likely probability calculations.
    • Putting it together. Mixed problems combining counting, conditioning and independence.

    Permutations $P_{n,k}=\dfrac{n!}{(n-k)!}$; combinations $\binom{n}{k}=\dfrac{n!}{k!\,(n-k)!}$.

    Key ideaAsk "does order matter?" first. Same selection, two answers: $\binom{n}{k}$ if not, $P_{n,k}$ if so.

    Devore Ch.2 — all sections

    Ch.2 §2.3: counting techniques, applied back to §2.1–2.5.

    ↳ demo: counting
M3 Random Variables & Probability Distributions Sessions 9–21 · Topics 3–4

The two fundamental kinds of random variable — discrete then continuous — their mass and density functions, expectation, variance, and the canonical distribution families. Includes the midterm and the SciPy Python track.

By the end of this module you can

  • Define a random variable and work with its PMF or PDF and its cumulative distribution function (CDF).
  • Compute expectation and variance, and apply the linearity of expectation and the variance-scaling rule.
  • Recognise and parameterise the canonical discrete families (Bernoulli, Binomial, Hypergeometric, Negative Binomial, Poisson) and continuous ones (Uniform, Normal, Lognormal, Exponential, Gamma).
  • Standardise normal variables, read normal-table/empirical-rule probabilities, and compute distribution quantities in SciPy.
  • S9Discrete Random Variables — Topic 3 begins

    Definition of a random variable, the probability mass function, expectation and variance.

    • Random variable & PMF. A function mapping outcomes to numbers; the PMF $p(x)=P(X=x)$ assigns probability to each value, summing to 1.
    • Expectation & variance. $E[X]$ is the long-run average; $\mathrm{Var}(X)$ measures dispersion around it.

    $E[X]=\sum_x x\,p(x)$  ·  $\mathrm{Var}(X)=E[X^2]-(E[X])^2$  ·  $\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X)$.

    Key ideaExpectation is linear ($E[aX+b]=aE[X]+b$) even when variables are dependent; variance is not, and shifts by $b$ leave it unchanged.

    Devore Ch.3 — all sections

    Ch.3 §3.1–3.3: random variables, PMFs/CDFs, expected values and variance.

    ↳ demo: binomial distribution
  • S10Discrete RVs (cont.) — Bernoulli & Binomial

    The Bernoulli and Binomial models; mean $np$ and variance $np(1-p)$.

    • Bernoulli. A single success/failure trial with parameter $p$ — the atom of the Binomial.
    • Binomial. Number of successes in $n$ independent identical trials; PMF, mean, variance and mode.

    $X\sim\mathrm{Bin}(n,p)$: $P(X=k)=\binom{n}{k}p^k(1-p)^{n-k}$, $E[X]=np$, $\mathrm{Var}(X)=np(1-p)$.

    Worked10 fair coin flips, $P(\text{exactly }6\text{ heads})=\binom{10}{6}(.5)^{10}=\tfrac{210}{1024}\approx0.205$; expected heads $=np=5$.

    Devore Ch.3 — all sections

    Ch.3 §3.4: the Binomial probability distribution.

    ↳ demo: binomial distribution
  • S11Discrete RVs (cont.) — Hypergeometric & Negative Binomial

    Sampling without replacement and waiting-time counts.

    • Hypergeometric. Successes in a sample of $n$ drawn without replacement from a finite population of $N$ with $M$ successes.
    • Negative Binomial. Number of failures before the $r$-th success — a "waiting-time" count.

    Hypergeometric: $P(X=k)=\dfrac{\binom{M}{k}\binom{N-M}{n-k}}{\binom{N}{n}}$, mean $n\frac{M}{N}$.

    Key ideaThe Binomial assumes replacement (constant $p$); the Hypergeometric corrects for finite populations and approaches the Binomial when $N\gg n$.

    Devore Ch.3 — all sections

    Ch.3 §3.5: the Hypergeometric and Negative Binomial distributions.

  • S12Discrete RVs (cont.) — Poisson

    The Poisson model for rare-event counts; mean $=$ variance $=\lambda$.

    • Poisson process. Counts of events in a fixed interval at constant rate, independent of disjoint intervals.
    • Binomial limit. Arises as $n\to\infty$, $p\to0$ with $np\to\lambda$.

    $X\sim\mathrm{Pois}(\lambda)$: $P(X=k)=\dfrac{e^{-\lambda}\lambda^k}{k!}$, $E[X]=\mathrm{Var}(X)=\lambda$.

    WorkedA call centre averages $\lambda=3$ calls/min. $P(\text{0 calls in a minute})=e^{-3}\approx0.050$; expecting equal mean and variance is the Poisson signature.

    Devore Ch.3 — all sections

    Ch.3 §3.6: the Poisson distribution and the Poisson process.

    ↳ demo: poisson distribution
  • S13Discrete RVs (cont.) — consolidation

    Comparing discrete families and choosing the appropriate model.

    • Model selection. Matching a real scenario to the right family by its generating mechanism (fixed $n$? replacement? counts over time?).
    • Moments review. Side-by-side expectation/variance across the discrete families.

    Key ideaIdentify the family from the story, not the numbers: "successes in $n$ fixed trials" → Binomial; "rare counts per interval" → Poisson; "draws without replacement" → Hypergeometric.

    Devore Ch.3 — all sections

    Whole-chapter review of Ch.3 ahead of the midterm.

  • S14Review session — Topics 1, 2 & 3Review

    Consolidation ahead of the midterm: descriptive statistics, probability, discrete RVs.

    FocusMixed problems that stitch the three topics together — e.g. summarising simulated data (T1), conditioning (T2), then identifying the generating discrete model (T3).

  • S15Midterm ExamExam · 20%

    Closed-book, covering Topics 1–3 (no Python). Laptop with proctoring + handheld calculator; one double-sided A4 formula sheet allowed. Date tentative — may shift to S16/S17.

    Covers Devore Ch.1–3. No GenAI permitted. Bring: proctored laptop, simple calculator, one A4 (two-sided) formula sheet.

  • S16Continuous Random Variables — Topic 4 begins

    PDFs and CDFs; expectation and variance for continuous variables.

    • Density & distribution functions. A PDF $f(x)\ge0$ integrates to 1; probabilities are areas under it, and $P(X=x)=0$ for any single point.
    • CDF. $F(x)=P(X\le x)$ is the running area, with $f=F'$.

    $P(a\le X\le b)=\int_a^b f(x)\,dx=F(b)-F(a)$  ·  $E[X]=\int x f(x)\,dx$.

    Key ideaFor continuous variables, only intervals carry probability. The CDF is the bridge between density and probability and is what software returns.

    Devore Ch.4 — all sections

    Ch.4 §4.1–4.2: probability density functions, CDFs, and expected values for continuous variables.

    ↳ demo: continuous PDF & CDF
  • S17Continuous RVs (cont.) — Normal distribution

    The normal density, standardisation and the 68–95–99.7 rule.

    • Standardisation. Any normal becomes the standard normal $Z\sim N(0,1)$ via the $z$-score, so one table/function serves all.
    • Empirical rule. ~68% / 95% / 99.7% of mass within 1 / 2 / 3 standard deviations.

    $z=\dfrac{x-\mu}{\sigma}$  ·  $f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-(x-\mu)^2/2\sigma^2}$.

    WorkedIQ $\sim N(100,15^2)$. $P(X>130)=P(Z>2)\approx0.0228$ — the upper ~2% tail, straight from the empirical rule.

    Devore Ch.4 — all sections

    Ch.4 §4.3: the normal distribution, the standard normal and normal-table use.

    ↳ demo: normal & the empirical rule
  • S18Continuous RVs (cont.) — Exponential & Gamma

    Continuous families beyond the normal; their densities and moments.

    • Uniform & Exponential. Constant density on an interval; the Exponential models waiting times and is memoryless.
    • Gamma & Lognormal. Sums of exponentials (Gamma); a variable whose log is normal (Lognormal), common for multiplicative/positive data.

    Exponential: $f(x)=\lambda e^{-\lambda x}$, $E[X]=1/\lambda$, $\mathrm{Var}(X)=1/\lambda^2$ for $x\ge0$.

    Key ideaThe Exponential is the continuous partner of the Poisson: if events arrive as $\mathrm{Pois}(\lambda)$, the gaps between them are $\mathrm{Exp}(\lambda)$.

    Devore Ch.4 — all sections

    Ch.4 §4.4: the Exponential and Gamma distributions (plus the Uniform and Lognormal cases).

    ↳ demo: continuous PDF & CDF
  • S19Python Topic 2 — Computing probabilities with SciPyPython

    Working with distributions in SciPy.

    • scipy.stats objects. A common interface across distributions: .pmf/.pdf, .cdf, and the inverse CDF .ppf (quantile function).
    • Replacing tables. Computing the S17 IQ probability or a critical value without a printed normal table.

    Workedfrom scipy.stats import norm; 1 - norm.cdf(130, 100, 15)0.0228; norm.ppf(0.975)1.96.

    Sundnes — Scientific Programming with Python

    Sundnes (NumPy/SciPy material): PMF/PDF, CDF and inverse-CDF evaluation in scipy.stats.

  • S20Continuous RVs (cont.)

    Further work with continuous distributions and their applications.

    • Applied practice. Reliability, lifetimes and measurement-error problems across the continuous families.
    • Quantiles. Reading percentiles and critical values off CDFs.

    Key idea"Probability vs quantile" are inverse questions: the CDF turns a value into a probability; its inverse (the ppf) turns a probability back into a value.

    Devore Ch.4

    Ch.4 applied problems; revisit §4.3–4.4.

  • S21Continuous RVs (cont.) — consolidation

    Wrap-up of Topic 4 and model selection for continuous data.

    • Model selection. Symmetric/bell-shaped → Normal; positive and right-skewed → Lognormal/Gamma; waiting times → Exponential.
    • Bridge to inference. Why the Normal recurs as a limit (sets up the CLT in Module 4).

    Key ideaMatch the support and shape to the data: a model defined on $[0,\infty)$ can never describe a quantity that goes negative.

    Devore Ch.4

    Whole-chapter review of Ch.4.

M4 Joint Probability Distributions · Statistics & their Distributions Sessions 22–30 · Topics 5–6

Working with several random variables at once, then the distributions of statistics — the foundation for inference. Closes with Monte Carlo, the computer exam and the final exam.

By the end of this module you can

  • Work with joint, marginal and conditional distributions of two or more random variables.
  • Compute covariance and correlation and interpret what they say (and don't say) about dependence.
  • Find the mean and variance of a linear combination, and state the sampling distribution of the sample mean.
  • Explain and apply the Law of Large Numbers and the Central Limit Theorem, and estimate probabilities by Monte Carlo simulation.
  • S22Joint Probability Distributions — Topic 5

    Working simultaneously with two or more random variables.

    • Joint, marginal & conditional. A joint PMF/PDF describes pairs $(X,Y)$; marginals recover one variable; independence means the joint factors.
    • Covariance & correlation. Covariance measures co-movement; correlation $\rho$ rescales it to $[-1,1]$.

    $\mathrm{Cov}(X,Y)=E[XY]-E[X]E[Y]$  ·  $\rho=\dfrac{\mathrm{Cov}(X,Y)}{\sigma_X\sigma_Y}$.

    Key idea$\rho$ captures only linear association: independence implies $\rho=0$, but $\rho=0$ does not imply independence.

    Devore Ch.5 §5.1–5.2

    Ch.5 §5.1 jointly distributed RVs; §5.2 expected values, covariance and correlation.

    ↳ demo: covariance, correlation & least squares
  • S23Statistics & their Distributions — Topic 6 begins

    Statistics as random variables and the distribution of the sample mean.

    • A statistic is random. Because it is computed from a random sample, a statistic such as $\bar X$ has its own sampling distribution.
    • Sample mean. Its centre and spread in terms of the population $\mu$ and $\sigma$.

    $E[\bar X]=\mu$  ·  $\mathrm{Var}(\bar X)=\sigma^2/n$  ·  standard error $=\sigma/\sqrt{n}$.

    Key ideaAveraging shrinks variance by a factor of $n$: the standard error falls like $1/\sqrt{n}$, so quadrupling the sample halves the spread.

    Devore Ch.5 §5.3–5.5

    Ch.5 §5.3: statistics and their sampling distributions.

    ↳ demo: Central Limit Theorem
  • S24Statistics & their Distributions (cont.) — sample mean

    The sampling distribution of $\bar X$ and the Central Limit Theorem.

    • Central Limit Theorem. For large $n$, $\bar X$ is approximately normal regardless of the population's shape.
    • Rule of thumb. $n\ge30$ is usually enough unless the population is very skewed.

    $\bar X \;\xrightarrow{\;n\to\infty\;}\; N\!\left(\mu,\dfrac{\sigma^2}{n}\right)$.

    WorkedRoll a die ($\mu=3.5,\sigma^2\approx2.92$) $n=50$ times. $\bar X$ is ≈$N(3.5, 0.0583)$, so $P(\bar X>4)\approx P(Z>2.07)\approx0.019$ — even though one roll is uniform, not normal.

    Devore Ch.5 §5.3–5.5

    Ch.5 §5.4: the distribution of the sample mean and the Central Limit Theorem.

    ↳ demo: Central Limit Theorem
  • S25Statistics & their Distributions (cont.) — linear combinations

    Distribution of a linear combination of random variables.

    • Mean & variance of $\sum a_i X_i$. Means always add linearly; variances add (with cross terms) and pick up the squared weights.
    • Normal stays normal. A linear combination of independent normals is itself normal.

    $E\big[\sum a_i X_i\big]=\sum a_i E[X_i]$; if independent, $\mathrm{Var}\big[\sum a_i X_i\big]=\sum a_i^2\mathrm{Var}(X_i)$.

    Key ideaThe $a_i^2$ in the variance is why differences are as variable as sums: $\mathrm{Var}(X-Y)=\mathrm{Var}(X)+\mathrm{Var}(Y)$ for independent $X,Y$.

    Devore Ch.5 §5.3–5.5

    Ch.5 §5.5: the distribution of a linear combination.

    ↳ demo: Law of Large Numbers
  • S26Statistics & their Distributions (cont.) — consolidation

    Wrap-up of Topic 6 and connections to inference.

    • LLN vs CLT. The LLN says $\bar X\to\mu$ (a point); the CLT describes the shape of $\bar X$'s fluctuations around $\mu$.
    • Why it matters. These results justify confidence intervals and hypothesis tests in later courses.

    Key ideaLLN = convergence of the average; CLT = the distribution of the error of that average. Together they are the engine of statistical inference.

    Devore Ch.5 §5.3–5.5

    Whole-section review of Ch.5 §5.3–5.5.

    ↳ demo: Law of Large Numbers
  • S27Python Topic 3 — Monte Carlo simulationPython

    Approximating probabilities by simulation.

    • Random number generation. Sampling from distributions with NumPy's default_rng; seeding for reproducibility.
    • Monte Carlo estimation. Approximating a probability or expectation as the fraction/average over many simulated draws.

    Workedrng = np.random.default_rng(0); (rng.standard_normal(1_000_000) > 2).mean() → ≈0.0228, the same tail as S17 — now by simulation, with error shrinking like $1/\sqrt{N}$ (the LLN at work).

    Sundnes — Scientific Programming with Python

    Sundnes (random numbers chapter): RNG and Monte Carlo approximation of probabilities.

    ↳ demo: Law of Large Numbers
  • S28Review session — Topics 1–6Review

    Comprehensive review ahead of the computer and final exams.

    FocusEnd-to-end problems: describe data, model it with the right distribution, reason about a statistic's sampling distribution, and verify by simulation.

  • S29Computer ExamExam · 20%

    Open-book exam: solving and discussing exercises on Python Topics 1, 2 & 3 (descriptive stats, SciPy probabilities, Monte Carlo). GenAI tools (e.g. Colab's Gemini) permitted but not required.

    Open-book; GenAI allowed but neither required nor sufficient for full marks. Assessed on correct, well-explained code and sound reasoning.

  • S30Final ExamExam · 30%

    Closed-book, comprehensive over Topics 1–6 (no Python). Laptop with proctoring + handheld calculator; two double-sided A4 formula sheets allowed. Minimum 3.5/10 required to pass the course.

    Covers Devore Ch.1–5. No GenAI. Bring: proctored laptop, simple calculator, two A4 (two-sided) formula sheets. Below 3.5/10 fails the course outright.

Key concepts — glossary

A quick-reference vocabulary spanning the six topics. Notation matches the sessions above.

Population vs sample
The full set of units of interest vs the observed subset we actually measure. Statistics estimate population quantities from a sample.
Mean $\bar x$ & median
The arithmetic average (sensitive to outliers) and the middle value by rank (robust). Their gap signals skew.
Variance $s^2$ & SD
Average squared deviation from the mean (using $n-1$); the standard deviation is its square root, in the data's units.
IQR & five-number summary
$Q_3-Q_1$ and the (min, $Q_1$, median, $Q_3$, max) tuple a boxplot draws; the basis of the $1.5\,$IQR outlier rule.
Skew
Asymmetry of a distribution. Right-skew has a long upper tail and pulls the mean above the median.
Sample space & event
The set $S$ of all outcomes of an experiment, and a subset $A\subseteq S$ whose probability we evaluate.
Conditional probability $P(A\mid B)$
Probability of $A$ once $B$ is known to occur: $P(A\cap B)/P(B)$.
Independence
Events with $P(A\cap B)=P(A)P(B)$; knowing one tells you nothing about the other. Not the same as mutually exclusive.
Bayes' theorem
Inverts conditioning to update a prior into a posterior: $P(A_i\mid B)\propto P(B\mid A_i)P(A_i)$.
Permutation vs combination
Ordered ($P_{n,k}$) vs unordered ($\binom{n}{k}$) selections of $k$ from $n$.
Random variable
A function assigning a number to each outcome; discrete (countable values) or continuous (an interval).
PMF / PDF
Probability mass function (discrete, $P(X=x)$) or probability density function (continuous, area = probability).
CDF $F(x)$
$P(X\le x)$ — the cumulative probability; its inverse (quantile / ppf) maps a probability back to a value.
Expectation $E[X]$
The probability-weighted long-run average value; linear: $E[aX+b]=aE[X]+b$.
Variance $\mathrm{Var}(X)$
$E[X^2]-(E[X])^2$; scales as $\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X)$.
Binomial
Successes in $n$ independent trials with probability $p$: mean $np$, variance $np(1-p)$.
Poisson
Rare-event counts at rate $\lambda$ per interval; mean $=$ variance $=\lambda$; the limit of the Binomial.
Hypergeometric
Successes when sampling without replacement from a finite population; the finite-population analogue of the Binomial.
Normal & standardisation
The bell-shaped $N(\mu,\sigma^2)$; the $z$-score $z=(x-\mu)/\sigma$ converts any normal to the standard $N(0,1)$.
Empirical rule
For a normal distribution, ≈68% / 95% / 99.7% of values lie within 1 / 2 / 3 standard deviations of the mean.
Exponential
Memoryless waiting time between Poisson events; mean $1/\lambda$.
Covariance & correlation $\rho$
Measures of linear co-movement; $\rho\in[-1,1]$ is the scaled, unit-free version.
Sampling distribution
The distribution of a statistic (e.g. $\bar X$) across repeated samples — what makes inference possible.
Standard error
The standard deviation of a statistic; for the sample mean, $\sigma/\sqrt{n}$.
Law of Large Numbers
As $n$ grows, the sample mean converges to the population mean $\mu$.
Central Limit Theorem
For large $n$, $\bar X$ is approximately normal whatever the population's shape — the cornerstone of inference.
Monte Carlo
Estimating a probability or expectation by averaging over many simulated random draws; error shrinks like $1/\sqrt{N}$.

Bibliography

Core textbook plus the recommended Python companion for the scientific-computing track. Each entry notes the sessions it supports.

Behaviour, attendance and ethics policies follow IE University's Code of Conduct, Attendance Policy and Ethics Code. An 80% attendance rule applies; four exam calls over two academic years.