Talk:Binomial distribution

message: I was looking for a pointer to quickly simulate a Binomial trial.  That is, given a p and an n, I want to randomly select a result with a Binomial distribution.  I know I can approximate this with a normal distribution, but I would prefer an exact result if it can be calculated quickly for n < 10,000.  I'm sure others have come here looking as well.  Thanks.
:I added two references to the article which describe binomial random variate generation. A modern C implementation of Kachitvichyanukul and Schmeiser's BTPE algorithm is available as part of the GNU Scientific Library. --MarkSweep✍ 04:08, 8 October 2005 (UTC)
thread_title:  Simulation? 

message: Okay, maybe this is standard jargon somewhere, but I've never come across it until today. I guess "mass" makes sense by the physical analogy to density. Honestly, I think it's stupid language. Should we also speak of cumulative mass distribution functions? Be consistent! I'm not going to change it, but a mathematician should. At the very least link it to the pmf page.
: pmf is fairly standard.  It is linked there now.  No, cumulative mass distribution function is not a phrase I have heard. --Richard Clegg 08:25, 6 February 2006 (UTC)
thread_title:  Probability mass function? 

message: I really dislike the "nmemonic" section.  If anyone else agrees, please delete it.  McKay 14:55, 11 June 2006 (UTC)
replies: text: I agree. The mnemonic section is laughable. I'm deleting it. Rjmorris 14:44, 18 June 2006 (UTC)
thread_title:  "nmemonic" section 

message: The article currently states: <I>The formula for Bézier curves was inspired by the binomial distribution.</I>
Would someone care to source that statement? It seems rather dubious to me, but if it's true it's worthy of a proper  explanation and not the vague description of being "inspired by". Certainly the Bernstein polynomials, which constitute the basis functions for Béziers, contain a Binomial coefficient. But binomial coefficients exist all over the place. It doesn't necessarily imply that they have much at all to do with the Binomial distribution. 
From reading about Bézier curves I've always had the impression that the decision to use Bersteins as their parametrization wasn't 'inspired' by anything, but merely chosen from a group of candidates on the merit of their desireable properties. (Being such properties as the fact that curve is guaranteed to be contained within the convex hull of the control points, that reversing the control points does not change the curve, that the tangents at the endpoints consist of the line between the endpoint and the neighboring control point, etc). --130.237.179.166 14:48, 3 September 2006 (UTC)
replies: text: I'm deleting this since no justification has been offered.  Zillions of things are "inspired" by the binomial distribution anyway and I don't see why this one is important enough to single out even if it is true.  McKay 04:31, 28 October 2006 (UTC)
thread_title:  Relationship to Bezier curves? 

message: I feel like there could be a better example than picking 500 people out of a population "with replacement" and seeing how many were green-eyed.  Perhaps a more sensical and applicable example could be: out of 50 web servers, each of which has a 1% chance of failing by the end of the day, how many failed servers do you have at the end of the day?
—The preceding unsigned comment was added by 18.216.0.100 (talk • contribs) .
: I agree.  The current example suffers from the need to do sampling with replacement, which will seem unnatural to people unaccustomed to sampling theory. --McKay 05:52, 29 November 2006 (UTC)
replies: text: I agree with both of you. How about simply the "toss a coin..."? Hackneyed, perhaps, for us, but surely we want the general reader to "get the picture" as easily as possible? Gerald Tros 01:41, 21 May 2007 (UTC)

text: I agree I like the original better as well. Sander123 09:53, 21 May 2007 (UTC)
thread_title:  Better Example 

message: This section is my first contribution. I sincerely hope it's sensible to have done so and that it is a (potential) boon to readers. I'm honing it, adding links, references, improving text etc. Please give me a couple of days, I'll post it in one single edit. I'd appreciate any advice you have for me regarding content choice, style etc. Thank you. Thanks already to Michael Hardy. Gerald Tros 01:34, 25 April 2007 (UTC)
replies: text: I can see that it would be easier. But it would require more starting knowledge. I'd guess that anybody who knows about generating functions does not need to look up the derivation of the mean in wikipedia. Therefore I think the derivations should be kept as elementary as possible. Sander123 13:20, 5 June 2007 (UTC)
thread_title:  Explicit derivations of mean and variance 

