In statistics, the binomial test is an exact test of the statistical significance of deviations from a theoretically expected distribution of observations into two categories using sample data. Usage The binomial test is useful to test hypotheses about the probability () of success: where is a user-defined value between 0 and 1. If in a sample of size there are successes, while we expect , the formula of the binomial distribution gives the probability of finding this value: If the null hypothesis were correct, then the expected number of successes would be . We find our -value for this test by considering the probability of seeing an outcome as, or more, extreme. For a one-tailed test, this is straightforward to compute. Suppose that we want to test if . Then our -value would be, An analogous computation can be done if we're testing if using the summation of the range from to instead. Calculating a -value for a two-tailed test is slightly more complicated, since a binomial distribution isn't symmetric if . This means that we can't just double the -value from the one-tailed test. Recall that we want to consider events that are as, or more, extreme than the one we've seen, so we should consider the probability that we would see an event that is as, or less, likely than . Let denote all such events. Then the two-tailed -value is calculated as, Common use One common use of the binomial test is in the case where the null hypothesis is that two categories are equally likely to occur (such as a coin toss), implying a null hypothesis . Tables are widely available to give the significance observed numbers of observations in the categories for this case. However, as the example below shows, the binomial test is not restricted to this case. When there are more than two categories, and an exact test is required, the multinomial test, based on the multinomial distribution, must be used instead of the binomial test. Large samples For large samples such as the example below, the binomial distribution is well approximated by convenient continuous distributions, and these are used as the basis for alternative tests that are much quicker to compute, such as Pearson's chi-squared test and the G-test. However, for small samples these approximations break down, and there is no alternative to the binomial test. The most usual (and easiest) approximation