Download Lecture 2 - Wharton Statistics

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
5/26/2010
Statistics 111 - Lecture 2
Discrete Random Variable
“The probable is what usually happens.” (Aristotle )
Moore, McCabe and Craig: Section 4.3,4.5
Random variables
• A random variable is a variable whose value is a
numerical outcome of a random phenomenon.
• Example: three tosses of a coin
• S = {HHH,THH,HTH,HHT,HTT,THT,TTH,TTT}
• Random variable X = number of observed tails
• Possible values for X = {0,1, 2, 3}
• Why do we need random variables?
• We use them as a model for our observed data
1
5/26/2010
Discrete Random Variables
• A discrete random variable X has a finite number of
possible values.
• Discrete random variables can be summarized by
listing:
1. There possible outcomes/values
2. The associated probabilities for each outcome/value
• Example: number of members in US families
X
2
3
4
5
6
7
P(X)
0.413
0.236
0.211
0.090
0.032
0.018
Another Example
• X = the sum of two dice
• X={2,3,4,5,6,7,8,9,10,11,12}
• Use “equally-likely outcomes” rule to calculate
the probability distribution:
X
2
3
4
5
6
7
8
9
10
11
12
# of
Outco
mes
1
2
3
4
5
6
5
4
3
2
1
P(X)
1/36
2/36
3/36
4/36
5/36
6/36
5/36
4/36
3/36
2/36
1/36
• This is a probability distribution which can be
These
nicely viewed using a probability histogram Tip:
must sum
to 1!
2
5/26/2010
Probability Histograms
• Probability histogram of X (sum of two dice):
• It can be used to compute probabilities of events:
P(X> 10) = P(X = 11) + P(X = 12) = 3/36
P(X> 2) = 1-P(X = 2) = 1-1/36=35/36
P(5<X<8)=P(X=6)+P(X=7)=11/36
Expected value of Discrete r.v.
• Average of all possible values of a random variable (often
called expected value)
• The expected value is the sum of all possible values, with
each value weighted by its probability:
𝜇=
𝑋𝑖 ∙ 𝑃 𝑋𝑖 = 𝑋1 ∙ 𝑃 𝑋1 + 𝑋2 ∙ 𝑃 𝑋2 + ⋯ + 𝑋𝑛 ∙ 𝑃(𝑋𝑛 )
• Example: X = sum of two dice
X
2
3
4
5
6
7
8
9
10
11
12
P(X)
1/36
2/36
3/36
4/36
5/36
6/36
5/36
4/36
3/36
2/36
1/36
μ = 2⋅ (1/36) + 3⋅ (2/36) + 4 ⋅ (3/36) +…+12⋅ (1/36)
= 252/36 = 7
3
5/26/2010
Variance of Random variable
• Spread of all possible values of a random variable
around its expected value 
• Variance is the sum of the squared deviations away
from the mean of all possible values, weighted by
the values probability:
𝜎2 =
(𝑋𝑖 − 𝜇)2 ∙ 𝑃 𝑋𝑖 = (𝑋1 − 𝜇)2 ∙ 𝑃 𝑋1 + ⋯ + (𝑋𝑛 − 𝜇)2 ∙ 𝑃(𝑋𝑛 )
• Example: X = sum of two dice
X
2
3
4
5
6
7
8
9
10
11
12
P(X)
1/36
2/36
3/36
4/36
5/36
6/36
5/36
4/36
3/36
2/36
1/36
σ2 = (2 - 7)2⋅(1/36) + (3− 7)2⋅(2/36) +…+(12 - 7)2⋅(1/36)
= 210/36 = 5.83
Expected value and Variances rules
Let X,Y be independent r.v.s then:
1. E(X+Y)=E(X)+E(Y)
2. E(aX+b)= aE(X)+b where a is a constant
3. Var(X+Y)=Var(X)+Var(Y)
4. Var(aX+b)=a2Var(X)
5. sd(aX)=|a|sd(X)
4
5/26/2010
The Binomial Random variable
1. Fixed number n of trials (X1,…,Xn)
2. Trials are independent of each other
3. Xi has two possible values: Success (Xi = 1) or
Failure (Xi = 0)
4. Each Xi has the same probability of success: p =
P(Xi = 1)
Binomial Distribution
n
• Y   X i counts the number of successes in n trials.
i 1
• Y follows a Binomial distribution and it has two
parameters:
• number of trials n and the success probability p
𝑃 𝑌=𝑘 =
𝑛
∙ 𝑝𝑘 ∙ (1 − 𝑝)𝑛−𝑘
𝑘
• Binomial formula accounts for
• number of success: pk
• number of failures : (1-p)n-k
• different orders of success/failures:
𝑛
𝑛!
=
𝑘 𝑘! 𝑛 − 𝑘 !
5
5/26/2010
Binomial Probability Histogram
• Can make histogram out of these probabilities
• Can add up bars of histogram to get any
probability we want: eg. P(Y < 4)
• Different values of n and p have different
histograms, but Table C in book has probabilities
for many values of n and p
Binomial Table
6
5/26/2010
Example: Genetics
• If a couple are both carriers of a certain disease,
then their children each have probability 0.25 of
being born with disease
• Suppose that the couple has 4 children
• P(none of their children have the
disease)=P(X=0)?
𝑃 𝑌=0 =
4
∙ (0.25)0 ∙ (0.75)4 = 0.3164
0
• P(at least two children have the disease)?
P(Y ≥ 2) = P(Y = 2) +P(Y = 3) +P(Y = 4)
= 0.2109 +0.0469 +0.0039 (from table)
= 0.2617
June 10, 2008
Stat 111 - Lecture 9 - Proportions
13
Example: Quality Control
• A worker inspects a sample of n=20 microchips
from a large shipment
• The probability of a microchip being faulty is 10%
(p = 0.10)
• What is the probability that there are less than
three failures in the sample?
P(Y < 3) = P(Y = 0) + P(Y =1) + P(Y = 2)
= 0.1216 + 0.2702 + 0.2852 (from table)
= 0.677
7
5/26/2010
Mean and Variance of Binomial Counts
• We can calculate the mean and variance of a
Binomial distribution with parameters n and p:
𝜇𝑌 = 𝑛 ∙ 𝑝
𝜎𝑌2 = 𝑣𝑎𝑟(𝑌) = 𝑛 ⋅ 𝑝 ⋅ (1 − 𝑝)
𝜎𝑌 = 𝑆𝐷(𝑌) = 𝑛 ⋅ 𝑝 ⋅ (1 − 𝑝)
Slot machine setup:
Dial 1
Cherries
Oranges
Lemons
Plums
Bells
Bars
Dial 2
7
3
3
4
2
1
20
Typical Payoff on a 1-dollar bet:
Dial 3
7
7
0
1
2
3
20
0
6
4
6
3
1
20
Dial 1
Bar
Bell
Bell
Plum
Orange
Orange
Cherry
Cherry
Dial 2
Dial 3
Payoff
Bar
Bar
60
Bell
Bell
20
Bell
Bar
18
Plum
Plum
14
Orange Orange
10
Orange Bar
8
Cherry
Anything
2
No Cherry Anything
0
Anything Else
-1
8
5/26/2010
Next Class - Lecture 3
• Continuous Random Variblaes
• Moore and McCabe: Section 4.3,1.3
9
Related documents