Probability of a point taken from a certain normal distribution will be greater than a point taken from another?

Let's say I have one point that will be taken randomly from a normal distribution with mean $\mu_1$ and standard deviation $\sigma_1$. Let's say I have another point that is taken much in the same way from another normal distribution with mean $\mu_2$ and standard deviation $\sigma_2$;.

How can I compute the probability, given $\mu_1$, $\mu_2$, $\sigma_1$, and $\sigma_2$, that my first point will be larger than the second?

I am sort of interested in the reasoning behind an "analytic" answer (or as analytic as you can possibly get with the normal distribution, which isn't that much), but I am more importantly looking for an algorithm of computing this probability, as it will be used in a simulation/model.

Does anyone know where I could get started on reasoning through this?

Note: For actual computation, having a table of values of the % of the curve within a given multiple of the standard deviation is feasible in my situation.

-

1
– ogerard May 20 '11 at 9:07
@ogerard -- yes, they are independent in the manner you describe. – Justin L. May 20 '11 at 9:44
So my answer applies. – Shai Covo May 20 '11 at 10:17

1 Answer

Suppose that $X_1 \sim {\rm N}(\mu_1,\sigma_1^2)$ and $X_2 \sim {\rm N}(\mu_2,\sigma_2^2)$ are independent. Then, $${\rm P}(X_1 > X_2 ) = {\rm P}(X_1 - X_2 > 0) = 1 - {\rm P}(X_1 - X_2 \le 0).$$ Now, by independence, $X_1 - X_2$ is normally distributed with mean $$\mu := {\rm E}(X_1 - X_2) = \mu_1 - \mu_2$$ and variance $$\sigma^2 := {\rm Var}(X_1 - X_2) = \sigma_1^2 + \sigma_2^2.$$ Hence, $$\frac{{X_1 - X_2 - \mu}}{{\sigma}} \sim {\rm N}(0,1),$$ and so $${\rm P}(X_1 - X_2 \le 0) = {\rm P}\bigg(\frac{{X_1 - X_2 - \mu }}{\sigma } \le \frac{{0 - \mu }}{\sigma }\bigg) = \Phi \Big( \frac{-\mu }{\sigma }\Big),$$ where $\Phi$ is the distribution function of the ${\rm N}(0,1)$ distribution. Thus, $${\rm P}(X_1 > X_2 ) = 1 - {\rm P}(X_1 - X_2 \le 0) = 1 - \Phi \Big( \frac{-\mu }{\sigma }\Big).$$

-

So, the probelm reduces to calculating the probability that a standard normal variable is less than a given $a$. – Shai Covo May 20 '11 at 9:46
I really like this answer; however, I can't seem to get the results to align with the empirical results I am generating.  Perhaps it's an issue with my random number generator?  For $\sigma=1$ for both and $\mu_1 = 0$ and $\mu_2 = 1$, I am consistently getting around 23.9% of all simulated selections resulting in the former being higher; however, your method seems to give an expected result of 15.9%; did I use yours wrong? – Justin L. May 20 '11 at 16:51
Nevermind, it turns out I was using the wrong value for $\sigma$ -- $1$ instead of $\sqrt{2}$.  Everything works like a charm now :) – Justin L. May 20 '11 at 21:12
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 20, "mathjax_display_tex": 6, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9554454684257507, "perplexity_flag": "head"}