Demonstrating the sampling distribution of mean differences ($\bar{d}$). We simulate 1000 individuals, each with a Pre-test and Post-test score. The population of difference scores ($D = X_{post} - X_{pre}$) has a true mean $\mu_D = 5$ and standard deviation $\sigma_D = 10$. We repeatedly draw 10 pairs to find the sample mean difference.
In a paired (dependent) $t$-test, each subject is measured twice (Pre and Post). Notice how a single sample draws a linked pair from both populations simultaneously. The test evaluates the difference scores ($D$) within each pair.
A paired-samples $t$-test is mathematically identical to performing a one-sample $t$-test on the column of difference scores. Here is why:
As you draw samples, the Estimated Standard Error ($s_D / \sqrt{n}$) varies from sample to sample because it relies on the sample's standard deviation ($s_D$). However, across 100 simulations, the average of these estimated standard errors closely approximates the true standard error (the empirical standard deviation of the sampling distribution on the right).