Re: calculating P(X>=Y)
- From: vontressms@xxxxxx
- Date: Thu, 12 Feb 2009 06:01:03 -0800 (PST)
On Feb 4, 2: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
I was off by 1 in a couple of places. There are (n+1)*(n+2)/2 points
in a grid of (n+1)*(n+1) points satisfying x>=y. Each has a common
probability of 1/((n+1)*(n+1)), so the probability of x>=y is (n+2)/(2*
(n+1)). my mistake.
anyway, here is a mathmatician joke.
An insane mathmetician was sent to an insane asylum. He would torment
the other inmates by saying "I will integrate you and differentiate
you". This was really intimidating so people started to be afraid of
him. They would give him their lunch. They would give him the
cigarettes. He had total control of the joint.
One day, a new inmate came in and the mad mathmetician said to him "I
WILL INTEGRATE YOU AND DIFFERENTIATE YOU!", but to no effect. He said
it again "I WILL INTEGRATE YOU AND DIFFERENTIATE YOU!", and again to
no effect. Then he asked the new inmate why he was not intimidated.
The new inmate said he was not intimidated because he was namee e to
the x.
The insane budist version is based on "I will multiply you and divide
you!". The new inmate says his name is One.
I think that is a cute joke.
Mark
.
- References:
- calculating P(X>=Y)
- From: sadirh
- Re: calculating P(X>=Y)
- From: Luis A. Afonso
- calculating P(X>=Y)
- Prev by Date: Re: general query about information retrieval/inference from a statistical perspective
- Next by Date: Re: general query about information retrieval/inference from a statistical perspective
- Previous by thread: Re: calculating P(X>=Y)
- Next by thread: Re: calculating P(X>=Y)
- Index(es):
Loading