Questions tagged [binomial-distribution]

The binomial distribution gives the frequencies of "successes" in a fixed number of independent "trials". Use this tag for questions about data that might be binomially distributed or for questions about the theory of this distribution.

Overview

The binomial distribution gives the frequencies of "successes" in a fixed number of independent "trials". It is a discrete distribution parametrized by $p$, the probability of "success" in a trial. For $k$ "successes" in $n$ "trials" ($k \leq n$), the form of the probability mass function is:

$$P(k,n;p) = {n \choose k} p^k (1-p)^{n-k}$$

For a binomially distributed variable $X$, the expected value and variance are given by:

$$\mathrm{E}[X] = np $$ $$\mathrm{Var}[X] = np(1-p) $$

A common example to demonstrate the use of the demonstration is finding the probability of the number of heads or tails in a certain number of coin flips.

2126 questions
63
votes
6 answers

Test if two binomial distributions are statistically different from each other

I have three groups of data, each with a binomial distribution (i.e. each group has elements that are either success or failure). I do not have a predicted probability of success, but instead can only rely on the success rate of each as an…
61
votes
11 answers

Brain teaser: How to generate 7 integers with equal probability using a biased coin that has a pr(head) = p?

This is a question I found on Glassdoor: How does one generate 7 integers with equal probability using a coin that has a $\mathbb{Pr}(\text{Head}) = p\in(0,1)$? Basically, you have a coin that may or may not be fair, and this is the only…
Amazonian
  • 1,394
  • 1
  • 10
  • 19
61
votes
4 answers

Standard error for the mean of a sample of binomial random variables

Suppose I'm running an experiment that can have 2 outcomes, and I'm assuming that the underlying "true" distribution of the 2 outcomes is a binomial distribution with parameters $n$ and $p$: ${\rm Binomial}(n, p)$. I can compute the standard error,…
Frank
  • 1,305
  • 1
  • 12
  • 17
59
votes
4 answers

Confidence interval for Bernoulli sampling

I have a random sample of Bernoulli random variables $X_1 ... X_N$, where $X_i$ are i.i.d. r.v. and $P(X_i = 1) = p$, and $p$ is an unknown parameter. Obviously, one can find an estimate for $p$: $\hat{p}:=(X_1+\dots+X_N)/N$. My question is how can…
56
votes
4 answers

Logistic Regression - Error Term and its Distribution

On whether an error term exists in logistic regression (and its assumed distribution), I have read in various places that: no error term exists the error term has a binomial distribution (in accordance with the distribution of the response…
54
votes
8 answers

How to tell the probability of failure if there were no failures?

I was wondering if there is a way to tell the probability of something failing (a product) if we have 100,000 products in the field for 1 year and with no failures? What is the probability that one of the next 10,000 products sold fail?
melonfresh
  • 541
  • 1
  • 5
  • 3
51
votes
2 answers

What is quasi-binomial distribution (in the context of GLM)?

I'm hoping someone can provide an intuitive overview of what quasibinomial distribution is and what it does. I'm particularly interested in these points: How quasibinomial differs to the binomial distribution. When the response variable is a…
50
votes
5 answers

Probability distribution for different probabilities

If I wanted to get the probability of 9 successes in 16 trials with each trial having a probability of 0.6 I could use a binomial distribution. What could I use if each of the 16 trials has a different probability of success?
Greg
  • 683
  • 2
  • 6
  • 7
49
votes
2 answers

Interpretation of R's output for binomial regression

I'm quite new on this with binomial data tests, but needed to do one and now I´m not sure how to interpret the outcome. The y-variable, the response variable, is binomial and the explanatory factors are continuous. This is what I got when…
46
votes
2 answers

Confidence interval around binomial estimate of 0 or 1

What is the best technique to calculate a confidence interval of a binomial experiment, if your estimate is that $p=0$ (or similarly $p=1$) and sample size is relatively small, for example $n=25$?
Kasper
  • 3,059
  • 2
  • 22
  • 37
41
votes
9 answers

How can I efficiently model the sum of Bernoulli random variables?

I am modeling a random variable ($Y$) which is the sum of some ~15-40k independent Bernoulli random variables ($X_i$), each with a different success probability ($p_i$). Formally, $Y=\sum X_i$ where $\Pr(X_i=1)=p_i$ and $\Pr(X_i=0)=1-p_i$. I am…
41
votes
7 answers

Relationship between Binomial and Beta distributions

I'm more of a programmer than a statistician, so I hope this question isn't too naive. It happens in sampling program executions at random times. If I take N=10 random-time samples of the program's state, I could see function Foo being executed on,…
39
votes
4 answers

ANOVA on binomial data

I am analyzing an experimental data set. The data consists of a paired vector of treatment type and a binomial outcome: Treatment Outcome A 1 B 0 C 0 D 1 A 0 ... In the outcome column, 1…
39
votes
3 answers

Logistic Regression: Bernoulli vs. Binomial Response Variables

I want to perform logistic regression with the following binomial response and with $X_1$ and $X_2$ as my predictors. I can present the same data as Bernoulli responses in the following format. The logistic regression outputs for these 2 data sets…
35
votes
11 answers

Why is generating 8 random bits uniform on (0, 255)?

I am generating 8 random bits (either a 0 or a 1) and concatenating them together to form an 8-bit number. A simple Python simulation yields a uniform distribution on the discrete set [0, 255]. I am trying to justify why this makes sense in my…
1
2 3
99 100