sum of the series? let sum of the series 
$$S=1-1+1-1+1-1+1-1+1-1........$$
$S=\frac{1}{2}$
my question is if there are even number of terms then the sum is $0$ 
and if the number of terms are odd then sum is $1$.
but we don't know whether its odd or even because the sequence goes to infinity.
Is the answer derived by using the probability of getting either $0$ or $1$

I am making an edit to this, can it done by using the 
where $i $ is 4th root of unity


*

*$$S=i+i^2+i^3+i^4+i^5.....$$


$$S=i-1-i+1+i-1-i+1.....$$
then $1$ can be summed up using infinite sum of Gp
which is $$S=\frac{a}{1-r}=\frac{i}{1-i}$$
by simplifying we get $$S=\frac{i}{1-i}\frac{1+i}{1+i}=\frac{i-1}{2}$$
and take the real part of $S=Re \big[ \frac{i-1}{2}\big]=-\frac{1}{2}$
is it a wrong way to solve this problem ???
 A: The solution is not "$1/2$", but rather it is regularized to give one half:
$$S=\lim_{x\ \uparrow\ 1}1-x+x^2-x^3+\dots=\frac12\\S=\eta(0)=\frac12\\S=\lim_{n\to\infty}\frac{S_n}n=\frac12$$
where $\eta(z)$ is the Dirichlet eta function and $S_n$ is the $n$th partial sum.
Other methods also yield $1/2$, but you are dealing with a divergent series, so any ideas like grouping do not make sense.

Specifically concerning your solution, you should notice that the real part of your series is
$$-1+1-1+1-1+\dots$$
which is $-1$ times the normal result.  A more correct way to use your idea would be to take
$$S=\Re(\lim_{x\to i}1+x+x^2+x^3+x^4+\dots)$$
since the geometric series only works for $|x|<1$, we have to avoid the problem of convergence via limits.  Notice that you cannot apply the limit to each term individually, as you will get a divergent series.  Instead, you should calculate the series first, then take the limit, then the real part.
A: Look this(Terence Tao-Analysis I):]1

A: That series is $$\sum_{n=0}^{+\infty}(-1)^{n}$$ whic has no sum because
$$\lim_{n\to +\infty}(-1)^n\neq 0.$$
So, writing as $S=1-1+1-1+\dots$ is not allowed. Hope you are clarified.
A: This is called Grandi's series, you can see about it here.
I think he defined it to be $0.5$ in some meaning the average of all its partial sums, is equal to $0.5$.
A: For $n\geq 0$, let $$S_n=\sum_{k=0}^n (-1)^k.$$
then
$$S_{2n}=1$$
$$S_{2n+1}=0$$
$\implies (S_n)$ is not convergent.
thus
$$\sum_{n=0}^{+\infty}(-1)^n\notin \Bbb R$$.
