# Tag Info

Accepted

### How can I determine which of two sequences of coin flips is real and which is fake?

This is a variant on a standard intro stats demonstration: for homework after the first class I have assigned my students the exercise of flipping a coin 100 times and recording the results, broadly ...
Accepted

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

TL;DR: The sharp contrast between the bits and coins is that in the case of the coins, you're ignoring the order of the outcomes. HHHHTTTT is treated as the same as TTTTHHHH (both have 4 heads and 4 ...

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

Flip the coin twice. If it lands HH or TT, ignore it and flip it twice again. Now, the coin has equal probability of coming up ...
Accepted

### Test if two binomial distributions are statistically different from each other

The solution is a simple google away: http://en.wikipedia.org/wiki/Statistical_hypothesis_testing So you would like to test the following null hypothesis against the given alternative $H_0:p_1=p_2$ ...

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

Assume that $p \in (0,1)$. Step 1:. Toss the coin 5 times. If the outcome is $(H, H, H, T, T)$, return $1$ and stop. $(H, H, T, T, H)$, return $2$ and stop. $(H, T, T, H, H)$, return $3$ and ...

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

The probability that a product will fail is surely a function of time and use. We don't have any data on use, and with only one year there are no failures (congratulations!). Thus, this aspect (...
Accepted

### Generating correlated binomial random variables

Binomial variables are usually created by summing independent Bernoulli variables. Let's see whether we can start with a pair of correlated Bernoulli variables $(X,Y)$ and do the same thing. Suppose ...
Accepted

### Logistic Regression - Error Term and its Distribution

In linear regression observations are assumed to follow a Gaussian distribution with a mean parameter conditional on the predictor values. If you subtract the mean from the observations you get the ...
Accepted

### Negative binomial distribution vs binomial distribution

The difference is what we are interested in. Both distributions are built from independent Bernoulli trials with fixed probability of success, p. With the Binomial distribution, the random variable X ...

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

The difference between the binomial distribution and quasi-binomial can be seen in their probability density functions (pdf), which characterize these distributions. Binomial pdf: P(X=k)={n \...
Accepted

### Exact two sample proportions binomial test in R (and some strange p-values)

If you are looking for an 'exact' test for two binomial proportions, I believe you are looking for Fisher's Exact Test. In R it is applied like so: ...
Accepted

### Why does the continuity correction (say, the normal approximation to the binomial distribution) work?

In fact it doesn't always "work" (in the sense of always improving the approximation of the binomial cdf by the normal at any $x$). If the binomial $p$ is 0.5 I think it always helps, except ...

### How can I determine which of two sequences of coin flips is real and which is fake?

There are two very good answers as of writing this, and so let me add a needlessly complex yet interesting approach to this problem. I think one way to operationalize the human generated vs truly ...
Accepted

### Prediction interval for binomial random variable

Ok, let's try this. I'll give two answers - the Bayesian one, which is in my opinion simple and natural, and one of the possible frequentist ones. Bayesian solution We assume a Beta prior on $p$, i,...

### How can I determine which of two sequences of coin flips is real and which is fake?

This is a class activity I've first read about in the book Teaching Statistics. A Bag of Tricks, 2nd ed. by Andrew Gelman and Deborah Nolan (they recommend 100 flips, though). Their reasoning to ...

### Logistic Regression - Error Term and its Distribution

This has been covered before. A model that is constrained to have predicted values in $[0,1]$ cannot possibly have an additive error term that would make the predictions go outside $[0,1]$. Think of ...
Accepted

### I don't understand the variance of the binomial

A random variable $X$ taking values $0$ and $1$ with probabilities $P(X=1)=p$ and $P(X=0)=1-p$ is called a Bernoulli random variable with parameter $p$. This random variable has \begin{eqnarray*} E(X)&...

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

Generalizing the case described by Dilip Sarwate Some of the methods described in the other answers use a scheme in which you throw a sequence of $n$ coins in a 'turn' and depending on the result you ...
Accepted

### Mother milk of 6 Corona-positive (COVID-19) women does not contain the virus - can we make a confidence statement about this?

There is the rule of three saying if a certain event did not occur in a sample with $n$ subjects, the interval from $0$ to $3/n$ is a 95% confidence interval for the rate of occurrences in the ...

### Logistic Regression - Error Term and its Distribution

To me the unification of logistic, linear, poisson regression etc... has always been in terms of specification of the mean and variance in the Generalized Linear Model framework. We start by ...