Read this lesson as text

Variance and Standard Deviation

Math for CS · Axiom Academy

Measuring spread and variability Expectation tells us the center of a distribution, but two distributions can have the same mean and look completely different. Variance measures how spread out a distribution is -- how far values typically deviate from the mean. Variance is the expected squared distance from the mean. Squaring ensures positive and negative deviations both count. Variance is in squared units, which can be hard to interpret. The standard deviation is the square root: Standard deviation is in the same units as X , making it directly meaningful. About 68% of values lie within Adding a constant b shifts the distribution but does not change spread. Multiplying by a scales variance by a^2 . This does NOT hold for dependent variables. (Compare with linearity of expectation, which always holds.) General Case (with Covariance) When X and Y are independent, , recovering the simpler formula. Variance in Algorithm Analysis A randomized algorithm with and is very reliable: it almost always finishes near 100. But E = 100 with means it might take 10 or 1000 on any given run. Low variance = predictable performance = better for real-time systems. is standard deviation (same units as X ) : constants shift, don't spread High variance = unpredictable; low variance = reliable Averaging n samples reduces variance by 1/n Axiom Academy | Probability for Computer Science

This is the written version of the interactive lesson above. See the full Math for CS course.