Los ejercicios no son dificiles, mira, te dejo una ayudita:
double media(const signed int *vector, const unsigned int &n)
{
double sumatoria = 0.0;
for(unsigned int i = 0; i < n; i++)
sumatoria += vector[i];
sumatoria /= (double)n;
return sumatoria;
}
double varianza(const signed int *vector, const unsigned int &n)
{
double sumatoria = 0.0;
double _media = media(vector, n);
for(unsigned int i = 0; i < n; i++)
sumatoria += (vector[i] - _media) * (vector[i] - _media);
sumatoria /= (double)n;
return sumatoria;
}
double desviacion(const signed int *vector, const unsigned int &n)
{
return sqrt(varianza(vector, n));
}