# Binominal Distribution

The binomial distribution is a probability distribution that describes the number of successes in a fixed number of independent Bernoulli trials with the same probability of success. It is used when there are exactly two mutually exclusive outcomes of a trial often labelled as "success" and "failure". The distribution is defined by two parameters: the probability of success in a single trial and the number of trials.

## Binominal Distribution in practice

Let's consider a binomial experiment where n is the number of trials, p is the probability of success on a single trial, and X is the number of successes. The probability of getting exactly k successes (where k can go from 0 to n) in n trials is given by the function:

P(X=k) = C(n, k) * (p^k) * ((1-p)^(n-k))

where P(X=k) is the probability of k successes in n trials, C(n, k) is the binomial coefficient, p is the probability of success on a single trial, and (1-p) is the probability of failure on a single trial.

The mean and variance of a binomial distribution are np and np(1-p) respectively.

The binomial distribution can be used to answer questions like "If a fair coin is tossed 10 times, what is the probability of getting exactly 6 heads?" or "If 20% of phones produced by a factory are defective, what is the probability that a sample of 10 phones will include exactly 2 defective phones?"

Download this guide to delve into the most common LLM security risks and ways to mitigate them.

untouchable mode.

Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.

Several people are typing about AI/ML security. â€¨Come join us and 1000+ others in a chat thatâ€™s thoroughly SFW.