What is the average of no numbers? I have two programs that both behave nearly identically: they both take in any numbers you give them and can tell you the average and how many numbers were given. However, when you don't give them any numbers, one says the average is 0.0, and the other says it's NaN ("Not a Number"). Which of these answers, if any, is more correct, and why?


  Note: Although I use "programs" as a metaphor here, this isn't a programming question; I could've just as easily said "computers", "machines", "wise men", etc. and my question would be the same
From a statistical point-of-view, the average of no sample points should not exist. The reason is simple. The average is an indication of the centre of mass of the distribution. Clearly, for no observations there can be no way to prefer one location vs. another as their centre of mass since the the empty set is translation invariant. 

More mathematically, taking the average is a linear operation, which means if you add a constant $c$ to each observation, then the average $a$ becomes $a+c$. Now if you add $c$ to each observation in the empty set, you get the empty set again, and thus the average will have to satisfy $a+c=a$ for all $c$, clearly nonsense.
You can have an average of whatever is input (assuming we are not looking at PI which I do not know as having an ending).  If you press Enter or whatever method is used to cause an input into the program, then the programming language or input design of the program will interpret that information, likely perform some calculation, then give the result of the calculation.

What I mean is, you can just press enter (with no other value entered) and (depending on the programming language or design of the program) the program can interpret your value (if reading integers) as Zero.  Some languages may interpret the input as a non value or nul and may output something similar to your 'NaN'.

However, in answer to your first question, the average of one thing is always that thing.  Unless you can only have an average until you have two or more of something to create an average.  So whatever is input, as long as it was only one input, would result in that input as being the average.

To answer your ending question, I would say the NaN is more correct because just pressing enter (assuming that is how the data is input) and is done so with the intent of at least not giving a specific value.  That is the answer for the person inputting the data.  The answer may also depend on the programmers intent on what type of input they are looking for --- numerical (0 may be correct) or non-numerical (Nan is correct).