Download Probability 1

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

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

Document related concepts
no text concepts found
Transcript
Probability 1
Random Experiment
A experiment with more than one outcome.
Outcomes vary in a unpredictable way when the experiment is repeated.
Sample space:
denoted by S, the collection of all possible outcomes of the random experiment.
Events are subsets of the sample space.
we usually denote them be A,B,C
elementarily events (outcomes) are single outcomes from the sample space, denoted usually by
a,b,c.
Set-Ops (algebra on events)
vendiagram
B
B
A
A
B
A
B
A
Union of A and B 𝐴 βˆͺ 𝐡, A or B or both occur
(maroon)
Interception of A and B 𝐴 ∩ 𝐡 both A and B occur
(darker section)
Complement: 𝐴𝐢
(Yellow)
π‘œπ‘Ÿ 𝐴̅ A does not occur
Difference: 𝐴\𝐡 = 𝐴 ∩ 𝐡̅
A occurs, B does not
(light purple)
Rules:
Μ…Μ…Μ…Μ…Μ…Μ…Μ…
𝐴 βˆͺ 𝐡 = 𝐴̅ ∩ 𝐡̅
Μ…Μ…Μ…Μ…Μ…Μ…Μ…
𝐴 ∩ 𝐡 = 𝐴̅ βˆͺ 𝐡̅
Interception is done before union, Operation order.
The above rules daisy chain, with themselves but not with each other
Probability:
𝑃: {𝑠𝑒𝑏𝑠𝑒𝑑𝑠: π‘œπ‘“ 𝑆} ∈ [0,1]
Axioms of probability:
1) P(A)β‰₯0 for each A
2) P(S)=1
3) 𝑃(𝐴 βˆͺ 𝐡) = 𝑃(𝐴) + 𝑃(𝐡) if A and B are disjoint or mutrally exclusive ie 𝐴 ∩ 𝐡 = { } ==
π‘’π‘šπ‘π‘‘π‘¦ π‘ π‘π‘Žπ‘π‘’
Rules:
4) 𝑃(𝐴1 βˆͺ 𝐴2 βˆͺ … 𝐴𝑛 ) = 𝑃(𝐴1 ) + 𝑃(𝐴2 ) + 𝑃(𝐴𝑛 )
if Ai ∩ Aj = {} for each pair of i,j: iβ‰ j
5) 𝑃(πœ™) = 0
as 𝐴 βˆͺ πœ™ = 𝐴 and 𝐴 ∩ βˆ… = βˆ…
so 𝑃(𝐴 βˆͺ πœ™) = 𝑃(𝐴) = 𝑃(𝐴) + 𝑃(πœ™) therefore 𝑃(πœ™) = 0
6) P(A’)=1-P(A)
7) if 𝐴 βŠ‚ 𝐡 then 𝑃(𝐡\𝐴) = 𝑃(𝐴 ∩ 𝐡̅) = 𝑃(𝐡) βˆ’ 𝑃(𝐴)
8) 𝑃(𝐴 βˆͺ 𝐡) = 𝑃(𝐴) + 𝑃(𝐡) βˆ’ 𝑃(𝐴 ∩ 𝐡)
Example: page 77 prob 3.48
Know:
P(A)=0.35
P(B)=0.73
𝑃(𝐴 ∩ 𝐡) = 0.14
a)
𝐴 βˆͺ 𝐡 = 𝐴 βˆͺ (𝐡\(𝐴 ∩ 𝐡))
𝐴 ∩ (𝐡\(𝐴 ∩ 𝐡) = {}
𝑃(𝐴 βˆͺ 𝐡) = 𝑃(𝐴 βˆͺ (𝐡\(𝐴 ∩ 𝐡))) = 𝑃(𝐴) + P(B\(A∩ 𝐡))= 𝑃(𝐴) + 𝑃(𝐡) βˆ’ 𝑃(𝐴 ∩ 𝐡)
b)𝑃(𝐴 ∩B’)
c) 𝑃(𝐴′ βˆͺ 𝐡′ ) = 1 βˆ’ 𝑃((𝐴′ βˆͺ 𝐡′ )β€² ) = 1 βˆ’ 𝑃(𝐴′′ ∩ 𝐡′′ ) = 1 βˆ’ 𝑃(𝐴 ∩ 𝐡) = 1 βˆ’ 0.14
Conditional Probability.
what are the chances of something happening given something else has happened.
𝑃(𝐴|𝐡)𝑖𝑠 𝑃(𝐴)𝑔𝑖𝑣𝑒𝑛 𝐡 π‘œπ‘π‘π‘’π‘Ÿπ‘ 
Let 𝑛𝐴 be the number of times A occurs in n experiments
Let 𝑛𝐡 be the number of times B occurs in n experiments
Let π‘›π΄βˆ©π΅ be the number of times A and B both occurs in n experiments
𝑃(𝐴|𝐡) β‰ˆ
π‘›π΄βˆ©π΅
𝑛𝐡
β‰ˆ
𝑃(𝐴∩𝐡)
𝑃(𝐡)
𝑃(𝐴 ∩ 𝐡)
𝑃(𝐡)
𝑃(𝐴|𝐡) = 0 if P(B)=0
𝑃(𝐴|𝐡) =
Independence of events
Roughly about If 𝑃(𝐴|𝐡) = 𝑃(𝐴) A is independent of B.
𝑃(𝐴|𝐡) = 𝑃(𝐴) = 𝑃(𝐴|𝐡′ )
𝑃(𝐴′ |𝐡) = 𝑃(𝐴′ ) = 𝑃(𝐴′ |𝐡′ )
Definition of independence
A and B are said to be independent if 𝑃(𝐴 ∩ 𝐡) = 𝑃(𝐴)𝑃(𝐡)
Properties:
𝑃(𝐴|𝐡) = 𝑃(𝐴) = 𝑃(𝐴|𝐡′ )
𝑃(𝐴′ |𝐡) = 𝑃(𝐴′ ) = 𝑃(𝐴′ |𝐡′ )
Similar hold true for B, in respect to prior knowledge of A.
From: 𝑃(𝐴 ∩ 𝐡) = 𝑃(𝐴)𝑃(𝐡) (A and B are independent) it follows
𝑃(𝐴′ ∩ 𝐡) = 𝑃(𝐴′)𝑃(𝐡)
𝑃(𝐴 ∩ 𝐡′) = 𝑃(𝐴)𝑃(𝐡′)
𝑃(𝐴′ ∩ 𝐡′) = 𝑃(𝐴′ )𝑃(𝐡′)
Example (3.62 p89)
population of all individuals with certain income.
58% invest in money market
25% invest in stocks
19% invest in both
If you randomly pick a person who invests in money market, what is the probability that they
will also invest in stocks.
ie:
What is the probability of a person investing in stocks given that they invest in the money
market
Solution:
Relevant Events:
A: event that the person picked is investing in money market
B: event that the person picked is investing in stocks
We Know:
P(A)=0.58
P(B)=0.25
𝑃(𝐴⋂B)=0.19
We want to know:
P(B|A)
Example:
Let A and be mutually exclusive (disjoint).
𝐴⋂B={} .’. P(𝐴⋂B)=0
P(A)>0, P(B)>0
question: are A and B independent?
No as P(A)P(B)=\=0
Impendence of more than two events
three events; A,B,C are indendent if (all of the following are true)
i) 𝑃(𝐴 ∩ 𝐡) = 𝑃(𝐴)𝑃(𝐡)
ii) 𝑃(𝐴 ∩ 𝐢) = 𝑃(𝐴)𝑃(𝐢)
iii) 𝑃(𝐡 ∩ 𝐢) = 𝑃(𝐡)𝑃(𝐢)
iv) 𝑃(𝐴 ∩ 𝐡 ∩ 𝐢) = 𝑃(𝐴)𝑃(𝐡)𝑃(𝐢)
Properties:
P(A’βˆͺ B|C)=P(A’βˆͺ B)
P(C|A∩ B’)=P(C)
Similar for more than 3 events. (more than three won’t be ascessed)
Total Probability formula
Let 𝐴1 , 𝐴2 … 𝐴𝑛 be a partition of the sample space (S).
s.t.
𝐴𝑖 ∩ 𝐴𝑗 = { } for each pair i,j
𝑛
S = ⋃ 𝐴𝑖 = 𝐴1 βˆͺ 𝐴2 … βˆͺ 𝐴𝑛 = 𝑆
𝑖=1
Let B be an event which overlaps with some of the Partitions A_i (it must, as they cover all of S)
𝑛
𝑃(𝐡) = βˆ‘ 𝑃(𝐡 ∩ 𝐴𝑖 )
𝑖=1
Remember: 𝑃(𝐴|𝐡) =
𝑃(𝐴∩𝐡)
=>
𝑃(𝐡)
P(A∩ B)=P(B)P(A|B)=P(A)P(B|A)
𝑛
𝑛
𝑃(𝐡) = βˆ‘ 𝑃(𝐡 ∩ 𝐴𝑖 ) = βˆ‘ 𝑃(𝐡|𝐴𝑖 )𝑃(𝐴𝑖 )
𝑖=1
𝑖=1
Example; (P90 Q3.73)
let
D be event of renting a car from agency D
E renting from agency E
F renting from agency F
B be the event of the car rented having bad tyres
P(D)=0.2
P(E)=0.2
P(F)=0.6
these are mutually exclusive
and Dβˆͺ Eβˆͺ F=S, so is a partition of S
P(B|D)=0.1,
P(B|E) =0.12
P(B|F)=0.04
10% of cars from D have bad tyres
Total Probability Formula
P(B)=P(B|D)P(D)+P(B|E)P(E)+P(B|F)P(F)
= 0.1x0.2 + 0.12x0.2 + 0.04x0.6= proability of getting bad tyres
Q3.74
What is the proability that a car with bad tyres that is rented, has been rented froim agency F.
𝑃(𝐹 ∩ 𝐡) 𝑃(𝐡|𝐹)𝑃(𝐹) 0.04 βˆ™ 0.6
𝑃(𝐹|𝐡) =
=
=
𝑃(𝐡)
𝑃(𝐡)
𝑃(𝐡)
Bayes Formula
𝐴1 , 𝐴2 … , 𝐴𝑛 forms a partition of S
𝑃(𝐴𝑖 |𝐡) =
𝑃(𝐡|𝐴𝑖 )𝑃(𝐴𝑖 )
𝑛
βˆ‘π‘˜=1(𝑃(𝐡|π΄π‘˜ )𝑃(π΄π‘˜ ))
Random Variable (R.V)
A random variable, say X, is a real function on a sample space.
X:S→ℝ.
Roughly Maps partitions on to real numbers.
Discrete R.V: finite number of possible values of Random Variables>
Continuous RV: the possibilities cover an interval from ℝ
Discrete RVs
p(x)=P(X=x), x is a possible value of X
p(x) is called the probability the probability mass function of X. (can also be written 𝑃𝑋 (π‘₯) )
Properties of Probaility Mass Function:
1) p(x)β‰₯0 for all x
2) βˆ‘all x p(x) = 1
Examples of important discrete R.V’s
1) beruoulli r.v: two possible outcomes: X has a sample space 𝑆𝑋 = π‘Žπ‘™π‘™ π‘π‘œπ‘ π‘–π‘π‘™π‘’ π‘£π‘Žπ‘™π‘’π‘’π‘  π‘œπ‘“ 𝑋
𝑆𝑋 = {0,1}
P(1)=p
called probability of β€œsuccesses”
P(0)=1-p
called probability of β€œfailure”
2) indicator function: (also a beruoulli r.v:)
if you divide a sample space into A (1) and A’ (0)
1 π‘€βˆˆπ΄
𝐼𝐴 (𝑀) = {
0 π‘€βˆ‰π΄
𝑃(𝐼𝐴 = 1) = 𝑃(𝐴)
Bernoulli RVs
let 𝑋1 , 𝑋2 , 𝑋3 , … , 𝑋𝑛 be n indiepent Bernoulli RVs, with probability of success p
(𝑋𝑖 ~ π΅π‘’π‘Ÿπ‘›π‘œπ‘’π‘™π‘™π‘–(𝑝) )
π‘Œ = 𝑋1 + 𝑋2 + 𝑋3 + … 𝑋𝑛
Y is the count of successes in β€œn” indepenedent Bernoulli(p) r.v’s.
Defininition:y is calle Binominal r. (Y~Bin(n,p))
Find the pmf (probability Mass function) of Y.
π‘ƒπ‘Œ (𝑦) = 𝑃(π‘Œ = 𝑦);
π‘ƒπ‘Œ (0) = 𝑃(π‘Žπ‘™π‘™ π‘‘π‘Ÿπ‘–π‘Žπ‘™π‘ π‘’π‘žπ‘’π‘Žπ‘™ π‘§π‘’π‘Ÿπ‘œ) = (1 βˆ’ 𝑝)(1 βˆ’ 𝑝) … (1 βˆ’ 𝑝) = (1 βˆ’ 𝑝)𝑛 ;
π‘ƒπ‘Œ (1) = 𝑃(1 𝑠𝑒𝑐𝑐𝑒𝑠𝑠 π‘Žπ‘›π‘‘ (𝑛 βˆ’ 1) π‘“π‘Žπ‘–π‘™π‘’π‘Ÿπ‘’π‘ ) = 𝑛𝑝(1 βˆ’ 𝑝)π‘›βˆ’1 ;
π‘ƒπ‘Œ (π‘˜) = 𝑃(π‘˜ 𝑠𝑒𝑐𝑐𝑒𝑠𝑠𝑒𝑠, (𝑛 βˆ’ π‘˜)π‘“π‘Žπ‘–π‘™π‘’π‘Ÿπ‘’π‘ ) = (π‘›π‘˜)π‘π‘˜ (1 βˆ’ 𝑝)(π‘›βˆ’π‘˜) ; k=0,1,2,3…,n
Example: p112 Q4.11=
family individuals 13 individuals attend. Count how main have a cold.
is not modalable with a binomial, because they aren’t independent because other family
member could give each other colder.
A meeting of strangers, who don’t live near each other, etc.
We can now model with binomial how many have colds.
Because is independent.
A shop has 8 projecter, 2 of which are broken (but not marked).
If we pick 2 what are the chances of how many of the 2 are defective.
Not modalable with binomial as we change the same space by removing one.
Cumulative Distribution function
Let Z be a r.v with 𝑃𝑍 (𝑧)
with pmf:
𝐹(𝑧) = 𝑃(𝑍 ≀ 𝑧) ,
z∈ ℝ
𝐹(𝑧) = βˆ‘ 𝑝𝑍 (π‘₯)
π‘Žπ‘™π‘™ π‘₯≀𝑧
we will use tables.
Example Q4.26 p 114
(for very large sample doesn’t matter if no replacing)
2 out of 20 new buildings (10%) in a city violate building code.
the building inspector who checks 4 buildings:
Let Y=# of sampled buildings, out of 4, violating the buildingcode.
π‘Œ~𝐡𝑖𝑛(4, 0.1)
A) What is the probability that none of these (checked buildings ) violate the building code?
4
𝑃(π‘Œ = 0) = ( ) 0.10 (1 βˆ’ 0.1)4 = 0.94
0
4
𝑃(π‘Œ = 1) = ( ) 0.11 (1 βˆ’ 0.1)3 =
1
Expected Value of a discrete r.v
expected value = expectation =mean
Let X be a discrete r.v with p.m.f 𝑝𝑋 (π‘₯)
Defn:
𝐸(𝑋) = βˆ‘ π‘₯ 𝑝𝑋 (π‘₯)
π‘Žπ‘™π‘™ π‘₯
Example:
π‘₯
𝑝𝑋 (π‘₯)
-1
0.2
0
0.5
2
0.3
𝐸(𝑋) = βˆ‘ π‘₯ 𝑝𝑋 (π‘₯) = (βˆ’1)0.2 0(0.5) + 2(0.3) = 𝟎. πŸ’
π‘Žπ‘™π‘™ π‘₯
EXs:
X~bernoulli(p): 𝐸(𝑋) = 1𝑝 + 0(1 βˆ’ 𝑝) = 𝑝
X~Bin(n,p): βˆ‘π‘›π‘₯=0(π‘₯ (𝑛π‘₯)𝑝 π‘₯ (1 βˆ’ 𝑝)π‘›βˆ’π‘₯ = 𝑛𝑝
Long Run interpretation of E(X)
The random experiment is repeated n times,
and the value of X are recorded as π‘₯1 , π‘₯2 , … . , π‘₯𝑛 .
Then
π‘₯1 +π‘₯2 + …+π‘₯𝑛
β†’ 𝐸(𝑋)
𝑛
π‘›β†’βˆž
X – descrete r.v
let Y=f(X)
Y is therefore a random varirable
Find E(Y)
𝐸(π‘Œ) = βˆ‘ 𝑦 π‘π‘Œ (𝑦)
π‘Žπ‘™π‘™ 𝑦
Proposition:
𝐸(π‘Œ) = βˆ‘ 𝑓(π‘₯) 𝑝𝑋 (π‘₯)
π‘Žπ‘™π‘™ π‘₯
Variabnce if a discrerte r.v
π‘‰π‘Žπ‘Ÿ(𝑋) = 𝐸[(𝑋 βˆ’ 𝐸(𝑋)2 ]
2
𝑓(π‘₯) = (π‘₯ βˆ’ 𝐸(𝑋)) , 𝐸(𝑋)𝑖𝑠 π‘Ž π‘π‘œπ‘›π‘ π‘‘π‘Žπ‘›π‘‘ = 𝐸π‘₯π‘π‘’π‘π‘‘π‘Žπ‘‘π‘–π‘œπ‘›
.’.
π‘‰π‘Žπ‘Ÿ(𝑋) = 𝐸[(𝑋 βˆ’ 𝐸(𝑋)2 ] = 𝐸(𝑓(𝑋)) = βˆ‘ 𝑓(π‘₯) 𝑝𝑋 (π‘₯)
π‘Žπ‘™π‘™ π‘₯
Example:
X~bernoulli(p)
1
2
π‘‰π‘Žπ‘Ÿ(𝑋) = βˆ‘(π‘₯ βˆ’ 𝐸(𝑋)) 𝑝π‘₯ (π‘₯) = (0 βˆ’ 𝑝)2 (1 βˆ’ 𝑝) + (1 βˆ’ 𝑝)2 𝑝 = 𝑝(1 βˆ’ 𝑝)
π‘₯=0
Expection Properties:
𝐸(𝑋1 + 𝑋2 + β‹― + 𝑋𝑛 ) = 𝐸(𝑋1 ) + 𝐸(𝑋2 ) + β‹― + 𝐸(𝑋𝑛 )
𝐸(π‘Žπ‘‹ + 𝑏) = π‘ŽπΈ(𝑋)+b
2
2
𝐸[𝑋 βˆ’ 𝐸(𝑋)) ] = 𝐸(𝑋 2 ) βˆ’ (𝐸(𝑋))
Moments of r.v’s
𝐸(𝑋 π‘˜ ) βˆ’ π‘π‘Žπ‘™π‘™π‘’π‘‘ π‘‘β„Žπ‘’ π‘˜π‘‘β„Ž π‘šπ‘œπ‘šπ‘’π‘šπ‘’π‘›π‘‘ π‘œπ‘“ 𝑋
E(X) is the first moment of X
𝐸(𝑋 2 ) is the second moment of X
Variance of a biniomial:
𝑛
𝑛
π‘‰π‘Žπ‘Ÿ(𝑋) = βˆ‘ ((π‘₯ βˆ’ 𝑛𝑝)2 ( ) 𝑝 π‘₯ (1 βˆ’ 𝑝)π‘›βˆ’π‘₯ ) = 𝑛𝑝(1 βˆ’ 𝑝)
π‘₯
π‘₯=0
Poisson RV’s
𝑝𝑋 (π‘₯) = 𝑃(𝑋 = π‘₯) =
𝑆𝑋 = {0,1,2, … }
πœ†π‘₯ βˆ’πœ†
𝑒 ,
π‘₯!
where Ξ» >0
X~Poi(Ξ»)
Axiom 3 expended:
If 𝐴1 , 𝐴2 , …. mutrally exclusive
∞
∞
𝑃 (⋃ 𝐴𝑖 ) = βˆ‘(𝑃(𝐴𝑖 ))
𝑖=1
𝑖=1
∞
∞
π‘₯=0
π‘₯=0
πœ†π‘₯ βˆ’πœ†
πœ†π‘₯
βˆ’πœ†
βˆ‘ ( 𝑒 ) = 𝑒 βˆ‘ ( ) = 𝑒 βˆ’πœ† 𝑒 πœ† = 1
π‘₯!
π‘₯!
Macrabian expansion:
∞
𝑦
𝑒 = βˆ‘(
π‘˜=1
π‘¦π‘˜
)
π‘˜!
Properties:
𝑋~π‘ƒπ‘œπ‘–(πœ†)
E(X)=Ξ»
∞
∞
∞
π‘₯=0
π‘₯=0
π‘₯=1
πœ†π‘₯
πœ†π‘₯
𝐸(𝑋) = βˆ‘ π‘₯𝑝𝑋 (π‘₯) = βˆ‘ π‘₯ 𝑒 βˆ’πœ† = 𝑒 βˆ’πœ† βˆ‘
= 𝑒 βˆ’πœ† πœ†π‘’ πœ† = πœ†
π‘₯!
(π‘₯ βˆ’ 1)!
Related documents