I am trying to show that whether the Gini Impurity of a discrete probability distribution can be estimated by using an iid sample from the distribution. We have a distribution $p(c)$ and its Gini Impurity is given as: $$G = \sum_{c=1}^{L}p(c)(1-p(c)) = 1 - \sum_{c=1}^{L}p(c)^2$$
We have and iid sample $(x_1,\dots,x_n)$ and the impurity of this sample is: $$\hat{G} = 1 - \sum_{c=1}^{L}\left(\sum_{i=1}^{n}\dfrac{[x_i - c]}{n}\right)^2 = 1 - \dfrac{1}{n^2}\sum_{c=1}^{L}\left(\sum_{i=1}^{n}[x_i - c]\right)^2$$. $[.]$ is the indicator function giving $[0]=1$ and $0$ else.
Then I want to calculate the expectation of this sample impurity. I read somewhere else that when we multiply $\hat{G}$ by $\dfrac{n}{n-1}$, it becomes the unbiased estimator for $G$:
$$\mathbb{E}[\hat{G}]=1 - \dfrac{1}{n^2}\sum_{c=1}^{L}\mathbb{E}\left[\left(\sum_{i=1}^{n}[x_i - c]\right)^2\right]$$
$$\mathbb{E}[\hat{G}]=1 - \dfrac{1}{n^2}\sum_{c=1}^{L}\mathbb{E}\left[\left(\sum_{i=1}^{n}[x_i - c]^2 + \sum_{i=1}^{n}\sum_{j=1, j\neq i}^{n}[x_i-c][x_j-c]\right)\right]$$
$$\mathbb{E}[\hat{G}]=1 - \dfrac{1}{n^2}\sum_{c=1}^{L}\left(\sum_{i=1}^{n}\mathbb{E}\left[[x_i - c]^2\right] + \sum_{i=1}^{n}\sum_{j=1, j\neq i}^{n}\mathbb{E}\left[[x_i-c][x_j-c]\right]\right)$$
$$\mathbb{E}[\hat{G}]=1 - \dfrac{1}{n^2}\sum_{c=1}^{L}\left(\sum_{i=1}^{n}\mathbb{E}\left[[x_i - c]^2\right] + (n^2 - n)p(c)^2\right)$$
Now, I am stuck here. $\mathbb{E}\left[[x_i - c]^2\right]$ is not equal to $\mathbb{E}\left[[x_i - c]\right]^2$ and it does not lead to a straightforward simplification as far as I can see. Am I missing something here? I was expecting that the above evaluation would lead to $\mathbb{E}[\hat{G}]=\dfrac{n-1}{n}$G but this is incorrect it seems.