(* Gill's homework assignment *)

samples=10000;

ℰ[α_,β_,λ_]:=
Mean[-Sign[Cos[(α-λ)Degree]]Sign[Cos[(β-λ)Degree]]//N]

λ1:=RandomReal[{0,360},samples];
λ2:=RandomReal[{0,360},samples];
λ3:=RandomReal[{0,360},samples];
λ4:=RandomReal[{0,360},samples];
λ=RandomReal[{0,360},samples];

meanSum[λ1_,λ2_,λ3_,λ4_]:=ℰ[0,135,λ1]-ℰ[0,45,λ2]-ℰ[90,45,λ3]-ℰ[90,135,λ4]

meanSum[λ1,λ2,λ3,λ4]   (* Experiment 1 *)

meanSum[λ,λ,λ,λ]    (* Experiment 2 *)

(*  Exactly 2.0  *)

Histogram[{Table[meanSum[λ1,λ2,λ3,λ4],{1000}]},{.008},"Count",PlotRange->{{1.9,2.1},{0,250}}]

Histogram[Table[λx=λ;meanSum[λx,λx,λx,λx],{1000}],{.008},"Count",PlotRange->{{1.9,2.1},{0,1000}}]