Probabilities
description
Transcript of Probabilities
PROBABILITIES
Probabilities• Basic concepts:
• Random experiment: • All possible outcomes have to be known in advance• The result of a particular experimen tcannot be predicted (randomness).• The experiment can be repeated under identical conditions
• Sample space Ω:• Set of all possible outcomes
• Events• A sub-set of the sample space, i.e. a set of possible otucomes
• Singular event:• A sub-set of the sample space with one element
Probability model
1. Set S of possible outcomesa) Throw the coin, S = (pitch, toss)b) Throw the dice, S = (1, 2, 3, 4, 5, 6)
2. Probabilites Pia) Throw the coin, S = (pitch, toss)
P(pitch) = P(toss) = 1/2b) Throw the dice, S = (1, 2, 3, 4, 5, 6)
P(1) = P(2) = P(3) = P(4) = P(5) = P(6) = 1/6
Probabilities• Dice 1, 2, 3, 4, 5, 6• P(1) = P(2) = P(3) = P(4) = P(5) = P(6) = 1/6
• Two dice are thrown
1 2 3 4 5 6
1
2
3
4
5
6
Model
W2W1
1/6
1/6
1/6
1/6
1/6
1/6
1/6 1/6 1/6 1/6 1/6 1/6
1/36
Probabilities1. P(both dice show 1) = P(1) P(1) = 1/6 1/6 = 1/36
1 2 3 4 5 6
1
2
3
4
5
6
Model
W2W1
1/6 1/6 1/6 1/6 1/6 1/6
1/6
1/6
1/6
1/6
1/6
1/6
Probabilities2. Event E: get a „2“ and a „3“: P(E) = 2 P(2) P(3) = 2 1/6
1/6 = 1/18 Event F: first dice a „2“, second dice a „3“, P(F) = 1/6 1/6 = 1/36
1 2 3 4 5 6
1
2
3
4
5
6
Model
W2W1
1/6 1/6 1/6 1/6 1/6 1/6
1/6
1/6
1/6
1/6
1/6
1/6
Probabilities3. P(double) = P(double 1) + ... + P(double 6) = 6 1/36 = 1/6
1 2 3 4 5 6
1
2
3
4
5
6
Model
W2W1
1/6 1/6 1/6 1/6 1/6 1/6
1/6
1/6
1/6
1/6
1/6
1/6
Probabilities4. P(sum of both dice is 7) = 6 1/36 = 1/6
1 2 3 4 5 6
1
2
3
4
5
6
Model
W2W1
1/6 1/6 1/6 1/6 1/6 1/6
1/6
1/6
1/6
1/6
1/6
1/6
Probabilities• Two hunters try to shoot a fox.• Each hunter strikes with probability 1/3.• What is the probability, that the fox survives?
ÞEach hunter does not strike with probability 2/3ÞP(fox survives) = P(both hunters do no strike) = 2/3 ∙ 2/3 = 4/9
Further probability exercises
PROBABILITIESFactorial, binomial coefficient and binomial distribution
ProbabilitiesFactorial:
• A number of students is called to the black board. How many orderings are possible?
1A 1 (A)
n ∙(n-1) ∙∙2 ∙1
3 ∙2 = 6CAB; CBA;ACB; BCA;ABC; BAC
2AB; BA
3 (A, B, C)
Number of possible orderings
OrderingsNumber of students
2 (A, B)
n
FactorialIn R: factorial() 0! := 1
1! = 12! = 1∙2 = 2
3! = 1∙2 ∙3 = 6
n! = 1∙2 ∙3 ∙ ∙n
Probabilities• Binomial coefficient
Choose 6 numbers out of 49. How many outcomes are there if the ordering does NOT matter and if numbers can be selected only once?
49 · 48 · 47 · 46 · 45 · 44 choices
49 · 48 choicesFirst and 2nd number:
48 choicesSecond number:49 choicesFirst number:
6 numbers:
Is this the solution? No! – Why?
1. selection: {7; 18; 5; 43; 1; 22}2. selection: {18; 7; 5; 43; 1; 22}
Both selections are equal,since they differ only with respect to the order
How many orderings are there? 6!
Final solution of question above:123456
444546474849
Probabilities
!649!6!49
123456444546474849
Claim:
124243!6124243444546474849
Definition:
649:!649!6
!49
!kn!k!n:k
n
is the number of ways k things can be chosen from n things. Here, the ordering of the k things is not of interest and each element can be chosen only once.
Binomial coefficient (In R: choose(n,k) )
1nn
0n
n1nn
1n
nkfür0kn
kn
nkn
Probabilities• Binomial coefficient
S:
wm
wm
mm
Phenotype: affectedunaffected
PKU is autosomal reccesive hereditary disease.
Pedigree:m: mutant allelew: wildtype allel (= „normal“ allele)
Inheritance (PKU)
Probabilities• Binomial distribution
wm
wm
?
S:P(child is ill)= 1/2 ∙ 1/2 =1/4P(child is not ill)= 1- P(child is ill)= 3/4
Probabilities• Binomial distribution
S:
wm
wm
S:
? ?
wm
wm
P(first child ill, 2nd child not ill) = 1/4 ∙ 3/4 =3/16P(one child ill, one child not ill) = 2 ∙ 1/4 ∙ 3/4 =6/16
Probabilities ShealthychildrenillchildrenP 3,2S:
wm
wm
? ?? ? ?
orderings
25
healthy
43
ill
41
healthy
43
healthy
43
32
43
41
25
ill
41
An experiment with two (->“binomial“) possible outcomes („success“ and „failure“) is independently repeated n times
p: probability of event 1 („success“) per experimentn: number of experimentsk: number of successes
knk p1pknp,k,nB
Binomial distribution (In R: dbinom(k,n,p) ):
Probabilities• Binomial distribution
Density function
S:
wm
wm
? ?? ? ?
p = 1/4 (affected)Þ (1-p) = 3/4 (not affected)
237,0434105
0 50
SildrenaffectedchP
396,0434115
1 41
SildaffectedchP
264,0434125
2 32
SchildrenaffectedP
088,0434135
3 23
SchildrenaffectedP
015,0434145
4 14
SchildrenaffectedP
001,0434155
5 05
SchildrenaffectedP
Probabilities• Binomial distribution
0 1 2 3 4 50.00
0.10
0.20
0.30
0.40
Number of affected children
f Density function
0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
Distribution function
Number of affected children
F
Probabilities• Random variable
x
y
z
Probability modelS
Probability P
Real numbers
1
2
3
4
5
RfunctionX
X: Random variable
?
Probabilities• Random variable: function X that assigns a real number to an event
S
201P
Examples for possible random variables X, Y
X: number of edges
X 34
X 0 X
Y: red 1brown 2
12 Y
Y
Probabilities• Random variable
S
201P
Question:
P(X = 3) = ?
X: number of edges
(sloppy)
correct:
P( aS | X(a) = 3) = 205
Use the sloppy notation!
ProbabilitiesS
201P
X: Number of edges
P(X = 4) =
P(X = 0) =
P(X = 2) =
P(X = 3) =
P(X = 5) =
52
208
0
41
205
207
0
P(X 4) =
P(X 0) =
P(X 2) =
P(X 3) =
P(X 5) =
52
2013
1
1
P(X < 0) = 0
52
Distribution function: F(a) = P(X a)
0.0
0.1
0.2
0.3
0.4
0 3 4 5 X
f
Density21
0.0
0.2
0.4
0.6
0.8
1.0
0 3 4 5 X
F
Distribution function1 2
Probabilities• Statistical measures
Sample Model
iixhx iixpμ
ExpectationExample
7/2041/432/50pixi
in1 xx
Mean
15.2430 2074152 μ
2
i1n12 xxs
Empircal variance
2ss
Emp. standard deviation
2ii
2 xp μσ
Variance
2σσ
Standard deviation
23.3215.24207
215.2341215.20522
σ
80.1σ
Probabilities• Binomial distribution
knk p1pknp,k,nB
Expectation: pnμ
Variance: p1pn2 σ
Standard deviation: p1pnσ
Probabilities• Continuous random variable
0° Random variable W: angleP: all angles equally likely
P(W = 180°) = ?
precision: 1° Þ 360 possibilities with P=1/360precision: 0.1° Þ 3600 possibilities with
P=1/3600precision: 0.01° Þ 36000 possibilities with P=1/36000
n possibilities with P=1/n0n
1n Þ
P(W = 180°) = 0
Probabilities• Continuous random variable
0 90 180 270 360 X0
0.2
0.4
0.6
0.8
1
F
0°
Distribution function: F(a) = P(W a)
F(0) = P(W 0°) =
0F(90) = P(W 90°) =
41
F(180) = P(W 180°) =
21
F(360) = P(W 360°) =
1F(270) = P(W 270°) =
43
Probabilities• Continuous random variable
0 90 180 270 360 X0
0.20.4
0.6
0.8
1F
Distribution function F
0 90 180 270 360 X
fDensity function f
3601
1
Ff
Probabilities• Random variable
discrete continuous
ii xpμExpectation
dxxfxμ
Variance 2ii
2 xp μσ
dxxfx 22 μσ
Probabilities• Random variable
0 90 180 270 360 X
fDensity function f
3601 Expectation?
Conjecture: 180
dxxfxμ 360
0dxxfx
360
0dxx360
1 360
0
2
2x
3601
180236002
3603601 2