AJ Design Engineering Software Home Page
  Home    Page 2    Page 3    Page 4    Page 5    Physics    Math    Fluid Mechanics    Investment Finance     Loan Calculator     Nursing Math



AJ PHP Software Source Code Statistics Library
Standard Deviation of a Population


number standard_deviation_population ( number_array )

Description:

standard_deviation_population returns the standard deviation given the population.

population standard deviation equation

Source Code:

function standard_deviation_population ($a)
{
  //variable and initializations
  $the_standard_deviation = 0.0;
  $the_variance = 0.0;
  $the_mean = 0.0;
  $the_array_sum = array_sum($a); //sum the elements
  $number_elements = count($a); //count the number of elements

  //calculate the mean
  $the_mean = $the_array_sum / $number_elements;

  //calculate the variance
  for ($i = 0; $i < $number_elements; $i++)
  {
    //sum the array
    $the_variance = $the_variance + ($a[$i] - $the_mean) * ($a[$i] - $the_mean);
  }

  $the_variance = $the_variance / $number_elements;

  //calculate the standard deviation
  $the_standard_deviation = pow( $the_variance, 0.5);

  //return the variance
  return $the_standard_deviation;
}

Example:

<?
include ("ajstatistics.php");
$a = array(0, 1, 2, 3, 4, 5);

$standard_deviation = standard_deviation_population ($a);

echo "a[0] = $a[0]<br>";
echo "a[1] = $a[1]<br>";
echo "a[2] = $a[2]<br>";
echo "a[3] = $a[3]<br>";
echo "a[4] = $a[4]<br>";
echo "a[5] = $a[5]<br>";
echo "standard_deviation = $standard_deviation<br>";
?>


Run Example


binomial coefficient binomial coefficient
mean mean of a set of number
median median of a set of number
standard deviation population standard deviation of a population
standard deviation sample standard deviation of a sample
variance population variance of a population
variance sample variance of a sample

References - Books:


Subwoofer Box Software Downloads for Sealed, Ported and Bandpass
Salary Wage Pay Calculator - Jobs Career
Baby Infant Growth Charts - Weight Age Percentile
Engine Horsepower Calculator
Earned Value Project Management
Present Worth Economics Calculator
Constant Acceleration Motion Calculator
Statistics Equations Formula Calculator
Mortgage Payment Finance Calculator
Weight Loss Formulas Calculator
Body Mass Index BMI Calculator
RGB Color Code Conversion Tool
Dog Age Calculator - How Old is Your Pet In Human Years?
Fluorescent Light Bulb Cost Analysis Calculator
Automobile Fuel Economy Calculator
Gasoline Diesel

Car Truck Tire Size Comparison Calculator

AJ Design - Online Science Mathematics Engineering Software Programs | 2 | 3 | 4 | 5

Technical Tools, Specifications, How to Guides, Applications, Examples, Tutorials, Answers, Resources, Analysis, Homework Solutions, Help, Data and Information for Engineers, Technicians, Teachers, Researchers, K-12 Education, College and High School Students and Scientists

contact email

Privacy Policy, Disclaimer and Terms

Copyright 2002-2007