message: The cdf of a discrete distribution must be piecewise constant. ПБХ 15:13, 21 September 2007 (UTC)
thread_title:  Incorrect cdf 

message: I hope somebody could help me in finding derivations or how to derive the skewness and kurtosis, even link to other sites will be much appreciated.  —Preceding unsigned comment added by Student29 (talk • contribs) 19:29, 16 January 2008 (UTC)
thread_title:  derivations 

message: After giving the expectation as np, the article states "This fact is easily proven as follows. Suppose first that we have exactly one Bernoulli trial. We have two possible outcomes, 1 and 0, with the first having probability p and the second having probability 1 − p; the mean for this trial is given by μ = p."  This is not a proof.  These sentences should really just be removed.  —Preceding unsigned comment added by 68.50.194.132 (talk) 19:59, 16 February 2008 (UTC)
thread_title:  bad language 

message: In the section entitled Mean, variance and mode, it isn't clear to me how the expression given follows from "Using the definition of variance, we have..."  Should I try to find this in the entry for variance, figure it out from the problem statement, or use the definition of variance given just above?  In any case I don't see how it follows.Telliott (talk) 11:43, 14 March 2008 (UTC)
thread_title:  Variance 

message: The figures have unlabeled axes, making them pretty much useless. Can someone either introduce new figures, or edit the existing ones to have axis labels? 209.94.128.119 (talk) 01:30, 13 November 2008 (UTC)
thread_title:  Bad Figures 

message: The article for Hypergeometric distribution describes how it is used for sampling without replacement and states that Binomial Distribution is used for sampling with replacement. How is Binomial Distribution method used for sampling? Virgil H. Soule (talk) 18:11, 2 July 2009 (UTC)
thread_title:  Sampling 

message: Removed:
As another example, assume 5% of a very large population to be green-eyed. You pick 100 people randomly. The number of green-eyed people you pick is a random variable X which approximately follows a binomial distribution with n = 100 and p = 0.05 (strictly a hypergeometric distribution).
If it isn't strictly a binomial distribution, then it is a bad example.
In lieu of misusing a hypergeometric distribution as an example of a binomial distribution, perhaps add a section detailing the relationship and how they are similar and yet different? Madkaugh (talk) 00:42, 13 October 2009 (UTC)
thread_title:  Bad example 

message: It doesn't make any sense for the parameter n to be 0.  Most texts limit n to be a natural number.  —Preceding unsigned comment added by 128.187.81.187 (talk) 21:03, 23 November 2009 (UTC)
replies: text: The case n=0 give a valid distribution, which is a natural part of the same family and which is required in more complicated manipulations of distributions such as compounding. Melcombe (talk) 10:36, 24 November 2009 (UTC)
thread_title:  Paramater n 

message: It's common in Wikipedia math articles to discuss algorithms for computing quantities of interest.  On this page it would be very helpful to have a discussion of computing the cumulative distribution function (CDF).  The article does mention various methods that can be used in various circumstances, but this is an incomplete solution at best.  For example, the article doesn't provide any guidance about choosing between (a) a combination of direct summation and the normal approximation and the poisson approximation, (b) a method based on the incomplete beta distribution, and (c) something else. A discussion of computing the CDF would be useful to a lot of people.  ATBS 22:28, 30 November 2009 (UTC)
thread_title:  Computing the cumulative distribution function (CDF) 

message: The second rule of thumb for normal approximations looks suspicious. It can be written in the following form: use normal approximation whenever
: n · |skewness| ≥ 3.33
In particular that rule claims normal approximation should not be used for any n when p = ½. So the sign should probably be reversed, and the factor n omitted?  … stpasha »  22:41, 30 November 2009 (UTC)
replies: text: Fixed. -12.7.202.2 (talk) 18:29, 14 May 2010 (UTC)
thread_title:  Normal approximations 

message: Hi all,
I came up with a way to add variance to the binomial distribution, for this purpose I consider the history of success compare to the expected value.
Here is my development (I hope it is OK to have a link)
I would really like to know what you think, to me it looks very cool as I use expected value and sum of binomial series and I didn't see anything like it anywhere.
What do you say?
Ofermano (talk) 16:31, 28 June 2011 (UTC)
thread_title:  Controlling the variance 

