Page 292 - AI Ver 3.0 Class 11
P. 292

Step 2:  Square of all the differences.
                                                     10   8   10   8   8   4
                                                      − 8 − 8 − 8  − 8 − 8 − 8
                                                      2 2  0 2  2 2  0 2  0 2  4 2
                                                       4  0    4   0   0   16

              Step 3:  Add all the squared numbers together. This number is called the sum of squares.
                                                      10   8   10   8   8   4
                                                       − 8 − 8 − 8  − 8 − 8 − 8
                                                       2 2  0 2  2 2  0 2  0 2  4 2
                                                       4 +  0 +  4 +  0 +  0 +  16
                                                       = 24

              Step 4:  Divide the sum of squares by sample size -1 i.e. (n-1).

                                                        24 ÷ N – 1 = 24 ÷ 5
                                                        VARIANCE = 4.8
              This value is the variance.

              Standard Deviation
              Standard deviation is a statistics measure, that measures the degree of dispersion of a dataset relative to its average.
              When determining the deviation of each data point from the average, the standard deviation is calculated as the
              square root of the variance. If the data points are farther from the mean, the deviation in the data would be greater
              therefore, the data, would be more spread out, the larger is the standard deviation.
              Using the previous example, we have to calculate the square root of the variance in order to find the standard derivation.

                                                 VARIANCE = 4.8

                                                 STANDARD DEVIATION = 4.8  =  2.19

              Some key facts concerning variance and standard deviation
                 • Small variance suggests data points are close to the mean and to each other.
                 • High variance suggests data points are widely dispersed from the mean and to one another.

                 • Data points with a low standard deviation are near to the mean, whereas those with a high standard deviation show
                 a wide range of values.

              Calculating Variance and Standard Deviation using Python
              Program 4: To calculate the variance and standard deviation in the weight of 25 students.

                 50.5, 55.2, 60.3, 65.8, 70.1, 75.6, 80.4, 85.7, 90.2, 95.5, 50.3, 55.8, 60.1, 65.4, 70.9, 75.2, 80.6, 85.3, 90.8,
               95.1,50.7, 55.9, 60.5, 65.2, 70.4


              import statistics
              # List of weights for 25 students
              weights = [50.5, 55.2, 60.3, 65.8, 70.1, 75.6, 80.4, 85.7, 90.2, 95.5,
                         50.3, 55.8, 60.1, 65.4, 70.9, 75.2, 80.6, 85.3, 90.8, 95.1,
                         50.7, 55.9, 60.5, 65.2, 70.4]




                    290     Touchpad Artificial Intelligence (Ver. 3.0)-XI
   287   288   289   290   291   292   293   294   295   296   297