Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- F[x_] := 1 - GammaRegularized[n, a*x];
- Fi[p_] := InverseGammaRegularized[n, 1 - p]/a;
- ci[c_, a_, n_] := {Fi[a, n, (1-c)/2], Fi[a, n, c+(1-c)/2]}
- (* Random draw from an exponential distribution given rate param. *)
- getGap[a_] := -1/a*Log[RandomReal[]]
- betw[x_, {a_, b_}] := Boole[a <= x <= b]
- c = .95;
- a = 1/.75;
- n = 40;
- ci0 = ci[c, a, n];
- N@Mean@Table[betw[Sum[getGap[a], {n}], ci0], {100000}]
- ----> 0.94995
Add Comment
Please, Sign In to add comment