The standard deviation of a discrete random variable can be found by taking the square root of its variance.

**Variance = E(X ^{2}) – E(X)^{2}.**

- E(X
^{2}) = Expected value of the square of the random variable. - E(X)
^{2}= Square of the expected value of the random variable.

The variance of a discrete random variable can be found by calculating the expected value of the square of the random variable and subtracting the square of the expected value of the random variable from it.

**Standard Deviation Formula (for a discrete random variable):**

Therefore the variance and the standard deviation for the discrete random variable can be calculated using the formula,

**Variance = E(X ^{2}) – E(X)^{2}.**

**Standard Deviation = √Variance = √(E(X ^{2}) – E(X)^{2}).**

Suppose that a discrete random variable X has probability mass function p(x) then the required expected values can be calculated as

**E(X) = Σx*p(x)**.

**E(X ^{2}) = Σx^{2}*p(x).**

This means that in order to find the expected value of a particular random variable we should multiply the value of the random variable with the corresponding probability and take the sum over all possible values of x.

Let us try to understand how we can calculate the standard deviation for a discrete random variable by looking at the following two examples.

**Example 1:**

Consider a discrete random variable X whose probability mass function p(x) is given as

X | Probability P(X) |

1 | 0.1 |

2 | 0.15 |

3 | 0.15 |

4 | 0.4 |

In order to calculate the standard deviation we first compute the required expected values as follows,

X | P(X) | X*P(X) | X^{2}*P(X) |

1 | 0.1 | 0.1 | 0.1 |

2 | 0.15 | 0.3 | 0.6 |

3 | 0.15 | 0.45 | 1.35 |

4 | 0.4 | 1.6 | 6.4 |

Total = 2.45 | Total = 8.45 |

From the above table, we now have that,

**E(X) = Σx*p(x) = 2.45.**

**E(X ^{2}) = Σx^{2}*p(x) = 8.45. **

Standard deviation = √(E(X^{2}) – E(X)^{2}) = √(8.45 – 2.45^{2})

= √2.4475 = **1.5644**.

**Example 2:**

It is also possible that a discrete random variable takes negative values.

For example, consider a discrete random variable X whose probability mass function p(x) is given as,

X | Probability P(X) |

-2 | 0.1 |

-1 | 0.1 |

0 | 0.3 |

1 | 0.2 |

2 | 0.3 |

We find the standard deviation as follows,

X | P(X) | X*P(X) | X^{2}*P(X) |

-2 | 0.1 | -0.2 | 0.4 |

-1 | 0.1 | -0.1 | 0.1 |

0 | 0.3 | 0 | 0 |

1 | 0.2 | 0.2 | 0.2 |

2 | 0.3 | 0.6 | 1.2 |

Total = 0.5 | Total = 1.9 |

**E(X) = Σx*p(x) = 0.5.**

**E(X ^{2}) = Σx^{2}*p(x) = 1.9. **

**Standard deviation = √(E(X ^{2}) – E(X)^{2}) = √(1.9 – 0.5^{2}) = 1.2845**