# x / 3 + y /3 + z / 3 = (x + y + z) / 3?

Is the following equation always true?

x / 3 + y /3 + z / 3 = (x + y + z) / 3

I hope this is not too simple of a question. Every example I can think of, this equation is true. However, in a program I am writing, it appears that the left side of it works but not the right side. So I am trying to figure out if I just got lucky or I am out of my mind.

• Your equation is correct. – N. F. Taussig Oct 4 '14 at 22:27
• It's definitely true by the laws of adding fractions. You're probably writing your program slightly incorrectly. Can you post your code? – Ian Coley Oct 4 '14 at 22:27
• check your program again.. Does it return only integer numbers? Maybe that's your problem – Exodd Oct 4 '14 at 22:28
• The code is rather elaborate, but I got different results from float degreesWeight = Degrees.x / 3 + Degrees.y / 3 + Degrees.z / 3; versus float degreesWeight = (Degrees.x + Degrees.y + Degrees.z) / 3; I must have missed something somewhere, thank you – Evorlor Oct 4 '14 at 22:28
• So I tried the other way again, and got the same results as the first way. I must have missed a typo or something. Sorry to take up your time, but thank you! – Evorlor Oct 4 '14 at 22:34

As mathematical equation of real numbers, it is always correct, due to the distributive law: $$x/3 + y/3 + z/3 = \tfrac13 x+\tfrac13 y+\tfrac13 z = \tfrac13(x+y+z) = (x+y+z)/3$$