260 likes | 403 Views
Random Variables. Budhi Setiawan Teknik Sipil - UNSRI. Learn how to characterize the pattern of the distribution of values that a random variable may have, and how to use the pattern to find probabilities. What is a Random Variable?.
E N D
Random Variables Budhi Setiawan Teknik Sipil - UNSRI Learn how to characterize the pattern of the distribution of values that a random variable may have, and how to use the pattern to find probabilities
What is a Random Variable? Random Variable: an outcome or event may be identified through the value(s) of a function, which usually denoted with a capital letter If the value of X represent flood above mean level, then X > 7 meter stand for the occurrence of floods above 7 meter Two different broad classes of random variables: • A continuous random variable can take any value in an interval or collection of intervals. • A discrete random variable can take one of a countable list of distinct values.
Example: Random Variables at an Outdoor Graduation or Wedding Random factors that will determine how enjoyable the event is: Temperature: continuous random variable (any value, integer or decimal) Number of airplanes that fly overhead: discrete random variable (integer only)
Example: Random Variables:Probability an Event Occurs 3 Times in 3 Tries • What is the probability that three tosses of a fair coin will result in three heads? • Assuming boys and girls are equally likely, what is the probability that 3 births will result in 3 girls? • Assuming probability is 1/2 that a randomly selected individual will be taller than median height of a population, what is the probability that 3 randomly selected individuals will all be taller than the median? Answer to all three questions = 1/8. Discrete Random Variable X = number of times the “outcome of interest” occurs in three independent tries.
Discrete Random Variables X the random variable. k = a number the discrete r.v. could assume. P(X =k) is the probability that X equals k. Discrete random variable:can only result in a countable set of possibilities – often a finite number of outcomes, but can be infinite. Example: It’s Possible to Toss Forever Repeatedly tossing a fair coin, and define:X = number of tosses until the first head occursAny number of flips is a possible outcome. P(X = k) = (1/2)k
Probability Distribution of a Discrete R.V. Using the sample space to find probabilities: Step 1: List all simple events in sample space. Step 2: Find probability for each simple event. Step 3: List possible values for random variable X and identify the value for each simple event. Step 4: Find all simple events for which X =k, for each possible value k. Step 5: P(X =k) is the sum of the probabilities for all simple events for which X =k. Probability distribution function (pdf) X is a table or rule that assigns probabilities to possible values of X.
Example:How Many Girls are Likely? Family has 3 children. Probability of a girl is ?What are the probabilities of having 0, 1, 2, or 3 girls? Sample Space:For each birth, write either B or G. There are eight possible arrangements of B and G for three births. These are the simple events. Sample Space and Probabilities:The eight simple events are equally likely. Random Variable X: number of girls in three births. For each simple event, the value of X is the number of G’s listed.
Example: How Many Girls? (cont) Value of X for each simple event: Probability distribution function for Number of Girls X: Graph of the pdf of X:
Conditions for Probabilities for Discrete Random Variables Condition 1 The sum of the probabilities over all possible values of a discrete random variable must equal 1. Condition 2 The probability of any specific outcome for a discrete random variable must be between 0 and 1.
Cumulative Distribution Function of a Discrete Random Variable Cumulative distribution function (cdf) for a random variable X is a rule or table that provides the probabilities P(X ≤ k) for any real number k. Cumulative probability = probability that X is less than or equal to a particular value. Example: Cumulative Distribution Function for the Number of Girls (cont)
Finding Probabilities for Complex Events Example: A Mixture of Children What is the probability that a family with 3 children will have at least one child of each sex? If X = Number of Girls then either family has one girl and two boys (X = 1) or two girls and one boy (X = 2). P(X = 1 or X = 2) = P(X = 1) + P(X = 2) = 3/8 + 3/8 = 6/8 = 3/4 pdf for Number of Girls X:
Expectations for Random Variables The expected value of a random variable is the mean value of the variable X in the sample space, or population, of possible outcomes. If X is a random variable with possible values x1, x2, x3, . . . , occurring with probabilities p1, p2, p3, . . . , then the expected value of X is calculated as
Standard Deviation for a Discrete Random Variable The standard deviation of a random variable is essentially the average distance the random variable falls from its mean over the long run. If X is a random variable with possible values x1, x2, x3, . . . , occurring with probabilities p1, p2, p3, . . . , and expected value E(X) = m, then
Binomial Random Variables Class of discrete random variables = Binomial -- results from a binomial experiment. Conditions for a binomial experiment: 1. There are n “trials” where n is determined in advance and is not a random value. 2. Two possible outcomes on each trial, called “success” and “failure” and denoted S and F. 3. Outcomes are independent from one trial to the next. 4. Probability of a “success”, denoted by p, remains same from one trial to the next. Probability of “failure” is 1 – p.
Examples of Binomial Random Variables A binomial random variable is defined as X=number of successes in the n trials of a binomial experiment.
Finding Binomial Probabilities for k = 0, 1, 2, …, n Example: Probability of Two Wins in Three Plays p = probability win = 0.2; plays of game are independent. X = number of wins in three plays. What is P(X = 2)?
Binomial Probability Distribution Binomial distribution is based on events in which there are only two possible outcomes on each occurrence. Example: Flip a coin 3 times the possible outcomes are (heads = hits; tails = misses): HHH, HHT, HTT, TTT, TTH, THH, THT, AND HTH
Binomial Probability Distribution Example: Flip a coin 3 times the possible outcomes are (call heads = hits; tails = misses):
.500 .375 .250 .125 Binomial Probability Distribution
Binomial Probability Distribution The preceding bar graph is symmetrical; this will always be true for the binomial distribution when p= 0.5.
Expected Value and Standard Deviation for a Binomial Random Variable For a binomial random variable X based on n trials and success probability p,
Example: Extraterrestrial Life? 50% of large population would say “yes” if asked, “Do you believe there is extraterrestrial life?” Sample of n = 100 is taken. X = number in the sample who say “yes” is approximately a binomial random variable. In repeated samples of n=100, on average 50 people would say “yes”. The amount by which that number would differ from sample to sample is about 5.