Upload
jolanta-dbrowski
View
53
Download
0
Embed Size (px)
DESCRIPTION
Part II: Discrete Random Variables. http://neveryetmelted.com/categories/mathematics/. Chapter 6: Random Variables; Discrete Versus Continuous. http://math.sfsu.edu/beck/quotes.html. Example : Random Variable. - PowerPoint PPT Presentation
Citation preview
1
Part II: Discrete Random Variables
http://neveryetmelted.com/categories/mathematics/
2
Chapter 6: Random Variables; Discrete Versus Continuous
http://math.sfsu.edu/beck/quotes.html
3
Example: Random VariableWe are playing a very simplified version of
blackjack in which each person is only dealt 2 cards. We are interested in the sum of the cards.
a) is the sum of the cards a quantitative or qualitative variable?
b) Is this a random variable?c) What is the sample space for this random
variable?d) what are the possible values for the random
variable?
4
Example: Random Variable
1) The lifetime of a light bulb2) The number of students in class on any
particular day3) The length of time to wait for a bus4) The number of seconds it takes for Mosby
(one of my cats) to sit on my lap after I sit down in my chair.
5
Random Variable Discrete: Example
Supposed that you draw 3 cards from a deck of cards and record whether the suit is black or red. Let Y be the total number of red cards.
a) construct a table that shows the values of Yb) Explain why Y is a discrete random variableIdentify the following events in words and as a
subset of the sample space.c) {Y = 2} d) {Y 2} e) {Y 1}
6
Chapter 7: Probability Mass Functions and Cumulative Distribution Functions
http://brownsharpie.courtneygibbons.org/?p=161
The 50-50-90 rule: AnytimeYou have a 50-50 chance ofgetting something right, there’s a 90% probabilityyou’ll get it wrong.
Andy Rooney
7
Example: Mass and CDFSupposed that you draw 3 cards from a deck of
cards and record whether the suit is black or red. Let X be the total number of red cards.
a) What is pX(2)?
b) Determine the mass of X.c) Construct a probability plot and histogram for
X.d) What is the CDF of X?e) Construct a plot of the CDF.
8
Plots for 3 cards Example
0 1 2 30.00.10.20.30.4
x
px(x)
0 1 2 3 40.0
0.1
0.2
0.3
0.4pX(x)
-2 -1 0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
9
Histogram: interpretation of PMF
0 1 2 30.00
0.10
0.20
0.30
0.40
x
px(x)
0 1 2 30.00
0.10
0.20
0.30
0.40
xTheoretical Simulated
1000 times
0 1 2 30.00
0.10
0.20
0.30
0.40
xSimulated10,000 times
10
Calculation of Probabilities from CDFs
Let X be a random variable. Then for all real numbers a,b where a < b1) P(a < X ≤ b) = FX(b) – FX(a)
2) P(a ≤ X ≤ b) = FX(b) – FX(a-)
3) P(a < X < b) = FX(b-) – FX(a)
4) P(a ≤ X < b) = FX(b-) – FX(a-)
11
Example 7.10: Coin Flipping
Flip a coin until the first head appears. Let X denote the number of flips until the first head appears (including the head).
12
Example 7.10: (cont)
mass CDF
13
Example 7.14*: CDF massWe want to know the probability that the next car that passes you on the road is blue (1), red (2), silver (3) or some other color (0). However, we misplaced the mass and only kept the CDF. Given the following CDF, what is the mass?
14
PMF: ExampleSupposed that you draw 3 cards from a deck of
cards (with replacement) and record whether the suit is black or red. Let Y be the total number of red cards.
Determine the PMF when a) there are equal numbers of red and black
cards.b) if out of 100 cards, 30 are red and 70 are
black.c) for p red cards out of 100 cards.
15
PMF Example (cont)Outcome Probability
p = 0.5 p = 0.3 General pRRRRRBRBRRBBBRRBRBBBRBBB
16
PMF Example (cont)Outcome Probability
p = 0.5 p = 0.3 General pRRR 1/8 = 0.125RRBRBRRBBBRRBRBBBRBBB
17
PMF Example (cont)Outcome Probability
p = 0.5 p = 0.3 General pRRR 1/8 = 0.125 0.027RRBRBRRBBBRRBRBBBRBBB
18
PMF Example (cont)Outcome Probability
p = 0.5 p = 0.3 General pRRR 1/8 = 0.125 0.027 p3(1 – p)0
RRBRBRRBBBRRBRBBBRBBB
19
PMF Example (cont)Outcome Probability
p = 0.5 p = 0.3 General pRRR 1/8 = 0.125 0.027 p3(1 – p)0
RRB 1/8 = 0.125 0.063 p2(1 – p)1
RBR 1/8 = 0.125 0.063 p2(1 – p)1
RBB 1/8 = 0.125 0.147 p1(1 – p)2
BRR 1/8 = 0.125 0.063 p2(1 – p)1
BRB 1/8 = 0.125 0.147 p1(1 – p)2
BBR 1/8 = 0.125 0.147 p1(1 – p)2
BBB 1/8 = 0.125 0.343 p0(1 – p)3
20
Chapter 8: Jointly Distributed Random Variables; Independence and Conditioning
The most misleading assumptions are the ones you don’t even know you’re making.
Douglas Adams and Mark Carwardine
http://math.stackexchange.com/questions/314072/joint-probability-mass-function
21
Joint PMF: Example
Suppose that 15 percent of the 300 families in a certain community have no children, 20 percent have 1 child, 35 percent have 2 children, and 30 percent have 3 children. Further suppose that in each family, each child is equally likely (independent) to be a boy or a girl. Let B be the number of boys in a family chosen randomly from this community and G be the number of girls. The following is the table for this situation.
22
Example: Table for family exampleBoys, y
0 1 2 3
Girls, x
0 45 30 26 11
1 30 53 34 0
2 26 34 0 0
3 11 0 0 0
23
Joint mass for family example
Boys, B
0 1 2 3
Girls, G
0 0.15 0.10 0.0867 0.0367
1 0.10 0.1767 0.1133 0
2 0.0867 0.1133 0 0
3 0.0367 0 0 0
24
Joint CDF for family example
Boys, B, Y
<0 0 1 2 3
Girls, G, X
<0 0 0 0 0 0
0 0 0.15 0.25 0.3367 0.3734
1 0 0.25 0.5267 0.7267 0.7634
2 0 0.3367 0.7267 0.9267 0.9634
3 0 0.3734 0.7634 0.9634 1.0001
26
Joint and marginal mass for family example
Boys, B
0 1 2 3 Total
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
Total 0.3734 0.3900 0.2000 0.0367 1.0001
27
Joint CDF for family example
Boys, B, Y
<0 0 1 2 3
Girls, G, X
<0 0 0 0 0 0
0 0 0.15 0.25 0.3367 0.3734
1 0 0.25 0.5267 0.7267 0.7634
2 0 0.3367 0.7267 0.9267 0.9634
3 0 0.3734 0.7634 0.9634 1.0001
28
Alternative joint mass for family exampleBoys, y
0 1 2 3 Total
Girls, x
0 44 31 26 11 112
1 31 52 34 0 117
1 26 34 0 0 60
3 11 0 0 0 11
Total 112 117 60 11 300
29
a) Suppose that one of the families is selected at random. What is the probability that there are 2 children?
Boys, B
0 1 2 3 Total
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
Total 0.3734 0.3900 0.2000 0.0367 1.0001
30
a) Suppose that one of the families is selected at random. What is the probability that there are 2 children?
Boys, B
0 1 2 3 Total
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
Total 0.3734 0.3900 0.2000 0.0367 1.0001
31
b) Suppose that one of the families is selected at random. What is the probability that there are fewer than 2 boys and
fewer than 2 girls?
Boys, B
0 1 2 3 Total
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
Total 0.3734 0.3900 0.2000 0.0367 1.0001
32
b) Suppose that one of the families is selected at random. What is the probability that there are fewer than 2 boys and
fewer than 2 girls?
Boys, B
0 1 2 3 Total
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
Total 0.3734 0.3900 0.2000 0.0367 1.0001
33
Joint CDF for family exampleBoys, B, Y
<0 0 1 2 3
Girls, G, X
<0 0 0 0 0 0
0 0 0.15 0.25 0.3367 0.3734
1 0 0.25 0.5267 0.7267 0.7634
2 0 0.3367 0.7267 0.9267 0.9634
3 0 0.3734 0.7634 0.9634 1.0001
a) What is the probability that there are fewer than 2 boys and fewer than 2 girls?
34
Joint CDF for family exampleBoys, B, Y
<0 0 1 2 3
Girls, G, X
<0 0 0 0 0 0
0 0 0.15 0.25 0.3367 0.3734
1 0 0.25 0.5267 0.7267 0.7634
2 0 0.3367 0.7267 0.9267 0.9634
3 0 0.3734 0.7634 0.9634 1.0001
b) What is the probability that there are greater than 0 and at most 2 girls and greater than 0 and at most 2 boys?
35
Joint and marginal mass for family example
Boys, B
0 1 2 3 Total
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
Total 0.3734 0.3900 0.2000 0.0367 1.0001
36
Joint CDF for family example
Boys, B, Y
<0 0 1 2 3
Girls, G, X
<0 0 0 0 0 0
0 0 0.15 0.25 0.3367 0.3734
1 0 0.25 0.5267 0.7267 0.7634
2 0 0.3367 0.7267 0.9267 0.9634
3 0 0.3734 0.7634 0.9634 1.0001
37
Example 8.12: Independence
Roll a 4-sided die and flip a fair coin. Let X be the result of the die roll. Let Y be 1 if the coin shows a “head” or 0 if the coin shows a “tails”.
Are X and Y independent?
38
Independence of 3 or more random variables
A finite number of discrete random variables, X1, X2, …, Xn are independent if the following is true:
Definition 8.12:
Remark 8.20:
Remark 8.21: Consider a collection of events, A1, A2, …, An. For each j, let Xj be an indicator for event Aj. Then the Aj’s are independent events iff the Xj’s are independent random variables.
39
Example: Conditional mass: X (Boys) and Y (Girls)
Boys, B
0 1 2 3 pX(x)
Girls, G
0 0.15 0.10 0.0867 0.0367 0.3734
1 0.10 0.1767 0.1133 0 0.3900
2 0.0867 0.1133 0 0 0.2000
3 0.0367 0 0 0 0.0367
pY(y) 0.3734 0.3900 0.2000 0.0367 1.0001
40
Table : Conditional PMF of X (Girls) for each possible value of Y (Boys)
Boys, B
0 1 2 3 pX(x)
Girls, G
0 0.4017 0.2564 0.4335 1 0.3734
1 0.2678 0.4531 0.5665 0 0.3900
2 0.2322 0.2905 0 0 0.2000
3 0.0982 0 0 0 0.0367
Total 0.9999 1.0000 1.0000 1.0000 1.0001
41
Chapters 9: Expected Values of Discrete Random Variables
http://www.cartoonstock.com/directory/a/average_family_gifts.asp
X
42
Example: Expectation
A school class of 120 students are driven in 3 buses to a basketball game. There are 36 students in one of the buses, 40 students in another, and 44 on the third bus. When the buses arrive, one of the 120 students is randomly chosen. Let X denote the number of students on the bus of that randomly chosen student. Find E(X).
43
Example: Expectation
An individual who has automobile insurance form a certain company is randomly selected. Let X be the number of moving violations for which the individual was cited during the last 3 years. The mass of X is
Calculate E(X).
x 0 1 2 3pX(x) 0.60 0.25 0.10 0.05
X
44
Example 9.10: Expectation
The top five cards of a shuffled deck of cards are dealt to a player. What is the expected number of hearts that the player receives?
45
Chapter 10: Expected Values of Sums of Random Variables
http://faculty.wiu.edu/JR-Olsen/wiu/stu/m206/front.htmX
46
Example: Expected values of Sums
An individual who has automobile insurance form a certain company is randomly selected. Let X be the number of moving violations for which the individual was cited during the last 3 years. The PMF of X is
If the cost of insurance depends on the following function of accidents, g(x) = 400 + (100x- 15), what is the expected value of the cost of the insurance?
X 0 1 2 3pX(x) 0.60 0.25 0.10 0.05
X
47
Example: Unbiased estimatorConsider a finite population and a variable defined on it. Let µ denote the population mean – that is, the arithmetic mean of all possible observations of the variable for the entire population. Suppose that we don’t know µ and that we want to estimate it. To do so, we take a random sample of n members from the population. Let X1, X2
, …, Xn denote the values of the variable for the n members selected and set
as the sample mean. Show that is an unbiased estimator of µ -- that is E() = µ.
X
48
Example 10.10: Indicator Random Variables
In a shuffled deck of cards, a student selects cards without replacement until the ace of spaces is drawn.
How many cards does the student expect to draw?
X
49
Chapter 11: Expected Values of Functions of Discrete Random Variables; Variance of Discrete
Random Variables
http://fightingdarwin.blogspot.com/2011_12_01_archive.htmlX
50
Example: Expected Value of a Function
Consider a situation where a discrete random variable can have the values from -2 to 2. (Like a person can take a seat up to 2 places to the left of center (-2) and 2 places to the right of center (+2).)
What is E(X2)?
X
51
Example: (2nd time)An individual who has automobile insurance form a
certain company is randomly selected. Let X be the number of moving violations for which the individual was cited during the last 3 years. The PMF of X is
a) If the cost of insurance depends on the following function of accidents, g(x) = 400 + (100x - 15), what is the expected value of the cost of the insurance?
b) What is the expected value of X2?
x 0 1 2 3pX(x) 0.60 0.25 0.10 0.05
X
52
Example: VarianceA school class of 120 students are driven in 3
buses to a basketball game. There are 36 students in one of the buses, 40 students in another, and 44 on the third bus. When the buses arrive, one of the 120 students is randomly chosen. Let X denote the number of students on the bus of that randomly chosen student. Find the variance of X.
X
53
Example: Properties of Variance
An individual who has automobile insurance form a certain company is randomly selected. Let X be the number of moving violations for which the individual was cited during the last 3 years. The PMF of X is
a) If the cost of insurance depends on the following function of accidents, g(x) = 400 + (100x- 15), what is the variance of the cost of insurance?
X 0 1 2 3pX(x) 0.60 0.25 0.10 0.05
X
54
Example: Properties of Variance (cont)An individual who has automobile insurance form a
certain company is randomly selected. Let X be the number of moving violations for which the individual was cited during the last 3 years. The PMF of X is
b) If the cost of insurance depends on the following function of accidents, g(x) = 400 + (100x- 15), what is the variance of the cost of insurance for 3 people who are independent?
X 0 1 2 3pX(x) 0.60 0.25 0.10 0.05
X