
- Discrete Mathematics - Home
- Discrete Mathematics Introduction
- Mathematical Statements and Operations
- Atomic and Molecular Statements
- Implications
- Predicates and Quantifiers
- Sets
- Sets and Notations
- Relations
- Operations on Sets
- Venn Diagrams on Sets
- Functions
- Surjection and Bijection Functions
- Image and Inverse-Image
- Mathematical Logic
- Propositional Logic
- Logical Equivalence
- Deductions
- Predicate Logic
- Proof by Contrapositive
- Proof by Contradiction
- Proof by Cases
- Rules of Inference
- Group Theory
- Operators & Postulates
- Group Theory
- Algebric Structure for Groups
- Abelian Group
- Semi Group
- Monoid
- Rings and Subring
- Properties of Rings
- Integral Domain
- Fields
- Counting & Probability
- Counting Theory
- Combinatorics
- Additive and Multiplicative Principles
- Counting with Sets
- Inclusion and Exclusion
- Bit Strings
- Lattice Path
- Binomial Coefficients
- Pascal's Triangle
- Permutations and Combinations
- Pigeonhole Principle
- Probability Theory
- Probability
- Sample Space, Outcomes, Events
- Conditional Probability and Independence
- Random Variables in Probability Theory
- Distribution Functions in Probability Theory
- Variance and Standard Deviation
- Mathematical & Recurrence
- Mathematical Induction
- Formalizing Proofs for Mathematical Induction
- Strong and Weak Induction
- Recurrence Relation
- Linear Recurrence Relations
- Non-Homogeneous Recurrence Relations
- Solving Recurrence Relations
- Master's Theorem
- Generating Functions
- Graph Theory
- Graph & Graph Models
- More on Graphs
- Planar Graphs
- Non-Planar Graphs
- Polyhedra
- Introduction to Trees
- Properties of Trees
- Rooted and Unrooted Trees
- Spanning Trees
- Graph Coloring
- Coloring Theory in General
- Coloring Edges
- Euler Paths and Circuits
- Hamiltonion Path
- Boolean Algebra
- Boolean Expressions & Functions
- Simplification of Boolean Functions
- Advanced Topics
- Number Theory
- Divisibility
- Remainder Classes
- Properties of Congruence
- Solving Linear Diophantine Equation
- Useful Resources
- Quick Guide
- Useful Resources
- Discussion
Random Variables in Probability Theory
We use Random Variables to simplify the process of working with outcomes from a random experiment. In Probability Theory, random variables is used to take all the outcomes of an experiment and put them into one package. Read this chapter to learn the basics of random variables in probability theory.
What is a Random Variable?
A random variable is a way of turning the outcomes of a random experiment into numbers. It is really just a function or a map that takes each outcome from a sample space and assigns it a number. We normally use capital letters like X to represent a random variable.
A Random Experiment: Rolling of Dice
Let us take a basic random experiment: rolling two dice. The outcomes of this experiment include all possible pairs of numbers that can show up on the dice. So, the sample space (which we usually we can call Ω) includes combinations like (1, 1), (2, 3), and (6, 5). These pairs represent every possible result from rolling the two dice.
Now, consider we only care about the sum of the two numbers on the dice. Here a random variable will be useful. Instead of caring about individual dice rolls, we define a random variable X such that, that takes each pair of dice rolls and returns their sum. For example −
- X(1, 1) = 2
- X(2, 3) = 5
- X(6, 5) = 11
In this way, we can summarize all the possible outcomes of the dice roll with the sums. It extracts the specific piece of information we care about from the experiment.
Formal Definition of a Random Variable
Let us define the random variables formally. A random variable is a measurable function from a sample space Ω to the real number line R. It implies the following points −
- Sample Space − This is the set of all possible outcomes of a random experiment. For the dice example, it is the set of all pairs of dice rolls, like (1, 1), (2, 3), …,(6, 6).
- Real Numbers − This is just the set of numbers we use every day. They could be positive, negative, fractions, decimals, and so on. In most cases, our random variables will map outcomes to real numbers, like the sum of the dice.
- Measurable Function − This means that the random variable behaves nicely with the probabilities we assign to the outcomes. If we think of the sample space as all the possible outcomes, then the random variable maps those outcomes into a smaller number (like the sum in our dice example).
Example: Rolling Two Dice
Let us understand this with an example with two dice. Imagine we are working a game where only the sum of the dice matters. Not the individual numbers.
In this case, the random variable X would map each outcome to its corresponding sum:
- X(1, 1) = 2
- X(1, 2) = 3
- X(6, 6) = 12
So, the random variable simplifies the experiment by turning the pair of dice rolls into a single number. That is the sum of the dice.
Types of Random Variables
There are two main types of random variables: the discrete and continuous. Depending on what type of experiment we are conducting, the random variable can either take on a set of distinct values (discrete) or any value within a range (continuous).
Discrete Random Variables
A discrete random variable is one that can take on only specific values. Like the integer or whole numbers. For example, in our dice rolling example, the random variable can only take on the values 2 through 12. These are the possible sums of the two dice.
Discrete random variables are used in situations where we can count the outcomes. The number of heads in a series of coin flips or the number of customers arriving at a store in an hour.
Continuous Random Variables
A continuous random variable can take on any value within a certain range. For example, if we are measuring the time it takes for a car to complete a race. It could take any value like 1.23 seconds, 3.5 seconds, 4.98 seconds, and so on. Continuous random variables are used in situations where the outcome can vary smoothly over a range of values.
Random Variables and Probability
Random variables are used to get probability in a very direct way. Once we define a random variable, we can use it to calculate probabilities of different events. For example, we might want to find probability that the sum of two dice is greater than 8. Or the probability that a randomly chosen person is taller than 6 feet.
Example: Sum of Two Dice
Let us see the dice example. Now that we have our random variable X to be the sum of the two dice, we can calculate probabilities related to that sum.
Consider we find the probability that the sum of the two dice is greater than 8. The possible outcomes where the sum is 9, 10, 11, or 12. Those outcomes are −
- (3, 6), (4, 5), (5, 4), (6, 3) (for 9)
- (4, 6), (5, 5), (6, 4) (for 10)
- (5, 6), (6, 5) (for 11)
- (6, 6) (for 12)
There are 10 outcomes where the sum is greater than 8. There are 36 possible outcomes when rolling two dice, the probability is −
$$\mathrm{P(X > 8) \:=\: \frac{10}{36} \:=\: \frac{5}{18}}$$
So, the chance that the sum of the dice is greater than 8 is about 27.8%.
Properties of Random Variables
Random variables have several properties as shown below −
- Expected Value − This is the average value we expect the random variable to take on over many trials of the experiment. For a discrete random variable, the expected value is calculated by multiplying each outcome by its probability and summing them up. It is like calculating a weighted average of all the possible outcomes.
- Variance − Variance shows us how much the values of the random variable may vary from the expected value. A low variance means that the outcomes are close to the expected value, while a high variance means that the outcomes are more spread out.
- Probability Distribution − This is a function that gives the probability of each possible value of the random variable. For example, the probability distribution of the sum of two dice tells us how likely each sum (2 through 12) is to occur.
Conclusion
In this chapter, we explained how random variables help us manage and understand the outcomes of random experiments. We explored the different types of random variables, the discrete and continuous and understood their properties.