# Math Help - calculating P(X>=Y)

1. ## calculating P(X>=Y)

hello,

How do I calculate P(X>=Y) where X,y having the uniform density on {0,1...N}?

hello,

How do I calculate P(X>=Y) where X,y having the uniform density on {0,1...N}?
Just make a grid. Y is the vertical axis, X is the horizontal axis.

Every point has the same probability: $\Pr(X = x_i, Y = y_j) = \frac{1}{(N + 1)^2}$ since there are $(N+1)^2$ points.

There are $N + 1$ points along the diagonal Y = X.

So the number of points such that $X \geq Y$ is $\frac{(N+1)^2 - (N+1)}{2} + (N+1) = \frac{(N+1)N}{2} + N + 1 = \frac{(N+1)(N+2)}{2}$.

Therefore $\Pr(X \geq Y) = \frac{\frac{(N+1)(N+2)}{2}}{(N+1)^2} = \frac{N+2}{2(N+1)}$.

hello,

How do I calculate P(X>=Y) where X,y having the uniform density on {0,1...N}?
Mr. F has already given you a first-rate answer, but here's another way to proceed just for the fun of it.

By the formula for the probability of a union,

$P(X \geq Y) + P(Y \geq X) - P(X = Y) = P(X \geq Y \text{ or }Y \geq X) = 1$

Now $P(X = Y) = \frac{1}{N+1}$

and $P(X \geq Y) = P(Y \geq X)$ by symmetry, so

$2 \; P(X \geq Y) + \frac{1}{N+1} = 1$.

Solve this equation for $P(X \geq Y)$.