1
$\begingroup$

In the setting of the Binomial Distribution, I am trying to figure out how to plot the probability of obtaining $k \ge 31$ for fixed $n$, for success probabilities $p$ between $0$ and $1$.

Why does the code below not work?

DiscretePlot[Table[CDF[BinomialDistribution[50, p], k], {k, {31}}] // Evaluate, {p, 1}, ExtentSize -> Left]
$\endgroup$
3
$\begingroup$
Plot[SurvivalFunction[BinomialDistribution[50, p], 30], {p, 0, 1}]

Mathematica graphics

Note: As noted by @user120911, this function simplifies to BetaRegularized[p, 1 + m, -m + n]

FullSimplify[SurvivalFunction[BinomialDistribution[n, p], m], 
 Assumptions -> {Element[{m, n}, Integers], n >= m >= 0}]

BetaRegularized[p, 1 + m, -m + n]

So

Plot[BetaRegularized[p, 1 + 30, -30 + 50], {p, 0, 1}]

gives the same picture.

$\endgroup$
  • $\begingroup$ You need 30, not 31... $\endgroup$ – ciao Jun 6 '17 at 23:16
  • $\begingroup$ @kglr, it turns out your solution simplifies nicely to the Regularized Beta Function. $\endgroup$ – user120911 Jun 19 '17 at 9:32
  • $\begingroup$ @user120911, good observation. I added your comment to the post. $\endgroup$ – kglr Jun 19 '17 at 23:31
1
$\begingroup$
Plot[Probability[k >= 31, 
  k \[Distributed] BinomialDistribution[50, p]], 
  {p, 0, 1}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.