I’ve been trying for a long time to essentially write this formula (which I know is weird - substance only minimally matters here):
Sum[(x - Sum[x,{x,1,9}]/9), {x,1,9}]
The divided by nine is for some reason corrupting the formula. I’ve also tried * 1/9 and switched the order … nothing works.
The annoying thing is when I use the “build a function” offering from Wolfram Alpha (input fields prompt me for the equation, lower and upper limits), I enter: x - Sum[x, {x,1,9}] * 1/9 and set the lower limit to 1 and upper limit to 9 … and it works (but I need to do a bit more than just evaluate it - I know there are some ways I can cheat this and get the same result, but I’m going for the exact image).
Do you believe that Mathematica gives the wrong result when evaluating:
Sum[(x - Sum[x, {x, 1, 9}]/9), {x, 1, 9}]
If so, what result do you expect from it? This will help clarify what you expect.
As a general rule, you should not nest Sums inside each other when they have the same independant variable. You should change the independant variable so that it reads:
Sum[(x - Sum[i, {i, 1, 9}]/9), {x, 1, 9}]
If this isn’t the forumula you are looking for, then please write out (maybe with TeX or something) what summation you want to put into Mathematica. Mathematica is evaluating your code correctly.
When I type that into Wolfram, it returns an error. “Wolfram|Alpha doesn’t understand your query”. If I remove the /9, it returns the result successfully. I’m eventually trying to show that this equation is not the same as another equation (and using the visual produced).
BUT If I type the first equation (including the /9) into the auto-generator for sums (function to sum, lower limit, upper limit), the correct result is returned. The problem is I can’t compare this to another equation, only view it.
Thanks for the quick reply!
Update: Sum[(x -Sum[x/9,{x,1,9}])^2, {x,1,9}] ended up working for me, but if anyone knows why I couldn’t put the 1/9 outside the sum I’d love to know! Thanks