I have problem with my variance when i put 2,5,1,3 numbers result is 3,46 but correct is 2,18
double result=0;
string x1 = textBox1.Text;
string[] tab = x1.Split(',');
int n = tab.Length;
double sum = 0;
double ob = 0;
for (int i = 0; i < n; i++)
{
sum = sum + double.Parse(tab[i]);
result = sum / n;
ob = (ob + Math.Pow((double.Parse(tab[i]) - result),2)) / n;
}
textBox2.Text = ob.ToString();