If a uniform random variable $X$ is [300,700] and $Y$ is [500,800], what is $P(X>Y)$, assuming $X$ and $Y$ are independent? Is there any way to do it via pen and paper and without a computer? 
Here is my attempt:
$$\left(\frac{200}{300}\right)*0.5 + \frac{100}{300} + \left(\frac{200}{400}\right)*0.5 = 0.75,$$ since they are uniform, their probabilities should be uniform throughout .. which isn't quite the answer.
The answer from $R$ is $0.16584$.
 A: Draw a picture:

The blue region corresponds to $3 \le X \le 7$ (we can divide everything by $100$); the orange is $5 \le Y \le 8$, and the green is $X > Y$.  So the probability that $X > Y$ if $X$ and $Y$ are independent and uniformly distributed, is just the area of the triangle in which all three shaded regions overlap, divided by the area of the rectangle in which the blue and orange regions overlap.
A: Assume $X$ and $Y$ are independent. 
The joint distribution of $X$ and $Y$ is $f(x, y) = \begin{cases}
\frac{1}{120000} & x \in [300, 700], y \in [500, 800]\\
0 & \text{ otherwise }
\end{cases}$
Define $R_1  = \{(x, y) : x \in [300, 700], y \in [500, 800] \}$
Define $R_2 = \{(x, y) : x > y \}$
Define $R_3 = R_1 \cap R_2$
Integrate $f(x, y) = \frac{1}{120000}$ over $R_3$. 
This is a simple integration of a constant over a subset of $\mathbb{R}^2$.  
A: All the previous answers are indeed correct. The answer is $1/6$. I will not repeat the calculation here. 
But that does not mean R is wrong. Though I do not know what your code is, I believe you must have typed in such kind of commands: 
sample_size <- 100
x <- runif(sample_size, 300, 700)
y <- runif(sample_size, 500, 800)
sum(x > y) / sample_size

This method can provide you with an estimation very close to but not exactly the true value, according to the law of large number. As you can see, the answer by R is $0.16584$, very close to $1/6=0.16666...$. However, deviation always exists in this method, since it is simply an estimation, not the exact value. 
A: The region containing all pairs of realization of $X$ and $Y$ (having uniform density) is

The constraint $X > Y$ is satisfied on the right triangle with legs $700-500 = 200$.  The ratio of the area of the triangle to the area of the entire rectangle is
$$  \frac{\frac{1}{2} \cdot 200 \cdot 200}{400 \cdot 300} = \frac{2 \cdot 10^4}{12 \cdot 10^4} = \frac{1}{6}  \text{.}  $$
