# Intuition/proof that the input into chi-square goodness-of-fit test is standard normal.

Looking for an easy proof/intuition for the fact* that (assuming $$E_i$$):

$$\sqrt{\frac{({O_i-E_i})^2}{E_i}} = \frac{{O_i-E_i}}{\sqrt{E_i}} \sim N(0,1)$$

A similar question exits but is not as concrete as this one.

*The $$\chi^2$$-distribution is defined as the distribution of a sum of the squares of k independent standard normal random variables.

By exploring connections among the binomial, normal, and chi-squared distributions, one can answer.

$$Y∼Bin(n,p)$$ i.e. random variable $$Y$$ is number of successes in $$n$$ trials, with probability of success in a trial being $$p$$.

Assume $$n$$ and $$p$$ are such that $$Y$$ is well approximated by a normal distribution with mean = $$np$$ and variance = $$np(1-p)$$

Let's say $$Y$$ to be number of successes then,

$$(Y−E(Y))^2/Var(Y)$$ (i.e. square of standard normal.) will be approximately $$\sim\chi^2_1$$, where $$E(Y)=np$$ and $$Var(Y)=np(1−p)$$.

So $$(Y−np)^2/np(1−p)$$ will be approximately $$\sim\chi^2_1$$.

Using facts that $$(Y−np)^2=[(n−Y)−n(1−p)]^2$$ and the algebraic relation $$1/p+1/(1−p)=1/p(1−p)$$.

So,

$$\frac{(Y-np)^2}{np(1-p)}$$=$$\frac{(Y-np)^2}{np}+\frac{(Y-np)^2}{n(1-p)}$$ $$\quad= \frac{(Y-np)^2}{np}+\frac{[(n-Y)-n(1-p)]^2}{n(1-p)} \\ \quad= \frac{(O_S-E_S)^2}{E_S}+\frac{(O_F-E_F)^2}{E_F}$$

So, chi-square statistic $$\frac{(O_S-E_S)^2}{E_S}+\frac{(O_F-E_F)^2}{E_F}$$will have the distribution of the square of an approximately standard-normal random variable ex - $$(Y-np)/\sqrt{np(1-p)}$$