Q-function

Statistics function
title: "Q-function" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["normal-distribution", "special-functions", "functions-related-to-probability-distributions", "articles-containing-proofs"] description: "Statistics function" topic_path: "general/normal-distribution" source: "https://en.wikipedia.org/wiki/Q-function" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Statistics function ::
::figure[src="https://upload.wikimedia.org/wikipedia/commons/c/c3/Q-function.png" caption="A plot of the Q-function."] ::
In statistics, the Q-function is the tail distribution function of the standard normal distribution. In other words, Q(x) is the probability that a normal (Gaussian) random variable will obtain a value larger than x standard deviations. Equivalently, Q(x) is the probability that a standard normal random variable takes a value larger than x.
If Y is a Gaussian random variable with mean \mu and variance \sigma^2, then X = \frac{Y-\mu}{\sigma} is standard normal and
:P(Y y) = P(X x) = Q(x)
where x = \frac{y-\mu}{\sigma}.
Other definitions of the Q-function, all of which are simple transformations of the normal cumulative distribution function, are also used occasionally.
Because of its relation to the cumulative distribution function of the normal distribution, the Q-function can also be expressed in terms of the error function, which is an important function in applied mathematics and physics.
Definition and basic properties
Formally, the Q-function is defined as
:Q(x) = \frac{1}{\sqrt{2\pi}} \int_x^\infty \exp\left(-\frac{u^2}{2}\right) , du.
Thus,
:Q(x) = 1 - Q(-x) = 1 - \Phi(x),!,
where \Phi(x) is the cumulative distribution function of the standard normal Gaussian distribution.
The Q-function can be expressed in terms of the error function, or the complementary error function, as
: \begin{align} Q(x) &=\frac{1}{2}\left( \frac{2}{\sqrt{\pi}} \int_{x/\sqrt{2}}^\infty \exp\left(-t^2\right) , dt \right)\ &= \frac{1}{2} - \frac{1}{2} \operatorname{erf} \left( \frac{x}{\sqrt{2}} \right) ~~\text{ -or-}\ &= \frac{1}{2}\operatorname{erfc} \left(\frac{x}{\sqrt{2}} \right). \end{align}
An alternative form of the Q-function known as Craig's formula, after its discoverer, is expressed as:
:Q(x) = \frac{1}{\pi} \int_0^{\frac{\pi}{2}} \exp \left( - \frac{x^2}{2 \sin^2 \theta} \right) d\theta.
This expression is valid only for positive values of x, but it can be used in conjunction with Q(x) = 1 − Q(−x) to obtain Q(x) for negative values. This form is advantageous in that the range of integration is fixed and finite.
Craig's formula was later extended by Behnad (2020) for the Q-function of the sum of two non-negative variables, as follows:
:[[File:Q function complex plot plotted with Mathematica 13.1 ComplexPlot3D.svg|alt=the Q-function plotted in the complex plane|thumb|the Q-function plotted in the complex plane]]Q(x+y) = \frac{1}{\pi} \int_0^{\frac{\pi}{2}} \exp \left( - \frac{x^2}{2 \sin^2 \theta} - \frac{y^2}{2 \cos^2 \theta} \right) d\theta, \quad x,y \geqslant 0 .
Bounds and approximations
- The Q-function is not an elementary function. However, it can be upper and lower bounded as,
::\left (\frac{x}{1+x^2} \right ) \phi(x) 0,
:where \phi(x) is the density function of the standard normal distribution, and the bounds become increasingly tight for large x.
:Using the substitution v =u2/2, the upper bound is derived as follows:
::Q(x) =\int_x^\infty\phi(u),du
:Similarly, using \phi'(u) = - u \phi(u) and the quotient rule,
::\left(1+\frac1{x^2}\right)Q(x) =\int_x^\infty \left(1+\frac1{x^2}\right)\phi(u),du \int_x^\infty \left(1+\frac1{u^2}\right)\phi(u),du =-\biggl.\frac{\phi(u)}u\biggr|_x^\infty =\frac{\phi(x)}x.
:Solving for Q(x) provides the lower bound.
:The geometric mean of the upper and lower bound gives a suitable approximation for Q(x):
::Q(x) \approx \frac{\phi(x)}{\sqrt{1 + x^2}}, \qquad x \geq 0.
- Tighter bounds and approximations of Q(x) can also be obtained by optimizing the following expression
:: \tilde{Q}(x) = \frac{\phi(x)}{(1-a)x + a\sqrt{x^2 + b}}.
:For x \geq 0, the best upper bound is given by a = 0.344 and b = 5.334 with maximum absolute relative error of 0.44%. Likewise, the best approximation is given by a = 0.339 and b = 5.510 with maximum absolute relative error of 0.27%. Finally, the best lower bound is given by a = 1/\pi and b = 2 \pi with maximum absolute relative error of 1.17%.
- The Chernoff bound of the Q-function is
::Q(x)\leq e^{-\frac{x^2}{2}}, \qquad x0
- Improved exponential bounds and a pure exponential approximation are
::Q(x)\leq \tfrac{1}{4}e^{-x^2}+\tfrac{1}{4}e^{-\frac{x^2}{2}} \leq \tfrac{1}{2}e^{-\frac{x^2}{2}}, \qquad x0
:: Q(x)\approx \frac{1}{12}e^{-\frac{x^2}{2}}+\frac{1}{4}e^{-\frac{2}{3} x^2}, \qquad x0
- The above were generalized by Tanash & Riihonen (2020), who showed that Q(x) can be accurately approximated or bounded by
::\tilde{Q}(x) = \sum_{n=1}^N a_n e^{-b_n x^2}.
:In particular, they presented a systematic methodology to solve the numerical coefficients {(a_n,b_n)}{n=1}^N that yield a minimax approximation or bound: Q(x) \approx \tilde{Q}(x), Q(x) \leq \tilde{Q}(x), or Q(x) \geq \tilde{Q}(x) for x\geq0. With the example coefficients tabulated in the paper for N = 20, the relative and absolute approximation errors are less than 2.831 \cdot 10^{-6} and 1.416 \cdot 10^{-6}, respectively. The coefficients {(a_n,b_n)}{n=1}^N for many variations of the exponential approximations and bounds up to N = 25 have been released to open access as a comprehensive dataset.
- Another approximation of Q(x) for x \in [0,\infty) is given by Karagiannidis & Lioumpas (2007) who showed for the appropriate choice of parameters {A, B} that
:: f(x; A, B) = \frac{\left(1 - e^{-Ax}\right)e^{-x^2}}{B\sqrt{\pi} x} \approx \operatorname{erfc} \left(x\right).
: The absolute error between f(x; A, B) and \operatorname{erfc}(x) over the range [0, R] is minimized by evaluating
:: {A, B} = \underset{{A,B}}{\arg \min} \frac{1}{R} \int_0^R | f(x; A, B) - \operatorname{erfc}(x) |dx.
: Using R = 20 and numerically integrating, they found the minimum error occurred when {A, B} = {1.98, 1.135}, which gave a good approximation for \forall x \ge 0.
: Substituting these values and using the relationship between Q(x) and \operatorname{erfc}(x) from above gives
:: Q(x)\approx\frac{\left( 1-e^{\frac{-1.98x} {\sqrt{2}}}\right) e^{-\frac{x^{2}}{2}}}{1.135\sqrt{2\pi}x}, x \ge 0.
: Alternative coefficients are also available for the above 'Karagiannidis–Lioumpas approximation' for tailoring accuracy for a specific application or transforming it into a tight bound.
- A tighter and more tractable approximation of Q(x) for positive arguments x \in [0,\infty) is given by López-Benítez & Casadevall (2011) based on a second-order exponential function:
:: Q(x) \approx e^{-ax^2-bx-c}, \qquad x \ge 0.
: The fitting coefficients (a,b,c) can be optimized over any desired range of arguments in order to minimize the sum of square errors (a = 0.3842, b = 0.7640, c = 0.6964 for x \in [0,20]) or minimize the maximum absolute error (a = 0.4920, b = 0.2887, c = 1.1893 for x \in [0,20]). This approximation offers some benefits such as a good trade-off between accuracy and analytical tractability (for example, the extension to any arbitrary power of Q(x) is trivial and does not alter the algebraic form of the approximation).
- A pair of tight lower and upper bounds on the Gaussian Q-function for positive arguments x \in [0, \infty) was introduced by Abreu (2012) based on a simple algebraic expression with only two exponential terms:
:: Q(x) \geq \frac{1}{12} e^{-x^2} + \frac{1}{\sqrt{2\pi} (x + 1)} e^{-x^2 / 2}, \qquad x \geq 0,
:: Q(x) \leq \frac{1}{50} e^{-x^2} + \frac{1}{2 (x + 1)} e^{-x^2 / 2}, \qquad x \geq 0.
These bounds are derived from a unified form Q_{\mathrm{B}}(x; a, b) = \frac{\exp(-x^2)}{a} + \frac{\exp(-x^2 / 2)}{b (x + 1)}, where the parameters a and b are chosen to satisfy specific conditions ensuring the lower (a_{\mathrm{L}} = 12, b_{\mathrm{L}} = \sqrt{2\pi}) and upper (a_{\mathrm{U}} = 50, b_{\mathrm{U}} = 2) bounding properties. The resulting expressions are notable for their simplicity and tightness, offering a favorable trade-off between accuracy and mathematical tractability. These bounds are particularly useful in theoretical analysis, such as in communication theory over fading channels. Additionally, they can be extended to bound Q^n(x) for positive integers n using the binomial theorem, maintaining their simplicity and effectiveness.
Inverse ''Q''
The inverse Q-function can be related to the inverse error functions:
:Q^{-1}(y) = \sqrt{2}\ \mathrm{erf}^{-1}(1-2y) = \sqrt{2}\ \mathrm{erfc}^{-1}(2y)
The function Q^{-1}(y) finds application in digital communications. It is usually expressed in dB and generally called Q-factor:
:\mathrm{Q\text{-}factor} = 20 \log_{10}!\left(Q^{-1}(y)\right)!~\mathrm{dB}
where y is the bit-error rate (BER) of the digitally modulated signal under analysis. For instance, for quadrature phase-shift keying (QPSK) in additive white Gaussian noise, the Q-factor defined above coincides with the value in dB of the signal to noise ratio that yields a bit error rate equal to y. ::figure[src="https://upload.wikimedia.org/wikipedia/commons/8/87/Q-factor_vs_BER.png" caption="Q-factor vs. bit error rate (BER)."] ::
Values
The Q-function is well tabulated and can be computed directly in most of the mathematical software packages such as R and those available in Python, MATLAB and Mathematica. Some values of the Q-function are given below for reference.
x=0:0.1:6; y = qfunc(x); for i=1:length(x), fprintf('Q(%.1f) = %.9f = 1/%.4f \n',x(i),y(i),1/y(i)); end;
::data[format=table]
| Q(0.0) | Q(0.1) | Q(0.2) | Q(0.3) | Q(0.4) | Q(0.5) | Q(0.6) | Q(0.7) | Q(0.8) | Q(0.9) |
|---|---|---|---|---|---|---|---|---|---|
| 0.500000000 | 1/2.0000 | ||||||||
| 0.460172163 | 1/2.1731 | ||||||||
| 0.420740291 | 1/2.3768 | ||||||||
| 0.382088578 | 1/2.6172 | ||||||||
| 0.344578258 | 1/2.9021 | ||||||||
| 0.308537539 | 1/3.2411 | ||||||||
| 0.274253118 | 1/3.6463 | ||||||||
| 0.241963652 | 1/4.1329 | ||||||||
| 0.211855399 | 1/4.7202 | ||||||||
| 0.184060125 | 1/5.4330 | ||||||||
| :: |
::data[format=table]
| Q(1.0) | Q(1.1) | Q(1.2) | Q(1.3) | Q(1.4) | Q(1.5) | Q(1.6) | Q(1.7) | Q(1.8) | Q(1.9) |
|---|---|---|---|---|---|---|---|---|---|
| 0.158655254 | 1/6.3030 | ||||||||
| 0.135666061 | 1/7.3710 | ||||||||
| 0.115069670 | 1/8.6904 | ||||||||
| 0.096800485 | 1/10.3305 | ||||||||
| 0.080756659 | 1/12.3829 | ||||||||
| 0.066807201 | 1/14.9684 | ||||||||
| 0.054799292 | 1/18.2484 | ||||||||
| 0.044565463 | 1/22.4389 | ||||||||
| 0.035930319 | 1/27.8316 | ||||||||
| 0.028716560 | 1/34.8231 | ||||||||
| :: |
::data[format=table]
| Q(2.0) | Q(2.1) | Q(2.2) | Q(2.3) | Q(2.4) | Q(2.5) | Q(2.6) | Q(2.7) | Q(2.8) | Q(2.9) |
|---|---|---|---|---|---|---|---|---|---|
| 0.022750132 | 1/43.9558 | ||||||||
| 0.017864421 | 1/55.9772 | ||||||||
| 0.013903448 | 1/71.9246 | ||||||||
| 0.010724110 | 1/93.2478 | ||||||||
| 0.008197536 | 1/121.9879 | ||||||||
| 0.006209665 | 1/161.0393 | ||||||||
| 0.004661188 | 1/214.5376 | ||||||||
| 0.003466974 | 1/288.4360 | ||||||||
| 0.002555130 | 1/391.3695 | ||||||||
| 0.001865813 | 1/535.9593 | ||||||||
| :: |
::data[format=table]
| Q(3.0) | Q(3.1) | Q(3.2) | Q(3.3) | Q(3.4) | Q(3.5) | Q(3.6) | Q(3.7) | Q(3.8) | Q(3.9) | Q(4.0) |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.001349898 | 1/740.7967 | |||||||||
| 0.000967603 | 1/1033.4815 | |||||||||
| 0.000687138 | 1/1455.3119 | |||||||||
| 0.000483424 | 1/2068.5769 | |||||||||
| 0.000336929 | 1/2967.9820 | |||||||||
| 0.000232629 | 1/4298.6887 | |||||||||
| 0.000159109 | 1/6285.0158 | |||||||||
| 0.000107800 | 1/9276.4608 | |||||||||
| 0.000072348 | 1/13822.0738 | |||||||||
| 0.000048096 | 1/20791.6011 | |||||||||
| 0.000031671 | 1/31574.3855 | |||||||||
| :: |
Generalization to high dimensions
The Q-function can be generalized to higher dimensions:
:Q(\mathbf{x})= \mathbb{P}(\mathbf{X}\geq \mathbf{x}), where \mathbf{X}\sim \mathcal{N}(\mathbf{0},, \Sigma) follows the multivariate normal distribution with covariance \Sigma and the threshold is of the form \mathbf{x}=\gamma\Sigma\mathbf{l}^* for some positive vector \mathbf{l}^*\mathbf{0} and positive constant \gamma0. As in the one dimensional case, there is no simple analytical formula for the Q-function. Nevertheless, the Q-function can be approximated arbitrarily well as \gamma becomes larger and larger.
References
References
- "The Q-function".
- (2009-03-05). "Basic properties of the Q-function".
- [http://mathworld.wolfram.com/NormalDistributionFunction.html Normal Distribution Function – from Wolfram MathWorld]
- (1991). "MILCOM 91 - Conference record".
- (2020). "A Novel Extension to Craig's Q-Function Formula and Its Application in Dual-Branch EGC Performance Analysis". IEEE Transactions on Communications.
- Gordon, R.D.. (1941). "Values of Mills' ratio of area to bounding ordinate and of the normal probability integral for large values of the argument". Ann. Math. Stat..
- (1979). "Simple Approximations of the Error Function Q(x) for Communications Applications". IEEE Transactions on Communications.
- (2003). "New exponential bounds and approximations for the computation of error probability in fading channels". IEEE Transactions on Wireless Communications.
- (2020). "Global minimax approximations and bounds for the Gaussian Q-function by sums of exponentials". IEEE Transactions on Communications.
- (2020). "Coefficients for Global Minimax Approximations and Bounds for the Gaussian Q-Function by Sums of Exponentials [Data set]".
- (2007). "An Improved Approximation for the Gaussian Q-Function". IEEE Communications Letters.
- (2021). "Improved coefficients for the Karagiannidis–Lioumpas approximations and bounds to the Gaussian Q-function". IEEE Communications Letters.
- (2011). "Versatile, Accurate, and Analytically Tractable Approximation for the Gaussian Q-Function". IEEE Transactions on Communications.
- Abreu, Giuseppe. (2012). "Very Simple Tight Bounds on the Q-Function". IEEE Transactions on Communications.
- (1962). "Mills ratio for multivariate normal distributions". Journal of Research of the National Bureau of Standards Section B.
- (2016). "The normal law under linear restrictions: simulation and estimation via minimax tilting". Journal of the Royal Statistical Society, Series B.
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::