(∑_(n=0)^num)((((2 n-num))^2)/(n! (num-n)!))

Total[Cos[RandomReal[{0,2*Pi},100000]]^2]

Total[Sin[RandomReal[{0,2*Pi},100000]]^2]

Plot[Cos[x]^2,{x,-4*Pi, 4*Pi}]