Statistics/Distributions/Discrete Uniform

From testwiki
Jump to navigation Jump to search

Discrete Uniform Distribution

The discrete uniform distribution (not to be confused with the continuous uniform distribution) is where the probability of equally spaced possible values is equal. Mathematically this means that the probability density function is identical for a finite set of evenly spaced points. An example of would be rolling a fair 6-sided die. In this case there are six, equally like probabilities.

One common normalization is to restrict the possible values to be integers and the spacing between possibilities to be 1. In this setup, the only two parameters of the function are the minimum value (a), the maximum value (b). (Some even normalize it more, setting a=1.) Let n=b-a+1 be the number of possibilities. The probability density function is then

f:{a,a+1,,b1,b}

f(x)=1n

Mean

Let S={a,a+1,,b1,b}. The mean (notated as E[X]) can then be derived as follows:

E[X]=xSxf(x)=i=0n1(1n(a+i))
E[X]=1n(i=0n1a+i=0n1i)

Remember that in i=0mi=(m2+m)/2

E[X]=1n(na+(n1)2+(n1)2)
E[X]=2na+n22n+1+n12n
E[X]=2a+n12
E[X]=a+b2

Variance

The variance (E[(XEX)2]) can be derived:

Var(X)=E[(XE[X])2]=xSf(x)(xE[X])2=i=0n1(1n((a+i)a+b2)2)
Var(X)=1ni=0n1(a+2ib2)2
Var(X)=14ni=0n1(a2+4ai2ab+4i24ib+b2)
Var(X)=14n[i=0n1(a22ab+b2)+i=0n1(4ai4ib)+i=0n14i2]
Var(X)=14n[n(a22ab+b2)+4(ab)i=0n1i+4i=0n1i2]

Remember that in i=0mi2=m(m+1)(2m+1)/6

Var(X)=14n[n(ba)2+4(ab)[(n1)n/2]+4[(n1)n(2n1)/6]]
Var(X)=14n[n(n1)22(n1)(n1)n+2(n1)n(2n1)/3]
Var(X)=14[(n1)2+2(n1)(2n1)/3]
Var(X)=112[3(n1)2+2(n1)(2n1)]
Var(X)=112[3(n22n+1)+2(2n23n+1)]
Var(X)=n2112

Template:BookCat