message: Would it be possible to write an introductory section that gives just a conceptual description of what the binomial distribution is about, before we enter the maths? Like tossing a coin, or drawing marbles from a box, and replacing the drawn marble each time (and mixing the box up again)? --JN466 02:18, 3 July 2011 (UTC)
replies: text: Good idea. The lead sort of introduces it, but there should be room for a more detailed overview. Sources shouldn't be too tricky to find. Alzarian16 (talk) 04:20, 3 July 2011 (UTC)
thread_title: Accessibility

message: Hi, isn't the standard deviation calculated as : sqrt((p(1 − p) n)) ? In the article it is written as: sqrt((p(1 − p)/n))  — Preceding unsigned comment added by 213.55.184.169 (talk) 06:31, 15 March 2012 (UTC)
thread_title: Error in article

message: Is it my imagination or are only the first and last probabilities for the biased coin correct?  I have run that in SAS 
data _null_ ;
  p = 0.3 ; 
  do i = 0 to 6 ;
    prob= (p**i) * ((1-p)**(6-i)) ; 
    put i=  prob= ; 
  end ; 
run ; 
and I get 
i=0 prob=0.117649
i=1 prob=0.050421
i=2 prob=0.021609
i=3 prob=0.009261
i=4 prob=0.003969
i=5 prob=0.001701
i=6 prob=0.000729
Docsteve.518 (talk) 21:46, 15 April 2013 (UTC)
replies: text: Yes, it is your imagination. Seriously, you have forgotten to include the combinatorial coefficient. Melcombe (talk) 21:51, 15 April 2013 (UTC)
thread_title:  Cumulative distribution function -- Example 

message: Firstly, I want I am wondering about the definition of the CDF
:F(k;n,p) = \Pr(X \le k) = \sum_{i=0}^{\lfloor k \rfloor} {n\choose i}p^i(1-p)^{n-i}
From my training (and looking at the graphs on THIS page), we should be defining F on the real numbers and writing < and not ≤, that is:
:F(x) = \left\{ {\begin{array}{*{20}{l}} 0&{x < 0}\\ {\sum\limits_{j = 0}^{k - 1} {\left( {\begin{array}{*{20}{c}} n\\ k \end{array}} \right)} \,\,{p^k}{{(1 - p)}^{n - k}}}&{k - 1 \le x < k,\,\,k \in \{ 1,2,...,n\} }\\ 1&{x \ge n} \end{array}} \right.
or indeed:
:F(x) = \left\{ {\begin{array}{*{20}{l}} 0&{x < 0}\\ {\sum\limits_{j = 0}^{k - 1} f(j)}&{k - 1 \le x < k,\,\,k \in \{ 1,2,...,n\} }\\ 1&{x \ge n} \end{array}} \right.
(I also switched to j in place of i since so many applications now assume i is the corresponding complex number.)
I had already given this formula in my MK wikipedia page and was wanting to add an iterative "computer graphing formula" and so checked to see if there was one on this page and became confused with the above formula.
BTW: Here is the iterative formula I was getting ready to add.  Any suggestions here to make this clearer how to use?
:\begin{array}{*{20}{l}}{{F_0}(x) = 0}&{x < 0}\\{{F_{k + 1}}(x) = {F_k}(x) + f(k)}&{k \le x < k + 1,\,\,k = 0,1,2,...,n - 1}\\
{{F_{n + 1}}(x) = 1}&{x \ge n}\end{array}
So if you make a sequence of the probabilities values (easy), you can easily make this into a sequence of n+2 points and then draw segments as in the above graphs. Having worked this out a gazillion times for my kiddies, I finally wrote it down.
Lfahlberg (talk) 09:06, 22 November 2013 (UTC)
thread_title:  Question about Cummulative Distribution Function 

message: Please label the axes on the graphs, and state the allowable range for parameter n. Does n include zero?
71.139.165.140 (talk) 19:11, 14 December 2014 (UTC)
thread_title:  Graph, n 

message: Here is a reference to use: http://www.le.ac.uk/users/dsgp1/COURSES/MATHSTAT/5binomgf.pdf
Tal Galili (talk) 17:04, 25 March 2015 (UTC)
replies: text: I took a quick look at other probability distribution pages on Wikipedia, and I'm not seeing any derivations of the mgfs there. I suppose that doesn't necessarily disqualify us for adding the mgf to this page, but considering that this page doesn't even derive the mean or variance of the binomial, then I don't see adding this material to this page. Blahb31 (talk) 21:45, 25 March 2015 (UTC)
replies: text:  Thank you, fair point. Since MGF are very basic for using these objects in various settings, I think this type of information should be available somewhere on Wikipedia. a) would you agree? b) if so - where do you think would it fit?
Cheers, Tal Galili (talk) 22:28, 25 March 2015 (UTC)
replies: text: I'm going to say no. This is material for a textbook, not an encyclopedia. Blahb31 (talk) 11:54, 26 March 2015 (UTC)
thread_title:  We should add the moment generating function 

