The arithmetic mean is defined as the average of a set of data. mybloggingplanet.com

It is found by taking the sum of each value in the data set, and then dividing by the total number of data points.

		public static double ArithmeticMean(double[] data, int items)
		{
			int i;
			double mean, sum;

			sum = 0.0;

			for (i = 0; i < items; i++)
			{
				sum  += data[i];
			}

			
			mean =  sum / (double)items;
			return mean;
		}
Share