# Estimating population SD when calculating t-statistic

I am currently taking an introductory statistics course on Udacity and I'm having trouble understanding the concept of the t-statistic. My current understanding of the t-Statistic is as follows:

If the population standard deviation is unknown, we can't calculate the Z-score. So, instead, we calculate a very similar statistic (i.e the t-score) using the sample Standard deviation in place of the population standard deviation. Is Bessels correction used when the sample standard deviation is used to estimate the population standard deviation?

Also, I've seen two forms of the equation for calculating the t-statistic.

$$t=\frac{\overline{x}- \mu _{0}}{S/ \sqrt{n} }$$

and

$$t=\frac{\overline{x}- \mu _{0}}{S/ \sqrt{n-1} }$$ mu = population mean x = sample mean n = sample size S = sample Standard deviation Which on of these is correct?

You want $$t=\frac{\bar{x}-\mu_0}{S/\sqrt{n}}$$ since if $x_1,\ldots,x_n$ are i.i.d normally distributed with mean $\mu_0$ and variance $\sigma^2$, then $t$ follows a $t$-distribution with $n-1$ degrees of freedom which enables you calculate $p$-values and confidence intervals. Note, however, that the factor $n-1$ appears within the sample standard deviation $S$ as $$S=\sqrt{\frac{1}{n-1}\sum_{i=1}^n(x_i-\bar{x})^2}.$$ This is to ensure that ${\rm E}[S^2]=\sigma^2$, i.e. that the estimator of the variance $S^2$ is unbiased.