#### Exercise 2.2: More Statistics

```Given: four three-element arrays, a, b, c, and d, all containing real numbers;
the formulas for the mean and standard deviation
mean = (a+b+c+d)/4;
standard deviation = (((a-mean)**2 + (b-mean)**2 +
(c-mean)**2 + (d-mean)**2) / 3)**0.5```
Compose: a let-in statement that returns an array of records, each containing the mean and standard deviation of one of the given sets of numbers.
```let mean_a := (a + a + a)/3.0;
mean_b := (b + b + b)/3.0;
mean_c := (c + c + c)/3.0;
mean_d := (d + d + d)/3.0;

a_diff_sq_sum := (a - mean_a) * (a - mean_a) +
(a - mean_a) * (a - mean_a) +
(a - mean_a) * (a - mean_a);
b_diff_sq_sum := (b - mean_b) * (b - mean_b) +
(b - mean_b) * (b - mean_b) +
(b - mean_b) * (b - mean_b);
c_diff_sq_sum := (c - mean_c) * (c - mean_c) +
(c - mean_c) * (c - mean_c) +
(c - mean_c) * (c - mean_c);
d_diff_sq_sum := (d - mean_d) * (d - mean_d) +
(d - mean_d) * (d - mean_d) +
(d - mean_d) * (d - mean_d);

sigma_a := sqrt( a_diff_sq_sum / 2.0 );
sigma_b := sqrt( b_diff_sq_sum / 2.0 );
sigma_c := sqrt( c_diff_sq_sum / 2.0 );
sigma_d := sqrt( d_diff_sq_sum / 2.0 );

a_record := [ mean: mean_a; st_dev: sigma_a ];
b_record := [ mean: mean_b; st_dev: sigma_b ];
c_record := [ mean: mean_c; st_dev: sigma_c ];
d_record := [ mean: mean_d; st_dev: sigma_d ];

in  array [ 1: a_record, b_record, c_record, d_record ]
end let```

Previous Section