From time to time, we will be confronted with a long list of numbers that we'll have to deal with, meaning: "come to some conclusions about the numbers." What can we do?

In a past lesson you worked on finding the average of some numbers in a file, with subsequent lessons having you finding the maximum and minimum values in a file as well. Let's repeat these actions here, but for an array called

The average of the numbers requires the sum of all of the numbers, which is then divided by the total number of numbers in the array ($N$), as in average=$\Sigma x_i/N$, where $x_i$ is the $i^{th}$ data point in the array.

The maximum and minimum numbers can be found as follows: let's sort the data array using Lua's built in

In a past lesson you worked on finding the average of some numbers in a file, with subsequent lessons having you finding the maximum and minimum values in a file as well. Let's repeat these actions here, but for an array called

`data`

that contains about 2,000 numbers.
The average of the numbers requires the sum of all of the numbers, which is then divided by the total number of numbers in the array ($N$), as in average=$\Sigma x_i/N$, where $x_i$ is the $i^{th}$ data point in the array.

The maximum and minimum numbers can be found as follows: let's sort the data array using Lua's built in

`table.sort()`

function. The minimum number will now be the first element, and the maximum the last element.
Type your code here:

See your results here:

We got an average of 541.851, a maximum of 619 and a minimim of 462.