P(ξ=k)=1/n (k=1,2,3……,n)截到n吧
E(ξ)=1×1/n+2×1/n+3×1/n+.+n×1/n)
=(1+2+3+.+n)/n
=(n+1)*n/2*1/n=(n+1)/2
D(ξ)=[1-(n+1)/2]²*1/n+[2-(n+1)/2]²*1/n+[3-(n+1)/2]²*1/n+.+[n-(n+1)/2]²*1/n
={(1²+2²+.+n²)+n(n+1)²/4-[(n+1)+2(n+1)+3(n+1)+.+n(n+1)]}/n
={(1²+2²+.+n²)+n(n+1)²/4-(n+1)(1+2+3+.+n)}/n
=[n(n+1)(2n+1)/6+n(n+1)²/4-n(n+1)²/2]/n
=[n(n+1)(2n+1)/6-n(n+1)²/4]/n
=1/12(n+1)[4n+2-3n-3]
=(n²-1)/12