# calculating P(X>=Y)

Printable View

• Feb 3rd 2009, 10:50 PM
adirh
calculating P(X>=Y)
hello,

How do I calculate P(X>=Y) where X,y having the uniform density on {0,1...N}?
• Feb 4th 2009, 12:02 AM
mr fantastic
Quote:

Originally Posted by adirh
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)}$.
• Feb 4th 2009, 12:30 PM
awkward
Quote:

Originally Posted by adirh
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)$.