message: title says it all, see for example Ching-Hui Chang et. al.: "A note on Improved Approximation of the Binomiual Distribution by the Skew-Normal distribution" the American Statistician.
Kjetil B Halvorsen 13:34, 8 June 2015 (UTC)
thread_title:  We should add a section on skew-normal approximation 

message: The proof of the mode doesn't define a_k. It's relatively clear that f(k) is meant, but that should be defined (or f used)  — Preceding unsigned comment added by Andreas Mueller (talk • contribs) 00:21, 3 March 2016 (UTC)
replies: text: fixed. McKay (talk) 03:40, 3 March 2016 (UTC)
thread_title:  Mode proof doesn't define a_k 

message: Hello fellow Wikipedians,
I have just modified  on Binomial distribution. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20140515145146/http://www.mbastats.net/Content/Basic_Prob/Binomial.html to http://www.mbastats.net/Content/Basic_Prob/Binomial.html
When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).
Cheers.—InternetArchiveBot (Report bug) 21:04, 2 November 2016 (UTC)
thread_title:  External links modified 

message: Is the "Spoilers!" in the conditional binomial proof section a joke? :)
Nicolas Perrault (talk) 15:38, 1 May 2017 (UTC)
thread_title:  Spoilers! 

message: Hello fellow Wikipedians,
I have just modified 2 external links on Binomial distribution. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20160303182353/http://www3.stat.sinica.edu.tw/statistica/oldpdf/A3n23.pdf to http://www3.stat.sinica.edu.tw/statistica/oldpdf/A3n23.pdf
*Added archive https://web.archive.org/web/20150113082307/http://psych.stanford.edu/~jlm/pdfs/Wison27SingleProportion.pdf to http://psych.stanford.edu/~jlm/pdfs/Wison27SingleProportion.pdf
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
Cheers.—InternetArchiveBot (Report bug) 17:08, 20 July 2017 (UTC)
thread_title:  External links modified 

message: I think at its current state, the lead section is very opaque for a layperson. It's so full of technical jargons that only a person already familiar with these statistical terms would care to understand what this concept means. I think the lead should be much more accessible. It should use very simple language or have very simple language definition for each opaque jargon-y term. It should also contain concrete examples, preferably historically relevant examples, associated with the concept, to provide a very basic, graspable understanding of the topic. Zaheen (talk) 08:05, 14 September 2017 (UTC)
thread_title:  Lead readability 

message: Isn't the mean not the sum, but the sum divided by n? Similar errors appear to be made with the mode, median, variance, etc. I think skewness, kurtosis, and entropy could also be affected, but I don't know. When we look at the definition of this distribution it is clearly between 0 and 1 for all allowed values of p, k, and n; and yet if the mean is truly given by p*n, then with p=0.5 and n=3 we get 1.5 which is outside all output values. StephenJohns00 (talk) 11:37, 31 August 2018 (UTC)
replies: text: The support of a binomial random variable is \{0,1,\ldots,n\}.  So it makes sense for the mean, median, and mode to fall somewhere within this range. The values listed in the article are correct.  –Deacon Vorbis (carbon • videos) 11:44, 31 August 2018 (UTC)
replies: text: But shouldn't the mean listed on the binomial distribution page refer to the mean of the distribution and not the mean of a binomial random variable, which has a different definition, causing this confusion?StephenJohns00 (talk) 12:25, 31 August 2018 (UTC)
replies: text: No, those are the same things.  –Deacon Vorbis (carbon • videos) 12:26, 31 August 2018 (UTC)
thread_title:  Mean, Mode, Median seem off by a factor of n 

