Presentation is loading. Please wait.

Presentation is loading. Please wait.

Random Variables A random variable A variable (usually x ) that has a single numerical value (determined by chance) for each outcome of an experiment A.

Similar presentations


Presentation on theme: "Random Variables A random variable A variable (usually x ) that has a single numerical value (determined by chance) for each outcome of an experiment A."— Presentation transcript:

1 Random Variables A random variable A variable (usually x ) that has a single numerical value (determined by chance) for each outcome of an experiment A random variable can be classified as being either discrete or continuous depending on the numerical values it assumes. A discrete random variable may assume either a finite number of values or an infinite sequence of values. A continuous random variable may assume any numerical value in an interval or collection of intervals with no gaps or interruptions.

2 A random variable x takes on a defined set of values with different probabilities. For example, if you roll a die, the outcome is random (not fixed) and there are 6 possible outcomes, each of which occur with probability one-sixth. For example, if you poll people about their voting preferences, the percentage of the sample that responds “ Yes on Proposition 100 ” is a also a random variable (the percentage will be slightly differently every time you poll).

3 Two types of random variables A discrete random variable has a countable number of possible values. –X: number of hits when trying 5 free throws. A continuous random variable takes all values in an interval of numbers. –X: the time it takes for a bulb to burn out. –The values are not countable.

4 Discrete random variables have a countable number of outcomes Examples: Binary: Dead/alive, treatment/placebo, disease/no disease, heads/tails Nominal: Blood type (O, A, B, AB), marital status(separated/widowed/divorced/married/single/common -law) Ordinal: (ordered) staging in breast cancer as I, II, III, or IV, Birth order — 1 st, 2 nd, 3 rd, etc., Letter grades (A, B, C, D, F) Counts: the integers from 1 to 6, the number of heads in 20 coin tosses

5 A continuous random variable has an infinite continuum of possible values. Examples: blood pressure, weight, the speed of a car, the real numbers from 1 to 6. Time-to-Event: In clinical studies, this is usually how long a person “ survives ” before they die from a particular disease or before a person without a particular disease develops disease.

6 Random Variables QuestionRandom Variable x Type Family x = Number of dependents in Discrete size family reported on tax return Distance from x = Distance in miles fromContinuous home to store home to the store site Own dog x = 1 if own no pet; Discrete or cat = 2 if own dog(s) only; = 3 if own cat(s) only; = 4 if own dog(s) and cat(s)

7 Probability Distributions The probability distribution for a random variable describes how probabilities are distributed over the values of the random variable. It gives the probability for each value of the random variable The probability distribution is defined by a probability function which provides the probability for each value of the random variable.

8 Continuous Probability Distributions A continuous random variable can assume any value in an interval on the real line or in a collection of intervals. It is not possible to talk about the probability of the random variable assuming a particular value. Ex: x=2 Instead, we talk about the probability of the random variable assuming a value within a given interval. Continuous random variables are usually measurements.

9 The probability of the random variable assuming a value within some given interval from x 1 to x 2 is defined to be the area under the graph of the probability density function between x 1 and x 2. Continuous Probability Distributions

10 Discrete Random Variable Suppose X is a discrete random variable The probability distribution of X lists the values and their probabilities. The probabilities must sum up to one. The probability of any event can be found by adding the probabilities for those values that make up the event.

11 x p(x) 1/6 145623 Discrete example: roll of a die

12 x P(x) 1/6 145623 1/3 1/2 2/3 5/6 1.0 Cumulative distribution function (CDF)

13 1. What’s the probability that you roll a 3 or less? P(x≤3)=1/2 2. What’s the probability that you roll a 5 or higher? P(x≥5) = 1 – P(x≤4) = 1-2/3 = 1/3 Examples

14 The number of ships to arrive at a harbor on any given day is a random variable represented by x. The probability distribution for x is: x = 10 thru 14 and the probabilities are.4,.2,.2,.1,.1 respectfully. Find the probability that on a given day: a. exactly 14 ships arrive b. At least 12 ships arrive c. At most 11 ships arrive p(x≤11)= (.4 +.2) =.6 p(x  12)= (.2 +.1 +.1) =.4 p(x=14)=.1

15 You are lecturing to a group of 1000 students. You ask them to each randomly pick an integer between 1 and 10. Assuming, their picks are truly random: What’s your best guess for how many students picked the number 9? Since p(x=9) = 1/10, we’d expect about 1/10 th of the 1000 students to pick 9. 100 students. What percentage of the students would you expect picked a number less than or equal to 6? Since p(x≤ 6) = 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 =.6 60%

