Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture Note 5 Discrete Random Variables and Probability Distributions ©

Similar presentations


Presentation on theme: "Lecture Note 5 Discrete Random Variables and Probability Distributions ©"— Presentation transcript:

1 Lecture Note 5 Discrete Random Variables and Probability Distributions ©

2 Random Variables random variable A random variable is a variable that takes on numerical values determined by the outcome of a random experiment.

3 Discrete Random Variables discrete A random variable is discrete if it can take on no more than a countable number of values.

4 Discrete Random Variables (Examples) 1.The outcome of a roll of a die. 2.The number of defective items in a sample of twenty items taken from a large shipment.

5 Continuous Random Variables continuous A random variable is continuous if it can take any value in an interval.

6 Continuous Random Variables (Examples) 1.Heights of students in a class 2.Average temperature in November 3.The income in a year for a family. 4.The amount of oil imported into the U.S. in a particular month.

7 Discrete Random Variables 4We will study the fundamental concepts of discrete random variables, namely (1) Probability Distribution Function and (2) Cumulative Probability Function. 4First, we will learn the notation of the Probability Distribution Function

8 Understanding the notation for the probability distribution function 4Suppose you are about to roll a die. Then, the number you would get after the roll is a discrete random variable. Let X denote this random variable. 4Then this random variable X can take 6 possible outcomes from S={1, 2, 3, 4, 5, 6}.

9 Understanding the notation for the probability distribution function, contd 4Then, the probability that the random variable X takes the value 1 (i.e., the probability that you get 1 after rolling the die) is 1/6. This can be conveniently expressed using the following notation: P(1)=P(X = 1)=1/6 Similarly, we have P(2)=P(X=2)=1/6 P(3)=P(X=3)=1/6. P(6)=P(X=6)=1/6

10 Understanding the notation for the probability distribution function, contd 4We can generalize the notation from the previous slides to other discrete random variables. Let X be any discrete random variable which takes k possible values from S={x 1, x 2, …, x k } Conventionally, we use capital letter X to denotes the random variable, and small letter x to denote the possible values that X can take.

11 Understanding the notation for the probability distribution function, contd 4Now, let x be any values from S={x 1, x 2, …, x k } 4Then, the probability that the random variable X takes the value x can be written as: P(x)=P(X=x) This notation is what it is called “Probability Distribution Function”. The next slide re-iterates this definition.

12 Probability Distribution Function probability distribution function, The probability distribution function, P(x), of a discrete random variable expresses the probability that X takes the value x, as a function of x. That is

13 Probability Distribution Function -Exercise 1- 4Ex 1-1: Suppose you roll a die. Let X be the random variable for this experiment. Find the probability distribution function P(x) by completing the table in the Excel Sheet “Probability Distribution Function Exercise”. 4Ex 1-2: Plot the probability distribution function.

14 Probability Distribution Function -Exercise 2- 4Consider the following game. You toss a coin. If you get the heads, you receive \100. If you gets the tails, you receive nothing. 4The payoff for this game is a discrete random variable. Let X denote this random variable. Find the probability distribution of this random variable by completing the table in “Probability Distribution Function Exercise”.

15 Required Properties of Probability Distribution Functions of Discrete Random Variables Let X be a discrete random variable with probability distribution function, P( x ). Then i.P(x)  0 for any value of x ii.The individual probabilities sum to 1; that is Where the notation indicates summation over all possible values x.

16 Cumulative Probability Function cumulative probability function, The cumulative probability function, F(x 0 ), of a random variable X expresses the probability that X does not exceed the value x 0, as a function of x 0. That is Where the function is evaluated at all values x 0

