 # Variance Formula

In probability theory and statistics, the variance formula measures how far a set of numbers are spread out. It is a numerical value and is used to indicate how widely individuals in a group vary. If individual observations vary considerably from the group mean, the variance is big and vice versa.

A variance of zero indicates that all the values are identical. It should be noted that variance is always non-negative- a small variance indicates that the data points tend to be very close to the mean and hence to each other while a high variance indicates that the data points are very spread out around the mean and from each other.

## Variance Formulas

Variance can be of either grouped or ungrouped data. To recall, a variance can of two types which are:

• Variance of a population
• Variance of a sample

The variance of a population is denoted by σ2 and the variance of a sample by s2.

## Variance Formulas for Ungrouped Data

### Formula For Population Variance

The variance of a population for ungrouped data is defined by the following formula:

• σ2 = ∑ (x − x̅)2 / n

### Formula for Sample Variance

The variance of a sample for ungrouped data is defined by a slightly different formula:

• s2 = ∑ (x − x̅)2 / n − 1

Where,

σ2 = Variance

x = Item given in the data

x̅ = Mean of the data

n = Total number of items

s2 = Sample variance

## Variance Formulas for Grouped Data

### Formula for Population Variance

The variance of a population for grouped data is:

• σ2 = ∑ f (m − x̅)2 / n

### Formula for Sample Variance

The variance of a sample for grouped data is:

• s2 = ∑ f (m − x̅)2 / n − 1

Where,

f = frequency of the class

m = midpoint of the class

Summary:

Variance Type For Ungrouped Data For Grouped Data
Population Variance Formula σ2 = ∑ (x − x̅)2 / n σ2 = ∑ f (m − x̅)2 / n
Sample Variance Formula s2 = ∑ (x − x̅)2 / n − 1 s2 = ∑ f (m − x̅)2 / n − 1

Also Check: Standard Deviation Formula

### Variance Formula Example Question

Question: Find the variance for the following set of data representing trees heights in feet: 3, 21, 98, 203, 17, 9

Solution:

3 + 21 + 98 + 203 + 17 + 9 = 351

351 × 351 = 123201

…and divide by the number of items. We have 6 items in our example so:

123201/6 = 20533.5

Step 3: Take your set of original numbers from Step 1, and square them individually this time:

3 × 3 + 21 × 21 + 98 × 98 + 203 × 203 + 17 × 17 + 9 × 9

9 + 441 + 9604 + 41209 + 289 + 81 = 51,633

Step 4: Subtract the amount in Step 2 from the amount in Step 3.

51633 – 20533.5 = 31,099.5

Set this number aside for a moment.

Step 5: Subtract 1 from the number of items in your data set. For our example:

6 – 1 = 5

Step 6: Divide the number in Step 4 by the number in Step 5. This gives you the variance:

31099.5/5 = 6219.9

Step 7: Take the square root of your answer from Step 6. This gives you the standard deviation:

√6219.9 = 78.86634