The probabilities of uniform distribution variables $P(X_1>X_2)$ and $P(X_2>X_1)$ Let $X_1$ and $X_2$ be two independent random variables with the discrete uniform distribution: 
$$X_1,X_2\sim\text{Ud}(1,N)$$
I need to find the probabilities that $P(X_1=X_2)$, $P(X_1>X_2)$, $P(X_2>X_1)$.
I can easily find the first one, by saying that:
$$\sum_{K=1}^N P(X_1=K)\times P(X_2=K)$$ 
* So, $P(X_1=K)$ and $P(X_2=K)$ both equal to $\cfrac1N$ (because of the distribution type), then we get $\cfrac1{N^2}$ after multiplying them.


*

*For the sigma: $\sum_{k=1}^N$ equals to $N$ because there are no any $k$'s inside the sigma, hence we get:
$$N\times\cfrac1{N^2}=\cfrac1N$$
I couldn't figure out how to solve it (in the same way as I did) in the other cases.

 A: The calculations imply a discrete uniform distribution. If you make a table between the outcomes of $X_1$ and $X_2$, you will see that all outcomes where $X_1>X_2$ lie on one side of the line where $X_1=X_2$, and all outcomes for $X_1<X_2$ lie on the other side. Indeed, $X_1>X_2$ and $X_1<X_2$ are equally likely; together with $X_1=X_2$ they partition the sample space. Thus
$$P(X_1>X_2)=P(X_1<X_2)=\frac12\left(1-\frac1N\right)=\frac{N-1}{2N}$$
A: You should break the probability into simpler chunks by using conditional probabilities.
Write:
$$P(X_1>X_2)=\sum_{k=1}^N P(X_1>X_2\mid X_2=k)P(X_2=k)$$
Now, the two probabilities in that sum are easy to work out, and the sum can then be calculated, although you're going to need this formula.
A: In general, you can apply the law of total probability.
The general statement is $ P(A) = \mathbb{E}(P(A \mid B)) $ for random variables $ A $ and $ B $.
For instance,
\begin{equation}
\begin{aligned}
P(X_2 < X_1)
& = \mathbb{E}(P(X_2 < X_1 \mid X_1)) \\
& = \sum_{i=1}^N P(X_2 < X_1 \mid X_1 = i)P(X_1 = i) \\
& = \sum_{i=1}^N P(X_2 < X_1 \mid X_1 = i)\frac{1}{N} \\
& = \sum_{i=1}^N \frac{\sum_{j=1}^i j}{N} \frac{1}{N} \\
& = \frac{1}{N} \sum_{i=1}^N \frac{\sum_{j=1}^i j}{N} \\
& \vdots
\end{aligned}
\end{equation}
I won't finish the entire problem for you, but the general approach is there!
