Talk:Averages/Arithmetic mean

From Rosetta Code
Revision as of 19:46, 27 August 2009 by rosettacode>Glennj (arbitrary value for empty array)

Why is it required that an arbitrary result, 0, be returned when the input is empty? --Kevin Reid 22:57, 14 August 2009 (UTC)

I suppose we have to define something. From the Wikipedia page, the mean is defined as "the sum from i=1 to n ...", so the mean of an empty set of data is undefined. The problem could have specified Inf or nil or anything. (However, it seems the average salary of the empty set is US$24,000 :/ ) --glennj 19:46, 27 August 2009 (UTC)