If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Binompdf and binomcdf functions

This tutorial demonstrates how to use a graphing calculator to calculate probabilities for a binomial distribution. It covers key concepts like binomial random variables, binomial probability distribution function, and binomial cumulative distribution function, using the example of making free throws in basketball.

Want to join the conversation?

  • blobby green style avatar for user Bryan Chris
    I'm curious if there is a hand written formula for cumulative binomial equations?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • leaf orange style avatar for user miskimit
      Well, yes and no. The binomcdf formula is just the sum of all the binompdf up to that point (unfortunately no other mathematical shortcut to it, from what I've gathered on the internet). So you can't just calculate on paper for large values.

      I looked into this specifically because I don't have a graphing calculator and I'll have to write a program into my Casio-FX3650pII which will include a for loop that adds up all the binompdfs up to X. I'm hoping that the 350 byte storage my calculator has will be sufficient for that program! :D

      Good luck.
      (19 votes)
  • blobby green style avatar for user meighu
    problem is that I have no idea how to play baseball..... :-(
    (10 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Bal Krishna Jha
    You can also use scipy library to do so:
    scipy.stats import binom
    binom.pmf(4,7,0.35)
    binom.cdf(4,7,0.35)
    (7 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Nikita malhotra
    In case of BinomialCDF, I tried solving this problem manually. Because P(X<=4), therefore, I calculated P(X=1)+ P(X=2)+P(X=3)+P(X=4) = 0.89537 which does not match with your result.

    Then I calculated P(X=1)+ P(X=2)+P(X=3)+P(X=4)+P(X=5) = 0.94197 which also does not match with your result.

    Am I doing it wrong? Please guide.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • cacteye blue style avatar for user Jerry Nilsson
      Don't forget to include 𝑝(0), the probability of missing all seven free throws.

      – – –

      The probability of making exactly 𝑛 free throws is
      𝑝(𝑛) = 7!∕(𝑛!(7 − 𝑛)!) ∙ 0.35^𝑛 ∙ (1 − 0.35)^(7 − 𝑛)

      The probability of making at most four free throws is
      𝑝(0) + 𝑝(1) + 𝑝(2) + 𝑝(3) + 𝑝(4)
      (7 votes)
  • aqualine tree style avatar for user jameewc
    What function would I use for something like P(X>8)?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Sonia Parveen
    Where can i find the calculator for free online?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Lillian  Buckley
    Is there a binomcdf calculator trick or something to do this for questions that want us to find the probability that is greater or more than x without having to find the binompdf of each number and adding them up?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • boggle purple style avatar for user smjank67
    what can u do if you want to find at most? instead of less than 5 could you do more than 5?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user daniella
      To find the probability of "at most" a certain number of successes, you use the cumulative distribution function directly. For instance, "at most 5 successes" is the same as P(X ≤ 5), which you can calculate using BINOM.DIST with the cumulative option set to TRUE in Excel, or binomcdf in a calculator.
      (1 vote)
  • leaf blue style avatar for user tarfail
    from a graphical standpoint, what does p(x=4) represent versus p(x<=4)? (assuming p = 0.35 for each trial and we still have 7 trials)
    (2 votes)
    Default Khan Academy avatar avatar for user
    • starky seedling style avatar for user deka
      p(x=4) is the height of the bar on x=4 in the histogram
      while p(x<=4) is the sum of all heights of the bars from x=0 to x=4

      #this only works for a discrete function like the one in video
      #thankfully or not, all binomial distributions are discrete
      #for a continuous function p(x=4) = 0
      (1 vote)
  • blobby green style avatar for user bmwhitcomb
    Does anyone happen to know the corresponding Excel formulas to go with these? I know to use =BINOM.DIST(x,n,p) for < or = to, but what about if it says P(x>or = to 3) n=4,p=0.4? When the sign is switched the EXCEL formula works but doesn't for greater than or equal to. Please help, we aren't allowed calculators during our exams only excel. Thank you so so much.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user daniella
      For situations where you want to find P(X ≥ 3) with n = 4, p = 0.4 using Excel, you can use the =1 - BINOM.DIST(x-1, n, p, TRUE) formula, where TRUE specifies the cumulative distribution function (CDF). This formula essentially calculates the complement of P(X < 3) to find P(X ≥ 3). For your specific case, it would be =1 - BINOM.DIST(2, 4, 0.4, TRUE).
      (1 vote)

Video transcript

- [Instructor] What we're going to do in this video is use a graphing calculator to answer some questions dealing with binomial random variables and this is useful because if you're taking the AP Stats, the Advanced Placement Statistics test, you are allowed to use a graphing calculator and so this could actually save you significant time. So it says here I have a 0.35 probability of making a free throw. What is the probability of making four out of seven free throws? Well this is a classic binomial random variable question. If we said the binomial random variable x is equal to number of made free throws from seven, I can say seven trials or seven shots, seven trials with the probability of success is equal to 0.35 for each free throw. So really this question amounts to what is the probability that my binomial random variable x is equal to four? Now what we're going to see is we can use a function on our TI-84, not named binomc, or binompdf, I should say, binompdf which is short for binomial probability distribution function, and what you're going to want to do here is use three arguments. So the first one is the number of trials. So in this case, it is seven, and if you're doing it on the free response section of the AP test, you should make it very clear that that right over there is your n, the graders will actually look for that to make sure that you're not just guessing what goes where. So you would say that is my n and then you would say your probability, 0.35, and once again if you're taking the test, you should mark that. That is your p. And then last but not least, what is the probability that a binomial variable when you're taking seven trials with a probability of success of each of them being 0.35 that you have exactly four successes. So now lets get our calculator out and actually do that. Alright, so now we have our graphing calculator out. So there's a couple of ways to input this. You could just type it in directly, that could take time. You could do second in this little blue distribution here. So there you have it. In order to get to the function, you could either scroll down or you could scroll up to get to the bottom of the list and you see it right over here, binompdf. You could do alphaA to go there really fast or you could just scroll up here, click enter, and then, you have the number of trials that you want to deal with. Well we're gonna take seven trials, the probability of success in each trial is 0.35, and then my x value, well I wanna find the probability that my binomial random variable is equal to four, four successes out of the trials. And now let me go to paste and this is actually going to type in exactly what we had before. Notice this is the exact same thing. So I have seven trials, p is equals to 0.35, and I wanna know the probability of having exactly four successes, and then I just click enter and I get, there you go, 0.14. So this is equal to approximately 0.14. Now based on the same binomial random variable, if we're then asked what is the probability of making less than five free throws? So we could say this is the probability that x is less than five or we could say this is the probability that x is less than or equal to four, and the reason why I write it this way is because using it this way you can now use the binomial cumulative distribution function on my calculator. So if I just type in binom, and once again, I'm gonna seven of binomcdf, I should say, cumulative distribution function and I'm gonna take seven trials and the probability of success in each trial is 0.35 and now when I type in four here, it doesn't mean what is the probability that I make exactly four free throws, it is the probability that I make zero, one, two, three, or four free throws. So all of the possible outcomes of my binomial random variable up to and including this value right over here. So let me get that, let me get my calculator back, so once again, I can go to second, distribution, I'll scroll up to go to the bottom of the list and here you see it, binomial cumulative distribution function. So let me go there, click enter. And once again, seven trials, my p is 0.35, and my x value is four, but now this is not going to be giving me the probability that my binomial random variable equals four, this is going to give me the probability that I get any value up to and including four. So this should be a higher probability. And there you have it, it is approximately 0.94. So this is approximately 0.94. So hopefully you found that helpful. These calculators can be very useful especially on something like an AP Stats exam.