Solution 1:

You have an (or a) average, maximum, minimum, or other group-based calculation of something, while you take (or calculate) the average, maximum, or minimum.

Thus your samples 1, 3, and 5 are correct, but not 2, 4, or 6.

(To clarify, as per the comments: In the example sentences, the average is a property that is already known, and it is being treated grammatically in the same way as a generic, indefinite possession and thus can take the indefinite article 'a'. If the average is an unknown number that needs to be determined, then you are taking or calculating it, and then it is a specific feature and should be referred to with the definite article 'the'.)