16 The uniform distribution: all values are equally likely The uniform distribution: f(x)= 1, for 1  x  0 x p(x) 1 1 We can see it’s a probability distribution because it integrates to 1 (the area under the curve is 1):

17 Discrete case: Continuous case:

18 The Lottery (also known as a tax on people who are bad at math … ) A certain lottery works by picking 6 numbers from 1 to 49. It costs $1.00 to play the lottery, and if you win, you win $2 million after taxes. If you play the lottery once, what are your expected winnings or losses? the lottery

19 Calculate the probability of winning in 1 try: “49 choose 6” Out of 49 numbers, this is the number of distinct combinations of 6. x$p(x).999999928 + 2 million7.2 x 10 --8 The probability function (note, sums to 1.0):

20 Expected Value x$p(x).999999928 + 2 million7.2 x 10 --8 E(X) = P(win)*$2,000,000 + P(lose)*-$1.00 = 2.0 x 10 6 * 7.2 x 10 -8 +.999999928 (-1) =.144 -.999999928 = -$.86 E(X) = P(win)*$2,000,000 + P(lose)*-$1.00 = 2.0 x 10 6 * 7.2 x 10 -8 +.999999928 (-1) =.144 -.999999928 = -$.86

21 If you play the lottery every week for 10 years, what are your expected winnings or losses? 520 x (-.86) = -$447.20 OUCH

22 A roulette wheel has the numbers 1 through 36, as well as 0 and 00. If you bet $1 that an odd number comes up, you win or lose $1 according to whether or not that event occurs. If random variable X denotes your net gain, X=1 with probability 18/38 and X= -1 with probability 20/38. E(X) = 1(18/38) – 1 (20/38) = -$.053 On average, the casino wins (and the player loses) 5 cents per game. The casino rakes in even more if the stakes are higher: E(X) = 10(18/38) – 10 (20/38) = -$.53 If the cost is $10 per game, the casino wins an average of 53 cents per game. If 10,000 games are played in a night, that’s a cool $5300. Gambling (or how casinos can afford to give so many free drinks…)

23 x Probability Distribution for Number of US Air Crashes 0.210 0.367 0.275 0.115 0.029 0.004 0 0123456701234567 P(x)P(x)

24 Probability Histogram Number of USAir Crashes ProbabilityProbability 0.40 0.30 0.20 0.10 0 0 1 2 3 4 5 6 7

25 Flip a coin 4 times Find the probability distribution of the random variable describing the number of heads that turn up when a coin is flipped four times. Solution Probability Histogram

26

27 Continuous Random Variable: spinner

28 Continuous Distribution The probability of any event is the area under the density curve and above the values of X that make up the event.

29 Continuous Distribution The probability model for a continuous random variable assigns probabilities to intervals of outcomes rather than to individual outcomes. In fact, all continuous probability distributions assign probability 0 to every individual outcome. –The spinner Normal distributions are continuous probability distributions.

30 The variance of X is For a discrete r.v. X with values x i, that occur with probabilities p(x i ), the mean of X is Means & Variances of Discrete Random Variables

31 Flip a coin 4 times How many heads will turn up on average when a coin is flipped four times? 1/164/166/164/161/16

32 The total number of cars to be sold next week is described by the following probability distribution Example: Car Sales Determine the expected value and standard deviation of X, the number of cars sold. x 0 1 2 3 4 p(x).05.15.35.25.20

33 Rules for Mean

34 Rules for Variances If X is a r.v. and a and b are constants, then If X and Y are independent random variables and a and b are constants, then In particular,

35 Parameter: a numerical characteristic of a population. It’s fixed but unknown in practice. –Population mean Statistic: a numerical characteristic of a sample. It’s known once a sample is obtained. We often use a statistic to estimate an unknown parameter. –It can change from sample to sample. –Sample mean Statistical inference: use a fact about a sample to estimate the truth about the whole population. Parameters and Statistics

36 Draw independent observations at random from any population with finite mean. As the number of observations drawn increases, the sample mean of the observed values eventually approaches the mean of the population as closely as you want and then stays that close. House edge? Is there a winning system for gambling? Law of Large Numbers

37 The average value of outcomes E =  [ x P( x )] The Expected value is the same as the mean. E = µ Expected Value

38 Mean, Variance and Standard Deviation of a Probability Distribution µ =  x P (x)  2 =  [ (x – µ) 2 P(x )]  2 = [  x 2 P (x )] – µ 2  = [  x 2 P (x )] – µ 2

39 Mean and Variance

40

41 ANSWER


Download ppt "Random Variables A random variable A variable (usually x ) that has a single numerical value (determined by chance) for each outcome of an experiment A."

Similar presentations


Ads by Google