Re: calculating P(X>=Y)



Mark said:

Date: Feb 4, 2009 9:02 AM
Author: VonTressMS
Subject: Re: calculating P(X>=Y)

On Feb 4, 7:57 am, vontres...@xxxxxx wrote:
On Feb 4, 12:41 am, sad...@xxxxxxxxx wrote:

hello, how do i calculate P(X>=Y), where X and Y having uniform
density on {0,1...N}?
thanks!

It is (N+1)/(2*N) if X and Y are independent. This is because there
are (N+1)N/2 points satisfying the condition X>=Y on an (X,Y) grid,
and each point has a probability of 1/(N*N) under the assumption of
independence.

If you don't assume independence, then you have to resort to brute
force summation of the probabilities where X and Y satisfy X>=Y.

Mark

Sorry, it should be N/(2*(N+1)) since the probability for each point is 1/((N+1)*(N+1)). I forgot to count the zero in my answer above.

It gets messier if X and Y have different values of N, say Nx and Ny.
You run into these kinds of problems in the exact analysis of
categorical data, but the probabilities are binomial instead of
uniform. The uniform is a special case where you can get a simple
closed form solution. Mark



My Response

Let be Y =
_________0__1__2__3__... n-1__n

The probability to have X>=Y given Y , p(X>=Y|Y) are respectively

_(n+1)/(n+1), n/(n+1) , ... , 2/(n+1), 1/(n+1)

Then, because

1+ 2+ ...+ (n+1) = [(1+(n+1))/2]*(n+1)= (n+1)*(n+2)/2

One has, finally:

p(X>=Y) = (n+2)/(2*(n+1))


Suppose [0, 1, 2] , n=2 . Probability to get Y is always 1/3, those of X are 3/3 (for Y=0), 2/3 (for Y=1) and 1/3 (for Y=2) . Then results 3/9 + 2/9 + 1/9 = 6/9 = 2/3.
The formula above: (2+2)/(2*3)=2/3.


______________ X________
_________0_____1_____2__
Y=__ 0___*_____*_____*__
_____1__ *_____*________
_____2__ *______________




Mark´s formula, n/(2*(n+1)), gives p=1/3, wrongly, I guess.
***************************

Luis A. Afonso
.



Relevant Pages

  • Re: Lithuania and the Soviet Union 1939-40: The Fateful Year [Was: Re: I strongly urge...]
    ... said "in 1992 we ate potatoes and cream, in 1993, potatoes and butter, ... anyone will decide anything, it'll be the elite. ... We already passed the mark of how long ... period of independence between the wars. ...
    (soc.culture.baltics)
  • Re: calculating P(X>=Y)
    ... independence. ... force summation of the probabilities where X and Y satisfy X>=Y. ... The uniform is a special case where you can get a simple ... Well done Afonso. ...
    (sci.stat.math)
  • Re: Multiple comparison correction using p values alone
    ... Of course Jerry is referring to problems with independence when he ... asserts Pis not P*P, ... probabilities, not p values, there would be less kerfuffle. ... posterior probabilities of 0.95 for each of two lineages of the split, ...
    (sci.stat.consult)
  • Re: Small Markov models problem
    ... Ross Clement (Email address invalid - do not use) wrote: ... is calculated with an independence assumption between two variables ... degrees of dependence between the two variables, ... probabilities leaves the extra step of having to fix-up the marginal ...
    (sci.stat.math)
  • Re: calculating P(X>=Y)
    ... If you don't assume independence, then you have to resort to brute ... it should be N/) since the probability for each point ... The uniform is a special case where you can get a simple ... closed form solution. ...
    (sci.stat.math)