Probability of Binomial Variable ≥ Another Binomial Variable

In summary, the binomial distribution can be used to calculate the probability of an event being greater than another event. For instance, two binomially distributed variables can be generated as paired events, and the variable with p=X will be greater than the variable with p=Y 31.73% of the time. The equity for a variable is the total of all the times it is greater than another variable. For instance, if two binomially distributed variables are generated as paired events, and the variable with p=X is greater than the variable with p=Y 42.04% of the time, then the equity for the first variable is (.5994+1.6509)/10000=.7498.
  • #1
SirTristan
12
0
If two binomially distributed variables are generated as paired events, how often will the variable with p=X be greater than the variable with p=Y? Also what is the "equity" if ties are counted as .5 for each?

For instance in Excel I generated 10,000 numbers with p=.8 and 10,000 with p=.6. The first set of numbers was greater 3,173 times, they were equal 5,642 times, and the second set was greater 1,185 times. So p=.8 was greater than p=.6 31.73% of the time. Counting ties as equal the total equity for the first set was (3173+5642/2)/10000=.5994.

Repeating this for p=.7 and p=.4, the first was greater 4,204 times, they were equal 4,610 times, and the second set was greater 1,186 times. p=.7 was greater than p=.4 42.04% of the time, and the "equity" for the first variable was (4204+4610/2)/10000=.6509.
 
Physics news on Phys.org
  • #2
Hi SirTristan! :smile:

What you are looking for is

[tex]P\{X\geq Y\}=P\{X-Y\geq 0\}[/tex]

Thus you must know the distribution of X-Y. Sadly, I do not know any nice formula for this. However, if X~B(n,p) and Y=B(m,q) and n and m is large, then we can appy the Central Limit Theorem.

Indeed, if n is large, then X~N(np,np(1-p)) and if m is large then Y~N(mq,mq(1-q)). Thus X-Y~N(np+mq,np(1-p)+mq(1-q)). Thus if Z is standard normal, then you need to calculate

[tex]P\left\{Z\geq \frac{-np-mq}{\sqrt{np(1-p)+mq(1-q)}}\right\}[/tex]

which can be easily done by using some kind of table...
 
  • #3
Looks like you mean Bernoulli variables (Binomial with n=1). For this case it's easy to set up a 2x2 table, e.g. with P[X=1]=p and P[Y=1]=q you have P[X=0,Y=1]=(1-p)q etc and thus P[X>Y]=p(1-q) and P[X=Y]=pq+(1-p)(1-q) which should match reasonably closely the percentages you found by Monte Carlo simulation. You may like to try a Chi square test to see if the observations are close enough to the predictions.
 
  • #4
Thank you very much guys :)

bpet, yes those numbers seem to match the simulations quite precisely. More simple math than I expected :) Here's what those formulas give:
Code:
P	Q	X>Y	X=Y	Equity
0.8	0.6	0.32	0.56	0.6
0.7	0.4	0.42	0.46	0.65
That's almost exactly the simulation numbers.

I'm having trouble with micromass's formula though - perhaps I'm doing something wrong? Since n=m=1, here's what I get for the numerator [-p-q] and the denominator [sqrt(p*(1-p)+q*(1-q))], the Z score, and the probability of being higher than that Z score:
Code:
P	Q	Num	Den	Z	Probability
0.8	0.6	-1.4	.6325	-2.2136	.9866
0.7	0.4	-1.1	.6708	-1.6398	.9495
0.6	0.8	-1.4	.6325	-2.2136	.9866
Perhaps I'm misapplying the formula, because from how I'm gathering it, when P is less than Q gives the same result as when P is higher than Q. Shouldn't it be that X-Y is distributed with a mean of np-mq rather than np+mq? And the numerator should be -(np-mq) rather than -np-mq? Using that numerator gives me:
Code:
P	Q	Num	Den	Z	Probability
0.8	0.6	-0.2	.6325	-.3162	.6241
0.7	0.4	-0.3	.6708	-.4472	.6726
0.6	0.8	0.2	.6325	.3162	.3759
These numbers make more sense to me, although I think they're a bit less accurate relative to the simulation.
 
  • #5
I'm sorry SirTristan, you are correct! The numerator should indeed be -(np-mq).

Also, the formula I gave you will only approximate the real probability for large n and m. If you pick n=m=1, then this will be highly inaccurate, as your example shows!

Maybe you could try the same thing for n,m>20 or so, you'll see that the formula approximates your simulation quite closely!
 

FAQ: Probability of Binomial Variable ≥ Another Binomial Variable

What is a binomial variable?

A binomial variable is a type of discrete random variable that can only take on two possible values: 0 or 1. It is used to model situations where there are only two outcomes, such as success or failure, heads or tails, or yes or no.

How is the probability of a binomial variable calculated?

The probability of a binomial variable is calculated using the formula P(x) = nCx * p^x * (1-p)^(n-x), where n is the number of trials, x is the number of successes, and p is the probability of success on each trial. This formula is also known as the binomial probability distribution.

What does it mean for one binomial variable to be greater than or equal to another binomial variable?

In probability, saying that one binomial variable is greater than or equal to another means that the first variable has a higher or equal probability of success compared to the second variable. This can also be interpreted as the first variable having a higher or equal number of successes in a given number of trials.

How do you calculate the probability of one binomial variable being greater than or equal to another?

The probability of one binomial variable being greater than or equal to another can be calculated by finding the probability for each variable separately using the binomial probability distribution formula, and then subtracting the probability of the second variable from the first. This gives the probability of the first variable being greater than the second.

Can the probability of one binomial variable being greater than or equal to another be greater than 1?

No, the probability of any event cannot be greater than 1. If the probability of one binomial variable being greater than or equal to another is calculated to be greater than 1, then there may be an error in the calculation or the variables may not be valid for a binomial distribution.

Similar threads

Replies
5
Views
2K
Replies
4
Views
3K
Back
Top