Random Variables (MATH112 Week 6 Lesson 11) PDF
Document Details
Uploaded by BestGreenTourmaline7401
Mapúa Malayan Colleges
REMELYN L. ASAHID-CHENG
Tags
Summary
This document is a lecture or presentation on random variables, covering discrete and continuous types. It explains probability distributions for various situations and provides examples.
Full Transcript
STATISTICAL ANALYSIS WITH SOFTWARE APPLICATION Random Variables MODULE 2-WEEK 6-LESSON 11 Excellence and Relevance REMELYN L. ASAHID-CHE...
STATISTICAL ANALYSIS WITH SOFTWARE APPLICATION Random Variables MODULE 2-WEEK 6-LESSON 11 Excellence and Relevance REMELYN L. ASAHID-CHENG Random variable is a variable whose value depends on the outcome of a random event. We can also describe it as a function that maps from the sample space to a measurable space (e.g. a real number). Let’s assume, we have a sample space containing 4 students {A, B, C, D}. If we now randomly pick student A and measure the height in centimeters, we can think of the random variable (H)as the function with the input of student and the output of height as a real number. Excellence and Relevance A random variable, typically denoted as X, is a variable whose possible values are outcomes of a random process. Excellence and Relevance We can visualize this small example like the following: Depending on the outcome — which student is randomly picked — our random variable (H) can take on different states or different values in terms of height in centimeters. Excellence and Relevance A random variable can be either discrete or continuous. Excellence and Relevance Types of Random Variables 1) Discrete Random Variables: Discrete random variables are random variables, whose range is a countable set. A countable set can be either a finite set or a countably infinite set. For instance, in the above example, X is a discrete variable as its range is a finite set ({0, 1, 2}). 2) Continuous Random Variables: Continuous random variables, on the contrary, have a range in the forms of some interval, bounded or unbounded, of the real line. E.g., Let Y be a random variable that is equal to the height of different people in a given population set. Since the people can have different measures of height (not limited to just natural numbers or any countable set), Y is a continuous variable (in fact, the distribution of Y follows a normal/gaussian distribution on most occasions). 3) Mixed Random Variables: Lastly, mixed random variables are ones that are a mixture of both continuous and discrete variables. These variables are more complicated than the other two. Hence, they are explained at the end of this article. Excellence and Relevance If our random variable can take only a finite or countably infinite number of distinct values, then it is discrete. Examples of a discrete random variable include the number of students in a class, test questions answered correctly, the number of children in a family, etc. Our random variable, however, is continuous if between any two values of our variable are an infinite number of other valid values. We can think of quantities such as pressure, height, mass, and distance as examples of continuous random variables. Excellence and Relevance Rule of Thumb: If you can count the number of outcomes, then you are working with a discrete random variable – e.g. counting the number of times a coin lands on heads. But if you can measure the outcome, you are working with a continuous random variable – e.g. measuring height, weight, time, etc. Excellence and Relevance Probability Distribution When we couple our random variable with a probability distribution we can answer the following question: How likely is it for our random variable to take a specific state? Which is basically the same as asking for the probability. Excellence and Relevance Probability Distribution The description of how likely a random variable takes one of its possible states can be given by a probability distribution. Thus, the probability distribution is a mathematical function that gives the probabilities of different outcomes for an experiment. More generally it can be described as the function which maps an input space A — related to the sample space — to a real number, namely the probability. Excellence and Relevance Probability Distribution for Discrete Random Variable A probability distribution for a discrete random variable tells us the probability that the random variable takes on certain values. For example, suppose we roll a fair die one time. If we let X denote the probability that the die lands on a certain number, then the probability distribution can be written as: P(X=1): 1/6 P(X=2): 1/6 P(X=3): 1/6 P(X=4): 1/6 P(X=5): 1/6 P(X=6): 1/6 Excellence and Relevance Probability Distribution for Discrete Random Variable Note: For a probability distribution to be valid, it must satisfy the following two criteria: 1. The probability for each outcome must be between 0 and 1. 2. The sum of all of the probabilities must add up to 1. Notice that the probability distribution for the die roll satisfies both of these criteria: 1. The probability for each outcome is between 0 and 1. 2. The sum of all of the probabilities add up to 1. Excellence and Relevance Probability Distribution for Discrete Random Variable We can use a histogram to visualize the probability distribution: Excellence and Relevance Probability Distribution for Discrete Random Variable A cumulative probability distribution for a discrete random variable tells us the probability that the variable takes on a value equal to or less than some value. For example, the cumulative probability distribution for a die roll would look like: P(X≤1): 1/6 The probability that the die lands on a P(X≤2): 2/6 one or less is simply 1/6, since it can’t land on a number less than one. P(X≤3): 3/6 The probability that it lands on a two or less is P(X=1) + P(X=2) = 1/6 + 1/6 = 2/6. P(X≤4): 4/6 Similarly, the probability that it lands on a three or less is P(X=1) + P(X=2) + P(X=3) = P(X≤5): 5/6 1/6 + 1/6 + 1/6 = 3/6, and so on. P(X≤6): 6/6 Excellence and Relevance Probability Distribution for Discrete Random Variable We can also use a histogram to visualize the cumulative probability distribution: Excellence and Relevance Probability Distribution for Continuous Random Variable A probability distribution for a continuous random variable tells us the probability that the random variable takes on certain values. However, unlike a probability distribution for discrete random variables, a probability distribution for a continuous random variable can only be used to tell us the probability that the variable takes on a range of values. Excellence and Relevance Probability Distribution for Continuous Random Variable For example, suppose we want to know the probability that a burger from a particular restaurant weighs a quarter-pound (0.25 lbs). Since weight is a continuous variable, it can take on an infinite number of values. For example, a given burger might actually weight 0.250001 pounds, or 0.24 pounds, or 0.2488 pounds. The probability that a given burger weights exactly.25 pounds is essentially zero. Thus, we could only use a probability distribution to tell us the probability that a burger weighs less than 0.25 lbs, more than 0.25 lbs, or between some range (e.g between.23 lbs and.27 lbs). Excellence and Relevance 10 Examples of Random Variables in Real Life 1. Number of Items Sold (Discrete) One example of a discrete random variable is the number of items sold at a store on a certain day. Using historical sales data, a store could create a probability distribution that shows how likely it is that they sell a certain number of items in a day. For example: The probability that they sell 0 items is.004, the probability that they sell 1 item is.023, etc. Excellence and Relevance 10 Examples of Random Variables in Real Life 2. Number of Customers (Discrete) Another example of a discrete random variable is the number of customers that enter a shop on a given day. Using historical data, a shop could create a probability distribution that shows how likely it is that a certain number of customers enter the store. For example: The probability that they sell 0 items is.004, the probability that they sell 1 item is.023, etc. Excellence and Relevance 10 Examples of Random Variables in Real Life 3. Number of Defective Products (Discrete) Another example of a discrete random variable is the number of defective products produced per batch by a certain manufacturing plant. Using historical data on defective products, a plant could create a probability distribution that shows how likely it is that a certain number of products will be defective in a given batch. Excellence and Relevance 10 Examples of Random Variables in Real Life 4. Number of Traffic Accidents (Discrete) Another example of a discrete random variable is the number of traffic accidents that occur in a specific city on a given day. Using historical data, a police department could create a probability distribution that shows how likely it is that a certain number of accidents occur on a given day.. Excellence and Relevance 10 Examples of Random Variables in Real Life 5. Number of Home Runs (Discrete) Another example of a discrete random variable is the number of home runs hit by a certain baseball team in a game. Using historical data, sports analysts could create a probability distribution that shows how likely it is that the team hits a certain number of home runs in a given game. Excellence and Relevance 10 Examples of Random Variables in Real Life 6. Marathon Time (Continuous) One example of a continuous random variable is the marathon time of a given runner. This is an example of a continuous random variable because it can take on an infinite number of values. For example, a runner might complete the marathon in 3 hours 20 minutes 12.0003433 seconds. Or they may complete the marathon in 4 hours 6 minutes 2.28889 seconds, etc. In this scenario, we could use historical marathon times to create a probability distribution that tells us the probability that a given runner finishes between a certain time interval. Excellence and Relevance 10 Examples of Random Variables in Real Life 7. Interest Rate (Continuous) Another example of a continuous random variable is the interest rate of loans in a certain country. This is a continuous random variable because it can take on an infinite number of values. For example, a loan could have an interest rate of 3.5%, 3.765555%, 4.00095%, etc. In this scenario, we could use historical interest rates to create a probability distribution that tells us the probability that a loan will have an interest rate within a certain interval. Excellence and Relevance 10 Examples of Random Variables in Real Life 8. Animal Weight (Continuous) Another example of a continuous random variable is the weight of a certain animal like a dog. This is a continuous random variable because it can take on an infinite number of values. For example, a dog might weigh 30.333 pounds, 50.340999 pounds, 60.5 pounds, etc. In this case, we could collect data on the weight of dogs and create a probability distribution that tells us the probability that a randomly selected dog weighs between two different amounts. Excellence and Relevance 10 Examples of Random Variables in Real Life 9. Plant Height (Continuous) Another example of a continuous random variable is the height of a certain species of plant. This is a continuous random variable because it can take on an infinite number of values. For example, a plant might have a height of 6.5555 inches, 8.95 inches, 12.32426 inches, etc. In this case, we could collect data on the height of this species of plant and create a probability distribution that tells us the probability that a randomly selected plant has a height between two different values. Excellence and Relevance 10 Examples of Random Variables in Real Life 10. Distance Traveled (Continuous) Another example of a continuous random variable is the distance traveled by a certain wolf during migration season. This is a continuous random variable because it can take on an infinite number of values. For example, a wolf may travel 40.335 miles, 80.5322 miles, 105.59 miles, etc. In this scenario, we could collect data on the distance traveled by wolves and create a probability distribution that tells us the probability that a randomly selected wolf will travel within a certain distance interval. Excellence and Relevance Computing Probabilities of Random Variables Excellence and Relevance Example 1: How many heads when we toss 3 coins? X = "The number of Heads" is the Random Variable. In this case, there could be 0 Heads (if all the coins land Tails up), 1 Head, 2 Heads or 3 Heads. So the Sample Space = {0, 1, 2, 3} But this time the outcomes are NOT all equally likely. The three coins can land in eight possible ways. Excellence and Relevance Example 2: Two dice are tossed. The Random Variable is X = "The sum of the scores on the two dice". Let's make a table of all possible values: There are 6 × 6 = 36 possible outcomes, and the Sample Space (which is the sum of the scores on the two dice) is {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} Let's count how often each value occurs, and work out the probabilities: 2 occurs just once, so P(X = 2) = 1/36 3 occurs twice, so P(X = 3) = 2/36 = 1/18 4 occurs three times, so P(X = 4) = 3/36 = 1/12 5 occurs four times, so P(X = 5) = 4/36 = 1/9 6 occurs five times, so P(X = 6) = 5/36 7 occurs six times, so P(X = 7) = 6/36 = 1/6 8 occurs five times, so P(X = 8) = 5/36 9 occurs four times, so P(X = 9) = 4/36 = 1/9 10 occurs three times, so P(X = 10) = 3/36 = 1/12 11 occurs twice, so P(X = 11) = 2/36 = 1/18 12 occurs just once, so P(X = 12) = 1/36 Excellence and Relevance A Range of Values We could also calculate the probability that a Random Variable takes on a range of values. Example (continued) What is the probability that the sum of the scores is 5, 6, 7 or 8? Excellence and Relevance Solving We can also solve a Random Variable equation. Example (continued) If P(X=x) = 1/12, what is the value of x? Notice the different uses of X and x: X is the Random Variable "The sum of the scores on the two dice". x is a value that X can take. Excellence and Relevance Excellence and Relevance Excellence and Relevance Excellence and Relevance Excellence and Relevance End of LESSON 11 Excellence and Relevance REMELYN L. ASAHID-CHENG