Proof of $\sum_{k=0}^n k \text{Pr}(X=k) = \sum^{n-1}_{k=0} \text{Pr}(X>k) -n \text{Pr}(X>n)$ $X$ is a random variable defined in $\mathbb N$. How can I prove that  for all $n\in \mathbb N$?

  
*
  
*$ \text E(X) =\sum_{k=0}^n k \text{Pr}(X=k) = \sum^{n-1}_{k=0} \text{Pr}(X>k)  -n \text{Pr}(X>n)$ 
  
*$\text E(X) =\sum_{k=0}^n k \text{Pr}(X=k)=\sum_{k\ge 0} \text{Pr}(X>k) $
  


Hint: $Pr(X=k) = Pr(X>k-1)-Pr(X>k)$
