1-1+1-1+1-1+1-1+1-1+1-1+...=x What is x?
That's arithmetic progression , it's a section in math, the kid who discovered it died at the age of 9 or idk according to my math teacher that was actually insane.
You mean my x who thought pepper was spicy? we don't talk about her
bash -c 'x=1-1;while [ 1 ];do x=$((x+1-1));echo $x;done'
Depends on how you group it. I think one way of calculating it even gives 0.5.
I think you can also get -1, 0, or 1.. not sur.
It's arithmetic progression if you're interested
A guest list nightmare.
But if you add it like 1+(-1+1)+(-1+1)+(-1+1)+(-1+1)+... it equals 1
or you add up all the positive ones first and get infinity and if you substract negative ones from infinity, you still got infinity
Lim n=1 -> n=infinity : Sum(n) ( 1-1 ) = 0 . Lim n=1 ->infinity Sum(n)(1) - Sum(n)(-1) equals Lim n=1->infinity:Sum(n)(0) = 0 .
The difference between a positive and a negative infinity is undefined.
But as soon as you can arrange the elements in the sum to equal zero, the infinite sum of zeros equals zero, which is defined.
Semantics does not equal Mathematics ;-)
It's dangerous to treat infinite sums like you did. The series does not converge in the usual sense. https://en.wikipedia.org/wiki/Grandi%27s_series
The result of any operation in Math must not depend on the way it is semantically expressed. When your operation is: add an infinite number
of 1s with alternating sign the actual result at every randomly observed step is either +1 or 0 when you start with +1.
You can rearrange the elements into groups of size N, so that Sum(N elements)(1+1+1+1..Nth1) =N and Sum(N elements(-1-1-1-1..Nth-1)=-N and N-N=0 always.
if N goes to infinity, the rule N-N=0 does not apply
im too lazy rn to get into the details, so i cant really argue against you
but maybe this helps if you care. https://math.stackexchange.com/questions/2144060/did-i-just-find-proof-that-grandis-series-equals-zero/2144193