**Discrete Random Variables**
A discrete random variable is one that can take on a finite or countable number of distinct values. These values may be integers, or they may be categories. The distribution of a discrete random variable is described by a probability mass function (PMF), which assigns a probability to each possible outcome.
Examples of discrete random variables:
1. Tossing a fair six-sided die: The possible outcomes are the integers 1, 2, 3, 4, 5, 6, each with a probability of $\frac{1}{6}$.
The PMF for this example is:
$$p(x) =
\begin{cases}
\frac{1}{6}, & \text{for}\ x \in \{1, 2, 3, 4, 5, 6\} \\
0, & \text{otherwise}
\end{cases}$$
2. Number of successes in a binomial experiment: Suppose we have a sequence of n independent Bernoulli trials (e.g., coin flips) with probability p of success on each trial. The number of successes X is a discrete random variable with the following PMF (the binomial distribution):
$$p(x) = \binom{n}{x} p^x (1-p)^{n-x}, \text{for} \ x = 0, 1, 2, \cdots, n$$
**Continuous Random Variables**
A continuous random variable is one that can take on an infinite number of values in a continuous interval in the real line. It is characterized by a probability density function (PDF), which describes the relative likelihood of each outcome. The probability of any single value is zero, but we can find the probability of an interval by integrating the PDF over that interval.
Examples of continuous random variables:
1. Uniform distribution: Consider the random variable X that takes on values in the interval [a,โb], with equal probability for any value within the interval. The PDF for a uniformly distributed continuous random variable is:
$$f(x) =
\begin{cases}
\frac{1}{b - a}, & \text{for}\ x \in [a, b] \\
0, & \text{otherwise}
\end{cases}$$
2. Normal distribution: One of the most widely used continuous distributions is the normal (Gaussian) distribution, characterized by its mean (ฮผ) and variance (ฯ2). The PDF of a normally distributed random variable is:
$$f(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{-\frac{1}{2} \left( \frac{x-\mu}{\sigma} \right)^2 }, \quad x \in \mathbb{R}$$
Here is a plot of a standard normal distribution (with ฮผโ=โ0 and ฯโ=โ1):
In summary, discrete random variables can take on a finite or countable number of distinct values, and they are described by a probability mass function (PMF). Continuous random variables can take on an infinite number of values in a continuous interval and are characterized by a probability density function (PDF).