Let’s start with the Uniform distribution.
**Uniform Distribution:**
A Uniform distribution, also known as a rectangular distribution, is a type of continuous probability distribution where all outcomes in a given range are equally likely. Essentially, all values have the same probability, and no value is more likely to occur than any other. The probability density function (PDF) of a random variable X uniformly distributed on an interval [a, b] is represented as follows:
$$f(x) =
\begin{cases}
\frac{1}{b - a} & \mathrm{for}\ a \leq x \leq b \\
0 & \mathrm{otherwise} \\
\end{cases}$$
For the Uniform distribution, the mean and variance are given by:
$$\mu = \frac{a + b}{2}$$
$$\sigma^2 = \frac{(b-a)^2}{12}$$
**Binomial Distribution:**
The Binomial distribution is a discrete probability distribution that models the number of successes in a fixed number of Bernoulli trials (also known as binary or Boolean trials), where each trial has only two possible outcomes: "success" (with probability p) or "failure" (with probability 1 − p). The trials are assumed to be independent. The probability mass function (PMF) of a random variable X following a Binomial distribution with parameters n (number of trials) and p (probability of success) is calculated as:
$$P(X=k) = \binom{n}{k} p^k (1-p)^{n-k}$$
Where $\binom{n}{k}$ represents the binomial coefficient, also known as "n choose k":
$$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$
For the Binomial distribution, the mean and variance are given by:
μ = np
σ2 = np(1 − p)
For example, let’s consider a coin-flipping experiment. We flip a fair coin (i.e., heads and tails are equally likely) 10 times, and the random variable X represents the number of times it lands on heads. In this case, the distribution of X will follow a Binomial distribution with n = 10 and p = 0.5. Based on the binomial distribution formula, the probability of getting k heads out of 10 flips can be obtained. Suppose we want to find the probability of getting exactly 4 heads:
$$P(X=4) = \binom{10}{4} (0.5)^4 (1-0.5)^{10-4} = \frac{10!}{4!6!} (0.5)^4 (0.5)^6 = \frac{210}{1024} \approx 0.2051$$
In conclusion, the Uniform distribution is a continuous distribution that has equal probabilities for all values in a given range, while the Binomial distribution is discrete and models the number of successful outcomes in a fixed number of independent Bernoulli trials.