17 Cumulative Probability Function -Example 3- 43-1: Let X be the random variable for a roll of a die. Find F(1), F(2), F(3), to F(6). Use the Excel sheet, `Probability distribution function exercise’. 43-2: Plot F(x) and x.

18 Derived Relationship Between Probability Function and Cumulative Probability Function Let X be a random variable with probability function P(x) and cumulative probability function F(x 0 ). Then it can be shown that Where the notation implies that summation is over all possible values x that are less than or equal to x 0.

19 Expected Value 4Expected value is a similar concept as the average. More specifically, it is the weighted average with the weight given by the probability of each outcome. 4For example, consider the following game. You toss a coin. If you get the heads, you receive \100. If you get the tails, you receive nothing. 4Then the expected payoff for this game is \100×(probability of getting \100) + \0×(probability of getting \0) = \50 4More formally, expected value is defined as follows: See next slide.

20 Expected Value expected value, E(X), The expected value, E(X), of a discrete random variable X is defined Where the notation indicates that summation extends over all possible values x. mean  x The expected value of a random variable is called its mean and is denoted  x.

21 Understanding the notation of the expected value Let X be the random variable which takes a value in S={x 1, x 2,..,x k }. Then the expected value of X is computed as follows. See next slide

22 Random variable X P(x)xP(x) x1x1 P(x 1 )x 1 P(x 1 ) x2x2 P(x 2 )x 2 P(x 2 ) ::: xkxk P(x k )x k P(x k ) μX=μX=

23 Expected Value Exercise -Exercise 4- 4Let X be the random variable that shows the number of house purchase contracts that a real estate agent can achieve in a month. The probability distribution of X is given by the following. Compute the expected number of house purchase contracts that the real estate agent can achieve in a month. xP(x) 00.05 10.07 20.12 30.2 40.3 50.2 60.06

24 Expected Value: Functions of Random Variables Let X be a discrete random variable with probability function P(x) and let g(X) be some function of X. Then the expected value, E[g(X)], of that function is defined as

25 Expected Value: Functions of Random Variables -Exercise 5- 4Continue using the real estate agent example. Suppose that the monthly salary for the real estate agent is given by: g(x) =$1000+ $1500*x Ex 5-1: Find the expected monthly salary of the agent. Use the “Probability Distribution Function Exercise” Excel Sheet.

26 Variance and Standard Deviation variance Let X be a discrete random variable. The expectation of the squared deviation about the mean, (X -  x ) 2, is called the variance, denoted  2 x and is given by standard deviation The standard deviation,  x, is the positive square root of the variance. Often we use the Var(X) to denote the variance and SD(X) to denote the standard deviation

27 Understanding the procedure to compute the variance 4The table in the next slide summarizes the procedure to compute variance.

28 Variable X P(x)xP(x)(x- μ X ) 2 P(x) x1x1 P(x 1 )x 1 P(x 1 )(x 1 -μ X ) 2 P(x 1 ) x2x2 P(x 2 )x 2 P(x 2 )(x 2 -μ X ) 2 P(x 2 ) :::: xkxk P(x k )x k P(x k )(x k -μ X ) 2 P(x k ) Sum=μ X Sum=σ 2 X

29 Variance and Standard Deviation -Exercise 6- 4Continue using the real estate agent example. Using the table in the “Probability Distribution Function Exercises” Excel sheet, answer the following questions: Ex 6-1 Compute the variance Ex 6-2 Compute the standard deviation xP(x) 00.05 10.07 20.12 30.2 40.3 50.2 60.06

30 Summary of Properties for Linear Function of a Random Variable meanvariance Let X be a random variable with mean  x, and variance  2 x ; and let a and b be any constant fixed numbers. Define the random variable Y = a + b X. Then, the mean and variance of Y are and standard deviation of Y so that the standard deviation of Y is

31 Linear Function of a Random Variable -Exercise 7- 4Continue using the example of the real estate agent from exercise 4, 5, and 6. 4Suppose that the monthly salary for this agent, Y, is determined in the following method: Y=$1000+ $1500*X Ex 7-1: Compute E(Y) using the formula in the previous slide. Ex 7-2: Compute the variance and standard deviation of Y

32 Standardization of a Random Variable Let X be a random variable with mean  X and standard deviation  X. Define a new random variable Z as Then E(Z)=0 Var(Z)=1

33 Exercise 8 4Continue using the real estate agent example. Let X be the random variable for the possible number of contracts the agent can achieve in a month. 4Standardize X using the formula in the previous slide, and verify that it has mean zero and variance 1.

34 Reviews of Combinatorics and Common discrete distributions 4Review of Combinatorics 1.Number of orderings 2.Number of combinations 3.Number of sequences of x Successes in n Trials 4Common discrete distributions 1.Bernoulli Distribution 2.Binomial Distribution

35 Stock Price Movement Example 4To motivate the study of combinatorics and the discrete distributions, let us consider a simple example of a stock price movement. The example will utilize combinatorics and distributions.

36 Stock Price Movement Example 4The price of Stock A today is $10. At the end of each month the price of the stock A either goes up by the factor of 1.2 with probability 0.4, or goes down by the factor of 0.9 with probability 0.6. 4This means that, if the price of the stock goes up this month, then the price of the stock in the second month will be $10×1.2 =$12. If the price of the stock goes up this month, and goes down in the second month, the price of the stock in the third month will be $10×1.2×0.9 = $10.8.

37 4Suppose that you make the following contract with a stock broker: “You have the right to purchase a share of stock A at the price equal to $37.61 at the beginning of the 13th month. 4Then, if the actual market price of stock A is higher than $37.61, you purchase the stock and immediately sell it to make a positive profit (ignoring fees associated with the contract and transaction fee). If the actual price is lower than 37.61, you do not have to exercise the right. 4Then consider the following question: See next slide Stock Price Movement Example, Contd

38 4 Question What is the probability that you make some strictly positive profit from this contract (ignoring all the fees associated with the contract and buying and selling of the share)? 4Answer to this question requires tools such as combinatorics and Binomial distribution. 4In the following slides, we will review combinatorics and some common distributions. After studying these concepts, we will come back to the question.

39 Review of Combinatorics -Number of orderings- 4You have n cards numbered from 1 to n. The number of ways you can order this card is given by n!=n×(n-1) ×(n-2) ×…×3×2×1 n! reads n factorial 0! is defined to be 1.

40 Number of ordering example 4There are 5 cards numbered from 1 to 5. What is the number of ways you can order this card?

41 Review of Combinatorics -Combinations- 4Suppose there are n cards numbered from 1 to n. If you take x cards out of n cards, the number of possible combinations of the cards is given by C n x reads n choose x. Where n!=n×(n-1) ×(n-2) ×…×3×2×1

42 Combinations -Example- 4A personnel officer has eight candidate to fill four similar positions. What is the total number of possible combinations of four candidates chosen from eight?

43 Review of combinatorics - sequences of x Successes in n Traials- 4Consider a random trial where there are only two outcomes, “Success” or “Failure”. 4Then, if you make n independent trials, the number of sequences that contains exactly x successes is equal to C n x.

44 Sequences of Successes -Exercise- 4Consider tossing a coin 10 times. Find the number of ways the head appears exactly 4 times.

45 Number of sequences -Exercise- 4Suppose that the figure below is a road map of a certain area. If you start from point A and walk to point B, how many possible routes can you take? (Suppose you do not walk back.) A B

46 Bernouli Trial This is a random experiment with two possible outcomes, “success” or “failure”, where the probabilities are given by P(Success) =  P(Failure) = 1-  Bernouli Random Trial with success probability .

47 Bernouli Random Variable 4Consider a Bernouli Trial with P(Success)= . Define a random variable X in the following way. X=1 if the Bernouli random trial turn out to be success X=0 if the Bernouli random trial turns out to be a failure. Then, X is called a Bernouli Random Variable with success probability .

48 Bernouli Distribution 4Consider a Bernouli random variable X with success probability . Then the probability distribution function for X is called Bernouli Distribution with success probability . This is given by P(0)=(1-  ) and P(1)= 

49 Bernouli Distribution -Example- 4Consider the following game. You toss a coin. If you get the heads, you receive $1. If you get the tails, you receive nothing. Let X be the random variable for the payoff of this game. 4X has the Bernouli distribution with success probability 0.5.

50 Mean and Variance of a Bernoulli Random Variable mean The mean is: variance And the variance is:

51 Binomial Distribution -Example- 4I use an example to illustrate Binominal Distribution. 4You inspect a production line by randomly checking the items. It is known that 5% of the products from this production line are defect items. 4Suppose you randomly choose 4 items from the production line. Then, the number of defect items you would find is a discrete random variable.

52 4Let X be the number of defect items in the 4 randomly picked items. What is the probability that exactly 2 of them are defect items? 4To answer to this question, first, consider the possible sequences that 2 defect items are picked. Binomial Probability -Examples, Contd-

53 4The number of possible sequences you pick 2 defect items is given in the table. D denotes the defect item, and G denotes the good item. 4Note that the number of sequences is given by C 4 2 =6. The possible sequences you pick 2 defect items Sequence 1 DDGG Sequence 2 DGDG Sequence 3 GDDG Sequence 4 GGDD Sequence 5 GDGD Sequence 6 DGGD

54 4Now, what is the probability of getting Sequence 1? That is, what is the probability that you first get D, second you get D, third you get G and fourth you get G? 4The answer to this question: since the probability of getting D is 0.05, and the probability of getting G is (1- 0.05)=0.95, the probability of getting this sequence is 0.05*0.05*0.95*0.95 =0.002256.

55 4In fact, the probability of getting any of the 6 sequences is the same; since each sequence contains exactly 2 defective items and 2 good items, the probability of getting each sequence is 0.05 2 0.95 2 =0.002256. 4Since there are 6 sequences, the probability that you get exactly 2 defect items is given by (0.002256)×6=0.013536. 4This is equal to C 4 2 (0.05) 2 (1-0.05) 2

56 4We can generalize this problem. Consider a production line. The probability that an item from this production line is a defect item is . 4Suppose that you pick n products from this production line. Then, the probability that the number of defect items is exactly x is given by This probability distribution function is called Binomial Distribution with “success” probability . Next slide summarizes the binomial distribution.

57 Binomial Distribution binomial distribution Suppose that a random experiment can result in two possible mutually exclusive and collectively exhaustive outcomes, “success” and “failure,” and that  is the probability of a success resulting in a single trial. If n independent trials are carried out, the distribution of the resulting number of successes “x” is called the binomial distribution. Its probability distribution function for the binomial random variable X = x is: P( x successes in n independent trials)= for x = 0, 1, 2..., n

58 Mean and Variance of a Binomial Probability Distribution mean Let X be the number of successes in n independent trials, each with probability of success . The x follows a binomial distribution with mean, variance and variance,

59 Binomial Probabilities - An Example A sales person randomly visits houses to sell a certain product. He believes that for each visit, the probability of making a sale is 0.40. If the sales person visits 5 houses, what is the probability that he makes at least 3 sales?

60 Answer Let X be the random number for the number of sales. Then, P(At leaset 3 sale) = P(X ≥ 3) = P(X =3) + P(X = 4)+P(X=5) P(makes at least 3 sales)=P(3)+P(4)+P(5) =0.2304+0.0768+0.01024=0.31744

61 Computing Binomial Distribution using Excel Let n be the total number of trials. Let x be the number of success, and  be the success probability. The Excel function to compute binomial probabilities is P(X=x)= BINOMDIST(x, n, , FALSE) P(X≤x)=BINOMDIST(x,n, , TRUE) Note that if you put FALSE at the end, it computes the binomial probability distribution. If you put TRUE at the end, it computes the cumulative binomial distribution.

62 Binomial Distribution -Exercise- 4Open “Binomial Distribution Exercise” 4Find the Binomial Distribution Function for n=50 and  =0.3. Then, graph the Binomial Probability Distribution.

63 Binomial Distribution Function with n=50 and  =0.3.

64 Stock Price Movement Example 4Now, we come back to the Stock Price Movement example that we saw at the beginning. 4First, take a look at how the stock price may move in the first three months. See the next slide

65 This month $10 Second month $12 $9 Third month x 1 = $14.4 x 2 = $10.8 x 3 = $8.1 As it can be seen, there are three possible values for the stock price in the third month. Now answer the questions in the next slide. Stock price movement for the first three months

66 Q1: In the 13 th month, how many possible values for the stock price are there? Q2. Show that the 4 th highest price is $37.61 Q3. What is the probability that the stock price at the beginning of 13 th month is equal to the 4 th highest price, $37.61? Q4. Remember the contract. The contract is “You have the right to purchase a share of the stock A in the 13 th month at the price equal to $37.61”. Then, what is the probability that you get some positive profit from this contract (ignoring all the fees associated with buying and selling the stock).

67 Joint Probability Functions 4Consider two stocks, Stock A and Stock B. Let X denote the random variable for the return of stock A. Let Y denote the random variable for the return of Stock B. 4Suppose that X takes 4 possible values 0, 0.05, 0.1, and 0.15. 4Further, suppose that Y takes 4 possible values, 0, 0.05, 0.1, and 0.15. 4The joint probabilities of X and Y are given in the table in the next slide.

68 Joint Probability Function -Example- Y return X return00.050.10.15 00.020.10.050.01 0.050.030.1 0.05 0.1 0.120.01 0.15 0.130.01

69 Joint Probability Functions joint probability function Let X and Y be a pair of discrete random variables. Their joint probability function expresses the probability that X takes the specific value x and simultaneously Y takes the value y, as a function of x and y. The notation used is P(x, y) so,

70 Marginal Probability Functions marginal probability function Let X and Y be a pair of jointly distributed random variables. In this context the probability function of the random variable X is called its marginal probability function and is obtained by summing the joint probabilities over all possible values; that is, marginal probability function Similarly, the marginal probability function of the random variable Y is

71 Exercise 4Open “Joint Probability Exercise”. This sheet contains the joint probability example of stock A return (X) and Stock B return (Y) in the previous example. 4Find the Marginal distribution.

72 Conditional Probability Functions conditional probability function Let X and Y be a pair of jointly distributed discrete random variables. The conditional probability function of the random variable Y, given that the random variable X takes the value x, expresses the probability that Y takes the value y, as a function of y, when the value x is specified for X. This is denoted P(y|x), and so by the definition of conditional probability: conditional probability function Similarly, the conditional probability function of X, given Y = y is:

73 Exercise 4Continue using the same example. Compute the following conditional probabilities. P(X=0|Y=0.1) P(Y=0.15|X=0.1)

74 Independence of Jointly Distributed Random Variables independent The jointly distributed random variables X and Y are said to be independent if and only if their joint probability function is the product of their marginal probability functions, that is, if and only if And k random variables are independent if and only if

75 Exercise 4Using the example in the “Joint Distribution Exercise” check to see if X and Y are statistically independent.

76 Definition 4Let X and Y be jointly distributed discrete random variables with joint probability distribution function P(x,y). Then, the expectation of a function of X and Y, g(X,Y) is defined as

77 Covariance covariance Let X be a random variable with mean  X, and let Y be a random variable with mean,  Y. The expected value of (X -  X )(Y -  Y ) is called the covariance between X and Y, denoted Cov(X, Y). For discrete random variables An equivalent expression is

78 Correlation Let X and Y be jointly distributed random variables. The correlation between X and Y is:

79 Covariance and Statistical Independence statistically independent If two random variables are statistically independent, the covariance between them is 0. However, the converse is not necessarily true.

80 Exercise 4Consider the following joint distribution of X and Y Value of Y 34 Value of X 10.10.2 20.30.4 Exercise: Cov(X,Y), Var(X), Var(Y) and CORR(X,Y).

81 Portfolio Analysis The random variable X is the price for stock A and the random variable Y is the price for stock B. The market value, W, of the portfolio is given by the linear function, Where, a, is the number of shares of stock A and, b, is the number of shares of stock B.

82 Portfolio Analysis mean value for W The mean value for W is, variance for W The variance for W is, or using the correlation,

83 Exercise 4Consider Stock A and Stock B. Let X and Y denote the market price of stock A and B, respectively. It is known that E(X)=10, E(Y)=20, Var(X)=2, Var(Y)=4, and Cov(X,Y)= ‒ 1. Now consider the following portfolio. W=5X +4Y. Find E(W), Var(W).


Download ppt "Lecture Note 5 Discrete Random Variables and Probability Distributions ©"

Similar presentations


Ads by Google