From Wikibooks, open books for an open world
Uniform
Probability density functionUsing maximum convention
Cumulative distribution function
Notation
U
(
a
,
b
)
{\displaystyle {\mathcal {U}}(a,b)}
Parameters
−
∞
<
a
<
b
<
∞
{\displaystyle -\infty <a<b<\infty \,}
Support
x
∈
[
a
,
b
]
{\displaystyle x\in [a,b]}
PDF
{
1
b
−
a
for
x
∈
[
a
,
b
]
0
otherwise
{\displaystyle {\begin{cases}{\frac {1}{b-a}}&{\text{for }}x\in [a,b]\\0&{\text{otherwise}}\end{cases}}}
CDF
{
0
for
x
<
a
x
−
a
b
−
a
for
x
∈
[
a
,
b
)
1
for
x
≥
b
{\displaystyle {\begin{cases}0&{\text{for }}x<a\\{\frac {x-a}{b-a}}&{\text{for }}x\in [a,b)\\1&{\text{for }}x\geq b\end{cases}}}
Mean
1
2
(
a
+
b
)
{\displaystyle {\tfrac {1}{2}}(a+b)}
Median
1
2
(
a
+
b
)
{\displaystyle {\tfrac {1}{2}}(a+b)}
Mode
any value in
[
a
,
b
]
{\displaystyle [a,b]}
Variance
1
12
(
b
−
a
)
2
{\displaystyle {\tfrac {1}{12}}(b-a)^{2}}
Skewness
0
Ex. kurtosis
−
6
5
{\displaystyle -{\tfrac {6}{5}}}
Entropy
ln
(
b
−
a
)
{\displaystyle \ln(b-a)\,}
MGF
e
t
b
−
e
t
a
t
(
b
−
a
)
{\displaystyle {\frac {\mathrm {e} ^{tb}-\mathrm {e} ^{ta}}{t(b-a)}}}
CF
e
i
t
b
−
e
i
t
a
i
t
(
b
−
a
)
{\displaystyle {\frac {\mathrm {e} ^{itb}-\mathrm {e} ^{ita}}{it(b-a)}}}
The (continuous) uniform distribution, as its name suggests, is a distribution with probability densities that are the same at each point in an interval. In casual terms, the uniform distribution shapes like a rectangle.
Mathematically speaking, the probability density function of the uniform distribution is defined as
f
:
[
a
,
b
]
→
R
{\displaystyle f\colon [a,b]\to \mathbb {R} }
f
(
x
)
=
1
b
−
a
{\displaystyle f\left(x\right)={1 \over {b-a}}}
And the cumulative distribution function is:
F
(
x
)
=
{
0
,
if
x
≤
a
x
−
a
b
−
a
,
if
a
<
x
<
b
1
,
if
x
≥
b
{\displaystyle F\left(x\right)={\begin{cases}0,&{\mbox{if }}x\leq a\\{{x-a} \over {b-a}},&{\mbox{if }}a<x<b\\1,&{\mbox{if }}x\geq b\end{cases}}}
We derive the mean as follows.
E
[
X
]
=
∫
−
∞
∞
x
f
(
x
)
d
x
{\displaystyle \operatorname {E} [X]=\int _{-\infty }^{\infty }xf(x)dx}
As the uniform distribution is 0 everywhere but [a , b ] we can restrict ourselves that interval
E
[
X
]
=
∫
a
b
1
b
−
a
x
d
x
{\displaystyle \operatorname {E} [X]=\int _{a}^{b}{1 \over {b-a}}xdx}
E
[
X
]
=
1
(
b
−
a
)
1
2
x
2
|
a
b
{\displaystyle \operatorname {E} [X]=\left.{1 \over (b-a)}{1 \over 2}x^{2}\right|_{a}^{b}}
E
[
X
]
=
1
2
(
b
−
a
)
[
b
2
−
a
2
]
{\displaystyle \operatorname {E} [X]={1 \over 2(b-a)}\left[b^{2}-a^{2}\right]}
E
[
X
]
=
b
+
a
2
{\displaystyle \operatorname {E} [X]={b+a \over 2}}
We use the following formula for the variance.
Var
(
X
)
=
E
[
X
2
]
−
(
E
[
X
]
)
2
{\displaystyle \operatorname {Var} (X)=\operatorname {E} [X^{2}]-(\operatorname {E} [X])^{2}}
Var
(
X
)
=
[
∫
−
∞
∞
f
(
x
)
⋅
x
2
d
x
]
−
(
b
+
a
2
)
2
{\displaystyle \operatorname {Var} (X)=\left[\int _{-\infty }^{\infty }f(x)\cdot x^{2}dx\right]-\left({b+a \over 2}\right)^{2}}
Var
(
X
)
=
[
∫
a
b
1
b
−
a
x
2
d
x
]
−
(
b
+
a
)
2
4
{\displaystyle \operatorname {Var} (X)=\left[\int _{a}^{b}{1 \over {b-a}}x^{2}dx\right]-{(b+a)^{2} \over 4}}
Var
(
X
)
=
1
b
−
a
1
3
x
3
|
a
b
−
(
b
+
a
)
2
4
{\displaystyle \operatorname {Var} (X)=\left.{1 \over {b-a}}{1 \over 3}x^{3}\right|_{a}^{b}-{(b+a)^{2} \over 4}}
Var
(
X
)
=
1
3
(
b
−
a
)
[
b
3
−
a
3
]
−
(
b
+
a
)
2
4
{\displaystyle \operatorname {Var} (X)={1 \over 3(b-a)}[b^{3}-a^{3}]-{(b+a)^{2} \over 4}}
Var
(
X
)
=
4
(
b
3
−
a
3
)
−
3
(
b
+
a
)
2
(
b
−
a
)
12
(
b
−
a
)
{\displaystyle \operatorname {Var} (X)={4(b^{3}-a^{3})-3(b+a)^{2}(b-a) \over 12(b-a)}}
Var
(
X
)
=
(
b
−
a
)
3
12
(
b
−
a
)
{\displaystyle \operatorname {Var} (X)={(b-a)^{3} \over 12(b-a)}}
Var
(
X
)
=
(
b
−
a
)
2
12
{\displaystyle \operatorname {Var} (X)={(b-a)^{2} \over 12}}