Re: calculating P(X>=Y)



On Feb 4, 9:28 pm, "Luis A. Afonso" <lic...@xxxxxxxxxxx> wrote:
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

Well done Afonso.

illywhacker;
.



Relevant Pages

  • Re: calculating P(X>=Y)
    ... Mark said: ... 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. ... The uniform is a special case where you can get a simple ...
    (sci.stat.math)
  • Re: Generate a sequence of random numbers that sum up to 1?
    ... probabilities PI, ... I did not know the uniform function until a ... specified number of random floating numbers whose sum ... Mail has the best spam protection around ...
    (comp.lang.python)
  • Re: Pull a uniform sample
    ... I arranged these 20 probabilities in range adding ... I want to order MATLAB to pull one of the ... how can i do it using uniform ...
    (comp.soft-sys.matlab)
  • 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)