Consider the standard linear regression model: $y_i = \alpha + \beta D_i + e_i$ where the coefficients are defined by linear projections and $D_i$ is a dummy variable. In the population, the coefficients are given by:
$$\alpha = E[y_i \mid D_i =0] \ \text{and} \ \beta = E[y_i \mid D_i = 1] - E[y_i \mid D_i =0]$$
Using OLS to estimate the coefficients, we get:
$$\widehat{\alpha} = \overline{y}_{D_i=0} $$
$$\widehat{\beta} = \overline{y}_{D_i=1}-\overline{y}_{D_i=0} $$
In other words, $\widehat{\alpha}$ is just the sample mean of $y_i$ in the subsample with $D_i=0$ and $\widehat{\beta}$ is the difference in sample means of the two groups. The expressions seem very obvious because they are just sample versions of the population, but my question is, how can we arrive at the above coefficient estimates by using the standard OLS formulas? That is using:
$$\widehat{\alpha} = \overline{y} - \overline{D}\widehat{\beta} \ \ \text{and} \ \ \widehat{\beta} = \frac{\sum_{i=1}^{N}(D_i - \overline{D})(y_i - \overline{y})}{\sum_{i=1}^{N}(D_i - \overline{D})^2}$$