Académique Documents
Professionnel Documents
Culture Documents
Random Variables
A random variable is one whose value is determined by the outcome of a random experiment.
A discrete random variable assumes countable values A continuous random variable assumes values that can be measured or a value that is contained in one or more intervals.
Probability Distributions
A probability distribution links a random variable X with the probability that X assumes a discrete value or a range of values This can be presented by a table, function or formula
Every random variable has associated with it a probability distribution. discrete random variables possess discrete probability distributions continuous random variables possess continuous probability distributions.
4
Some Preliminaries
Before we continue, it is useful to introduce two types of notation that we will be using in this lecture:
Factorials The Combination Notation
The symbol ! (read as factorial) is used to denote factorials The value of the factorial of a number is obtained by multiplying all the integers from that number to 1 The symbol n!, read as n factorial, represents the product of all the integers from n to 1. In other words,n! = (n) (n-1) (n-2)(n-3).3.2.1 By definition, 0! = 1 For example
6! = 6x5x4x3x2x1 10! = 10x9x8x7x6x5x4x3x2x1
8
Factorials
Combinations
Combinations give the number of ways r elements can be selected from n elements. The number of Combinations for selecting r from n distinct elements is given by: nCr = n ! r! ( n-r)! 5C2 is therefore calculated as (5!) / (2! 3!) = 5x4x3x2x1 (2x1) (3x2x1) = 120/12 = 10 All Scientific Calculators possess the Combination 9 Formula: look for it!
P(Heads) = , P(Tails) = If you were to toss the coin 10 times, would you get Heads for 5 of those times? The truth is that you can get Heads any amount of times ranging from 0 to 10 Of course, you are more likely to get 5 than 0, but the fact remains that both these numbers (as well as others in the range 0-10) are possible So the question is, how probable is each one? In other words, if we define the random variable X as the number of Heads we get, can we create a probability distribution for X? 10
11
Activity
Rolling a die 15 times and observing whether the number obtained is even or odd The experiment consists of n repeated trials, n = 0, 1,.. yes, n = 15 Each trial results in an outcome that may be classified as a success or a failure yes, either even or odd The probability of a success, denoted by p, remains constant from trial to trial yes, if we define the success as even, then p = 3/6 The repeated trials are independent Yes, whatever we obtain on one roll does not affect the probabilities of the other rolls of the die 15 THIS IS THEREFORE A BINOMIAL EXPERIMENT
Drawing 3 balls without replacement from a box that contains 10 balls, 6 of which are red and 4 of which are blue, and observing the colour of the balls The experiment consists of n repeated trials, n = 0, 1, yes, n = 3 Each trial results in an outcome that may be classified as a success or a failure yes, either red or blue The probability of a success, denoted by p, remains constant from trial to trial NO! we are sampling without replacement, so the probabilities will change from one trial to the other The repeated trials are independent NO! what we obtain on one draw will change the probabilities of the next draw THIS IS THEREFORE NOT A BINOMIAL EXPERIMENT
16
Rolling a die 15 times and observing the number of spots The experiment consists of n repeated trials, n = 0, 1,.. yes, n = 15 Each trial results in an outcome that may be classified as a success or a failure NO! One of SIX outcomes is possible The probability of a success, denoted by p, remains constant from trial to trial yes, if we define the success as any one of the faces, then p = 1/6 The repeated trials are independent Yes, whatever we obtain on one roll does not affect the probabilities of the other rolls of the die THIS IS THEREFORE NOT A BINOMIAL EXPERIMENT 17
Drawing 3 balls with replacement from a box that contains 10 balls, 6 of which are red and 4 of which are blue, and observing the colour of the balls The experiment consists of n repeated trials, n = 0, 1, yes, n = 3 Each trial results in an outcome that may be classified as a success or a failure yes, either red or blue The probability of a success, denoted by p, remains constant from trial to trial Yes, we are now sampling WITH replacement, so the probability of a blue ball is 4/10 and the probability of a red ball is 6/10 on each pick The repeated trials are independent Yes, what is obtained on one draw does not affect what happens on the other THIS IS THEREFORE A BINOMIAL EXPERIMENT
18
The formula is developed out of our attempt to put meaning to the question What does P(X = r) mean? P(X = r) P(r successes in n trials) P(r successes and n-r failures) The event of r successes and n-r failures can occur in several ways; each way is called a combination of r successes and n-r failures.
In our example, suppose we wanted to know P(X=2) : in other words, when tossing the coin 10 times, what is the probability that we get 2 Heads? If we get 2 Heads (r successes), that means we are getting 8 Tails (n-r failures)
19
20
n and p are called the parameters of the Binomial Distribution Without values for n and p we cannot use the Binomial Distribution formula to compute P(X = r). We therefore say that if the random variable X follows a Binomial Distribution:
22
23
Activity
Two women are having babies. What is the probability that they both have girls?
Step 1: do we have a Binomial Experiment? Step 2: Define the Random Variable and work out the parameters of the distribution Step 3: Calculate the required Probabilities
24
Step 2: Define the Random Variable, and the parameters of the Distribution
Two women are having babies. What is the probability that they both have girls? Define X as the random variable number of women having a girl X Bin (n,p) P(X = r) = nCr (p)r (q)n-r We already worked out that n=2, and p=0.5 If p=0.5, then q = 1-0.5 = 0.5 Therefore, X Bin (2,0.5) P(X = r) = 2Cr (0.5)r (0.5)2-r
26
X Bin (2,0.5)
P(X = r) = 2Cr (0.5)r (0.5)2-r We want to calculate P(X = 2) P(X = 2) = 2C2 (0.5)2 (0.5)2-2 = 2C2 (0.5)2 (0.5)0 = 1/4
27
Activity
The proportion of allergy patients who show a positive reaction to a certain skin test is 0.66. An average of five patients a day are tested at the allergy clinic. Calculate the probability that among any five patients three will give a positive reaction.
Step 1: do we have a Binomial Experiment? Step 2: Define the Random Variable and work out the parameters of the distribution Step 3: Calculate the required Probabilities
28
The experiment (testing for the allergy) consists of n repeated trials, n = 0, 1, 2, ...(n = 5) Each trial results in an outcome that may be classified as a success or a failure (define positive reaction as success, negative reaction as failure) The probability of a success, denoted by p, remains constant from trial to trial (p = probability of positive reaction = 0.66) The repeated trials are independent (yes) THIS IS A BINOMIAL EXPERIMENT 29
Step 2: Define the Random Variable, and work out the parameters of the Distribution
The proportion of allergy patients who show a positive reaction to a certain skin test is 0.66. An average of five patients a day are tested at the allergy clinic. Calculate the probability that among any five patients three will give a positive reaction. Define X as the random variable number of patients having positive reaction to the skin test X Bin (n,p) P(X = r) = nCr (p)r (q)n-r We already worked out that n=5, and p=0.66 If p=0.66, then q = 1-0.66 = 0.34 Therefore, X Bin (5,0.66) P(X = r) = 5Cr (0.66)r (0.34)5-r
30
31
Please Note:
The best way to understand distributions such as these is to PRACTICE
The PS Mann Chapter 5 contains many, many questions on these probability distributions You are strongly advised to work questions from this Chapter
32
It is applied to experiments with random and independent occurrences. The occurrences are always considered with respect to an interval
The interval may be a time interval, a space interval, or a volume interval
33
Examples
The number of phone calls received by a household during a given day The receiving of the call is the occurrence, the interval is one day, the occurrences are random The number of accidents that occur on a given highway during a one week period An accident is an occurrence, the interval is 1 week, the occurrences are random The number of defective items in the next 100 items manufactured on a machine A defective item is an occurrence, the interval is every 100 items, the occurences are random
35
In Contrast.
The arrival of patients at a doctors office: these are non-random if the patients have to make appointments to see the doctor
The arrival of commercial planes at an airport: these are non-random since planes are scheduled to arrive at certain times
36
If the random variable X follows a Poisson Distribution, this means that X () The probability of r occurrences in an interval is: P( X = r) = e r r = 0, 1, 2, r! where e is approximately the value 2.718 (look for it on your calculator) and is the mean number of
occurrences in that interval
By this formula, once we know the value of we can compute any probability under the Poisson Distribution is therefore the parameter of the Distribution 38
Activity
On average, 2 new accounts are opened per day at the UWI branch of Republic Bank Ltd. Find the probability that, on a given day, exactly 6 new accounts will be opened at this branch. Let X represent the number of accounts opened per day the mean number of accounts opened on a given day are 2, therefore = 2 X follows a Poisson Distribution with parameter 3, that is, X (2) P( X = r) = e 2 2 r r = 0, 1, 2, r! Therefore, P(X =6) = e 2 2 6 = 0.120 40 6!
Activity
Suppose that the number of accidents occurring at the Barataria Roundabout in a month averages 3. Find the probability that there will be 5 accidents in November. Let X represent the number of accidents per month the mean number of occurrences in a given time interval, here in a given month, = 3 X follows a Poisson Distribution with parameter 3, that is, X (3) P( X = r) = e 3 3 r r = 0, 1, 2, r! Therefore, P(X = 5) = e 3 3 5 = 0.101 5!
41
Activity
Suppose that the number of accidents occurring at the Barataria Roundabout in a month averages 3. Find the probability that there will at most 3 accidents in November. X is discrete, so it takes countable values 0, 1, 2 At most means, everything up to and including 3 P(X 3) = P( X = 0 OR 1 OR 2 OR 3) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) = e 3 3 0 + e 3 3 1 + e 3 3 2 + e 3 3 3 0! 1! 2! 3! = .0498 + .1494 + .2241 + .2241 = .6474
42
Activity
Suppose that the number of accidents occurring at the Barataria Roundabout in a month averages 3. Find the probability that there will at least 4 accidents in November. At Least means 4 OR 5 OR 6 Or 7 How do we calculate this? We know that X is a discrete random variable with a discrete (Poisson) probability distribution All probabilities must therefore add to 1 Can we not then use the result we previously calculated? P(X 4) = 1 P(X 3) = 1- 0.6474 = 0.3526
43
The Approximation Of The Binomial Distribution By The Poisson Distribution. When q is approximately equal to 1, we can be reasonably accurate in using the Poisson Distribution as an approximation to the Binomial Distribution. The Poisson Distribution yields a good approximation to the Binomial Distribution when n is large and p is relatively small (i.e. p close to zero). To execute the approximation we simply set the parameter = np and substitute into the Poisson Distribution Formula.
44
Comparative Probabilities of P(X = 50) when p = 0.02 for three values of n viz. 50, 100 and 200
n 50 100 200
Binomial
Poisson
Error
% Error
15 2 1
Clearly, as n gets larger, the two yield approximately the same values This approximation of the Poisson to the Binomial was of great practical importance before the advent of the electronic computer. Now it is less important but it is still intellectually interesting We will soon consider the much more appealing approximation of the Binomial distribution by the Normal 45 Distribution
End of Lecture
We have reviewed two Discrete Distributions: the Binomial Distribution and the Poisson Distribution The best way to understand distributions such as these is to PRACTICE The PS Mann Chapter 5 contains many, many questions on these two probability distributions: you are STRONGLY advised to work questions from this Chapter In the next lecture we will move on to Continuous Probability Distributions
46