He Wang
  • Home
  • Teaching
  • Research
  • Talks
  • Resources
  • CV

Contents

  • Interactive Simulations
    • Probability Theory
    • Statistics
    • Linear Algebra
    • Machine Learning

Interactive Simulations

Probability, Statistics, Linear Algebra, and Machine Learning

Interactive Simulations

These interactive simulations help students visualize core ideas in probability, statistics, linear algebra, and machine learning. They are designed for classroom demonstrations, self-study, and exploratory learning.

Use this page as a teaching hub: students can first review the concept in lecture, then open a simulation, change parameters, observe patterns, and connect the visual behavior back to formulas and theory.

Probability Theory

Probability theory becomes more intuitive when students can repeatedly simulate random experiments and compare empirical behavior with theoretical predictions.

Central Limit Theorem preview

Central Limit Theorem

Explore how the distribution of sample means approaches a normal distribution as the sample size increases, regardless of the original population distribution.

View Simulation

Monte Carlo pi estimation preview

Monte Carlo \(\pi\) Estimation

Use random sampling to estimate \(\pi\) by generating points in a square and counting how many fall inside an inscribed circle.

View Simulation

Monty Hall simulation preview

Monty Hall Problem

Test the famous probability puzzle and compare the long-run winning rates for switching versus staying with the original choice.

View Simulation

Buffon's Needle preview

Buffon’s Needle

Estimate \(\pi\) by dropping random needles on parallel lines and observing the crossing frequency.

View Simulation

Cauchy distribution preview

Cauchy Distribution

Visualize how a random angle transformation can produce the heavy-tailed Cauchy distribution.

View Simulation

Hypergeometric urn experiment preview

Hypergeometric Urn Experiment

Study sampling without replacement from a finite population and compare simulated outcomes with the hypergeometric distribution.

View Simulation

Rat in a maze preview

Rat in a Three-Door Maze

Use conditional expectation and Monte Carlo simulation to analyze the expected time for a rat to exit a three-door maze.

View Simulation

Negative binomial simulation preview

Negative Binomial Simulation

Model the number of failures before reaching a fixed number of successes in independent Bernoulli trials.

View Simulation

Bayesian coin flip preview

Bayesian Coin Flip

See how Bayesian inference updates beliefs about a coin’s fairness as additional flips are observed.

View Simulation

Statistics

These simulations support statistical reasoning by showing sampling variability, confidence, hypothesis testing, experimental comparison, and model assumptions.

Confidence interval simulation preview

Confidence Interval Simulation

Generate repeated confidence intervals and observe the long-run coverage behavior relative to the true population mean.

View Simulation

Hypothesis testing simulation preview

Hypothesis Testing Simulation

Visualize critical regions, test statistics, \(p\)-values, Type I error, Type II error, and power.

View Simulation

A/B testing simulation preview

A/B Testing Simulation

Compare control and treatment variants, study lift, confidence intervals, statistical significance, and power analysis.

View Simulation

Gambler's ruin simulation preview

Gambler’s Ruin Problem

Simulate a gambler’s random walk until ruin or success and compare with theoretical absorption probabilities.

View Simulation

ANOVA assumptions simulation preview

One-Way ANOVA Assumptions

Explore normality, homogeneity of variance, and independence in the context of one-way ANOVA.

View Simulation

ANOVA simulation preview

ANOVA Simulation

Generate group data, run ANOVA, inspect effect size, and connect between-group and within-group variation.

View Simulation

Linear Algebra

Linear algebra is especially visual: matrices transform geometry, eigenvectors reveal stable directions, singular values organize information, and Markov chains describe long-run structure.

2D matrix transformations preview

2D Matrix Transformations

Visualize how matrices rotate, scale, shear, reflect, and project shapes in the plane.

View Simulation

Principal component analysis preview

Principal Component Analysis

Generate two-dimensional data, compute principal components, and visualize eigenvectors as directions of maximum variance.

View Simulation

SVD image compression preview

SVD Image Compression

Use singular value decomposition to compress an image and observe the tradeoff between rank, compression, and retained structure.

View Simulation

Markov chains and PageRank preview

Markov Chains and PageRank

Explore random walks, transition matrices, stationary distributions, and PageRank values on directed graphs.

View Simulation

Machine Learning

These simulations connect algorithms to geometry, optimization, statistical learning, and neural-network computation.

Linear regression simulation preview

Linear Regression

Generate noisy data, fit a line, and understand residuals, least squares, fitted slope, intercept, and \(R^2\).

View Simulation

Gradient descent simulation preview

OLS vs Gradient Descent

Compare the closed-form ordinary least squares solution with iterative gradient descent for linear regression.

View Simulation

K-means clustering preview

K-Means Clustering

Watch the K-means algorithm iteratively assign points to clusters and update centroids until convergence.

View Simulation

Bias-variance tradeoff preview

Bias-Variance Tradeoff

Study how model complexity, noise, and sample size affect bias, variance, and prediction error.

View Simulation

Neural network training preview

Neural Network Training

Observe a small neural network learn the XOR function through forward propagation, backpropagation, and gradient descent.

View Simulation

Neural network convolution visualizer preview

Neural Network Convolution Visualizer

Watch how convolutional filters move across input data and transform it into feature maps.

View Simulation