In probability and statistics, the **Irwin–Hall distribution**, named after Joseph Oscar Irwin and Philip Hall, is a probability distribution for a random variable defined as the sum of a number of independent random variables, each having a uniform distribution. For this reason it is also known as the **uniform sum distribution**.

The generation of pseudo-random numbers having an approximately normal distribution is sometimes accomplished by computing the sum of a number of pseudo-random numbers having a uniform distribution; usually for the sake of simplicity of programming. Rescaling the Irwin–Hall distribution provides the exact distribution of the random variates being generated.

This distribution is sometimes confused with the Bates distribution, which is the **mean** (not **sum**) of *n* independent random variables uniformly distributed from 0 to 1.

The Irwin–Hall distribution is the continuous probability distribution for the sum of *n* independent and identically distributed *U*(0, 1) random variables:

X
=
∑
k
=
1
n
U
k
.
The probability density function (pdf) is given by

f
X
(
x
;
n
)
=
1
2
(
n
−
1
)
!
∑
k
=
0
n
(
−
1
)
k
(
n
k
)
(
x
−
k
)
n
−
1
sgn
(
x
−
k
)
where sgn(*x − k*) denotes the sign function:

sgn
(
x
−
k
)
=
{
−
1
x
<
k
0
x
=
k
1
x
>
k
.

Thus the pdf is a spline (piecewise polynomial function) of degree *n* − 1 over the knots 0, 1, ..., *n*. In fact, for *x* between the knots located at *k* and *k* + 1, the pdf is equal to

f
X
(
x
;
n
)
=
1
(
n
−
1
)
!
∑
j
=
0
n
−
1
a
j
(
k
,
n
)
x
j
where the coefficients *a*_{j}(k,n) may be found from a recurrence relation over *k*

a
j
(
k
,
n
)
=
{
1
k
=
0
,
j
=
n
−
1
0
k
=
0
,
j
<
n
−
1
a
j
(
k
−
1
,
n
)
+
(
−
1
)
n
+
k
−
j
−
1
(
n
k
)
(
n
−
1
j
)
k
n
−
j
−
1
k
>
0
The coefficients are also A188816 in OEIS. The coefficients for the cumulative distribution is A188668.

The mean and variance are *n*/2 and *n*/12, respectively.

For *n* = 1, *X* follows a uniform distribution:
f
X
(
x
)
=
{
1
0
≤
x
≤
1
0
otherwise
For *n* = 2, *X* follows a triangular distribution:
f
X
(
x
)
=
{
x
0
≤
x
≤
1
2
−
x
1
≤
x
≤
2
For *n* = 3,
f
X
(
x
)
=
{
1
2
x
2
0
≤
x
≤
1
1
2
(
−
2
x
2
+
6
x
−
3
)
1
≤
x
≤
2
1
2
(
x
2
−
6
x
+
9
)
2
≤
x
≤
3
For *n* = 4,
f
X
(
x
)
=
{
1
6
x
3
0
≤
x
≤
1
1
6
(
−
3
x
3
+
12
x
2
−
12
x
+
4
)
1
≤
x
≤
2
1
6
(
3
x
3
−
24
x
2
+
60
x
−
44
)
2
≤
x
≤
3
1
6
(
−
x
3
+
12
x
2
−
48
x
+
64
)
3
≤
x
≤
4
For *n* = 5,
f
X
(
x
)
=
{
1
24
x
4
0
≤
x
≤
1
1
24
(
−
4
x
4
+
20
x
3
−
30
x
2
+
20
x
−
5
)
1
≤
x
≤
2
1
24
(
6
x
4
−
60
x
3
+
210
x
2
−
300
x
+
155
)
2
≤
x
≤
3
1
24
(
−
4
x
4
+
60
x
3
−
330
x
2
+
780
x
−
655
)
3
≤
x
≤
4
1
24
(
x
4
−
20
x
3
+
150
x
2
−
500
x
+
625
)
4
≤
x
≤
5
The Irwin-Hall distribution is similar to the Bates distribution, but still featuring only integers as parameter. An extension to real-valued parameters is possible by adding also a random uniform variable with N-trunc(N) as width.

When using the Irwin-Hall for data fitting purposes one problem is that the IH is not very flexible because the parameter n needs to be an integer. However, instead of summing n equal uniform distributions, we could also add e.g. U+0.5U to address also the case n=1.5 (giving a trapezoidal distribution).