3 ms·
Just work out the math for N = 3 and you'll see why your solution is wrong. X = Mean([a,b,c]) = (a+b+c)/3 Y = YourFunction([a,b,c]) = (((a+b)/2)+c)/2 = (a+b+2
by anonytrary 8y ago
Just work out the math for N = 3 and you'll see why your solution is wrong.
X = Mean([a,b,c]) = (a+b+c)/3
Y = YourFunction([a,b,c]) = (((a+b)/2)+c)/2 = (a+b+2c)/4
X does not equal Y. It doesn't matter if the reduce is left or right, btw, it's still wrong.