message: Currently the random variate section has this paragraph, which is kind of weird:
:One way to generate random samples from a binomial distribution is to use an inversion algorithm. To do so, one must calculate the probability that P(X=k) for all values kfrom 0 through n. (These probabilities should sum to a value close to one, in order to encompass the entire sample space.) Then by using a pseudorandom number generator to generate samples uniformly between 0 and 1, one can transform the calculated samples U[0,1] into discrete numbers by using the probabilities calculated in step one.
For one, you can just do n bernoulli trials. You would need an absurdly large n for this be inefficient. Second, we have closed form expressions for the pmf that always add up to one, so if it does not, you miscalculated. Third, using the cumulative probability distribution would probably work better than the pmf.  — Preceding unsigned comment added by TheKing44 (talk • contribs) 05:49, 1 February 2019 (UTC)
replies: text: Correct about cumulative distribution. The "close to one" refers to the fact that in practice it will be necessary to approximate the probabilities. The problem with n bernoulli trials is that you have to do them for each output value, while computing the cumulative probabilities only has to be done once followed by (say) a binary search of cost O(log n) for each output value. McKay (talk) 07:18, 1 February 2019 (UTC)
replies: text: True, but there's also an initial cost of generating the table, which might be prohibitively high depending on the number of values needed.  This section seems a little iffy; I'll try to look into it a bit more if I get a chance.  –Deacon Vorbis (carbon • videos) 14:35, 1 February 2019 (UTC)

text: After looking a bit, I found a paper which talks about the alias method, which we conveniently have an article on already.  Maybe a brief mention could be made, but it's a fairly general method for any discrete distribution, so it probably wouldn't make much sense to go into great detail (and on second thought, I'm a bit skeptical that we should even be saying as much as we already are, given the generality of the process being described).  –Deacon Vorbis (carbon • videos) 14:46, 1 February 2019 (UTC)
thread_title:  The random variate section is weird 

message: Entropy is given as  entropy    = \frac{1}{2} \log_2 \left( 2\pi enp(1-p) \right) + O \left( \frac{1}{n} \right) Is it possible to give a reference for that formula given that it is not standard textbook knowledge. Also it is unclear, what the operator/function O of 1 over n stands for. Thanks. (Sorry for all breaches of etiquette.)  — Preceding unsigned comment added by 92.217.250.44 (talk) 14:56, 12 July 2019 (UTC)
thread_title:  Entropy 

message: The current tail bound given for p=1/2, n/2>=k>=3n/8 fails for n=64, k=26. I believe, based on the Chernoff inequality immediately above it, the 16 in the exponent should be replaced with a 4. Also, I can't find a way to derive this apparent formula from anything in the provided source.
69.119.31.14 (talk) 14:28, 12 August 2019 (UTC)
thread_title:  Issue with one of the tail bounds? 

message: Hi all, it seems to me that what is described here as the Fisher information is actually the expected Fisher information, i.e. expectation of the Fisher information (where the expectation is taken with respect to the data)
The actual Fisher information is: 
g_n(p) = \frac{x}{p^{2}}+\frac{n-x}{(1-p)^{2}} 
For a derivation of the Fisher information, see example 2.10 of this book,
 and for a derivation of how taking the expectation leads to \text{E}_X[g_n(p)] = \frac{n}{p(1-p)} see example 4.1 of the same book. 
Should we change that in the page?
Best
Ddreif (talk) 18:44, 14 November 2021 (UTC)
thread_title:  Fisher information is actually ''expected'' Fisher information 

message: In some places the article uses Binomial (not at start of sentence) and in others binomial. Universemaster1 (talk) 14:01, 28 May 2022 (UTC)
thread_title:  Consistent capitalization required on same page 

message: Something in Firefox? Found it: text color must be black. OveGjerlow (talk) 19:09, 20 September 2023 (UTC)
thread_title:  Why are equations suddenly not showing?