Topic 3
Topic 3
Topic 3
Topic 3
Introduction to
Probability
Sayfa 1
Content
PART I
BASIC SET THEORY
PART II
BASIC PROBABILITY
PART III
RANDOM VARIABLES
PART IV
SPECIAL DISTRIBUTION FUNCTIONS
Sayfa 2
PART I
Sayfa 3
Set Theory
In mathematics, a well defined collection of objects
is called the set.
Examples:
Sayfa 4
Notation:
p A p is elements of A
A B A is subset of B
U Universal set
Empty set
AU
Sayfa 5
Set Operations: Venn Diagram
Intersection
A B
Union
A B
Difference
B A
Complement C
A
Sayfa 6
Example
Let
A ={1, 2, 3, 4}, B = {3, 4, 5, 6} and U={1, 2, 3, 4, 5, 6, 7,8 …}
A U B = {1, 2, 3, 4, 5, 6}
A n B = {3, 4}
A \ B = {1, 2}
Ac = {5, 6, 7, 8, ...}
Sayfa 7
PART II
BASIC
PROBABILITY
Sayfa 8
Probability (=Olasılık)
Historically, the probability theory began with study of
games of chance, such as roulette and cards.
Sayfa 9
Relative Frequency (=Göreli Sıklık)
n s f = s/n
------------- -------- ---------
10 4 0.4000000
100 41 0.4100000
1,000 476 0.4760000
10,000 5059 0.5059000
The result
100,000 49942 0.4994200
approaches
1,000,000 500351 0.5003510
a limit
10,000,000 4998906 0.4998906
as n -> ∞
100,000,000 50006417 0.5000641
1,000,000,000 500000839 0.5000084
Sayfa 11
Example
Here is the result obtained from a computer
simulation for tossing of a die and observing
frequency of six!
n s f = s/n
------------- -------- ---------
10 3 0.3000000
100 19 0.1900000
1,000 186 0.1860000
10,000 1659 0.1659000
The result
100,000 16748 0.1674800
approaches
1,000,000 166705 0.1667050
a limit
10,000,000 1667210 0.1667210
as n -> ∞
100,000,000 16666290 0.1666629
1,000,000,000 166666653 0.1666666
Sayfa 12
Probability Theory
The probability p of an event A is defined as follows:
If A occurs in s ways out of a total n equally likely ways
then
s
p P( A)
n
Sayfa 14
Sample Space (=Örneklem Uzayı)
Sayfa 15
* Tossing a die:
S = {1, 2, 3, 4, 5, 6}
Sayfa 16
Selecting a card randomly from a shuffle pack of playnig
cards, the possible outcomes are:
Sayfa 17
Axioms of Probability
Let S be sample space and A and B are two events.
A1. 0 P( A) 1
A2. P( S ) 1
Sayfa 18
Theorems of Probability
T1. P ( ) 0 (probability of impossible event is zero)
T2. If Ac is the complement of A, then P( Ac ) 1 P( A)
Sayfa 19
Example
A point Q is selected randomly
in a square whose side is 2 cm.
A circle is drawn tangent to the
edges of the square.
Find the probability of the point
being inside the circle.
Sayfa 20
PART III
RANDOM
VARIABLES
Sayfa 21
Random Variable (=Raslantı Değişkeni)
A Random Variable (RV) is a set of values that occur
randomly and have associated probabilities.
Sayfa 22
Discrete RV Examples:
pmf
x
H T
x
1 2 3 4 5 6
Sayfa 23
Discrete RV Examples:
pmf
f(x)
0.4
X = {1,2,3,4}
f(x) = {0.3, 0.4, 0.1, 0.2} 0.2
x
1 2 3 4
Sayfa 24
Continues RV Examples:
pdf
X = [0, 2]
f(x) = 3x2/8
Sayfa 25
Properties of Random Variables
Discreate RV Continues RV
f ( xi ) 0 f ( x) 0
f (x ) 1
i
i f ( x)dx 1
b b
f ( x ) P ( a x b)
ia
i f ( x)dx P(a x b)
a
Sayfa 26
Expectation Values
Expectation Value or Mean Value of RV is denoted by:
E[X] or <X> or x
Discrete RV: E[ X ] xi f ( xi )
i
Continues RV: E[ X ] x f ( x)dx
Sayfa 27
Mean of the Squares
It is defined as:
Discrete RV: E[ X ] x f ( xi )
2 2
i
i
E[ X ] x
2 2
Continues RV: f ( x)dx
RMS E[ X 2 ]
Sayfa 28
Variance
Variance is defined as:
Discrete RV: 2 ( xi x ) 2 f ( xi )
i
Continues RV: 2 ( x x ) 2 f ( x)dx
2 E[ X 2] ( E[ X ]) 2
X X
2 2
Sayfa 29
Standard Deviation
Square root of variance is called standard deviation:
2
E[ X ] ( E[ X ])
2 2
X 2 X 2
Sayfa 30
Example
X = {1, 2, 3, 4, 5, 6}
f(x) = {1/6, 1/6, 1/6, 1/6, 1/6, 1/6}
Find
(a) Expectation value of X, (b) RMS and (c) standard deviation
Sayfa 31
Example
The following table gives the probability distribution of, X,
the number of telephones in a randomly selected home in a
certain community.
x: 0 1 2 3 4
f(x): 0.021 0.412 0.283 0.188 0.096
Sayfa 33
Example f(x)
Consider the triangular pdf.
X = [0,2] 1
f(x) = kx
x
Find 0 2
Sayfa 34
PART IV
SPECIAL
DISTRIBUTION
FUNCTIONS
Sayfa 35
Binomial Distribution Function
The binomial distribution function specifies the number of times
(k) that an event occurs in n independent trials where p is the
probability of the event occurring in a single trial.
where
Sayfa 36
Example: A coin is tossed 3 times.
If you call heads a success, draw pmf for k = 0, 1, 2, 3.
Sayfa 37
Example: A coin is tossed 6 times.
Sayfa 38
Poisson Distribution Function
In the binomial equation, if the probability p is so small then the
distribution of events can be approximated by the Poisson
distribution.
Sayfa 39
Example: Birthday problem
Probability of one person to have birthday in any day is
1/365 = 0.00274. Calculate the probability that 4 people
share a birthday in a group of 1000 people.
----
Sayfa 40
Example
Suppose 1% of items made by a factory are defective.
Find the probability that 6 defective items in a sample of
300 items.
Sayfa 41
The Gaussian or Normal Distribution Function
In Statistics, if the number of events is very large (n>20),
then the Gaussian (normal) distribution function may be
used to describe nearly all events.
Sayfa 42
Sayfa 43
Properties of Gaussian Function
p( x) 0
p( x)dx 1
E[ X ] xp( x)dx
b
p( x)dx P(a x b)
(x ) p( x)dx
2 2 a
Sayfa 44
Standard Normal Curve
The normal distribution function for
µ = 0 and σ = 1
1 x2 / 2
f ( x) e 0.4 exp( x / 2)
2
2
Sayfa 45
Sayfa 46
Area Under the Curve
Total area under the standard normal curve is 1.
1 x2 / 2
f ( x) e
2
f ( x)dx 1
Sayfa 47
Area under the standard normal curve between [-1, 1] is:
1
1 x2 / 2
1 2
e dx 0.6827
This corresponds
+- 1 sigma
Sayfa 48
Area under the standard normal curve between [-2, 2] is:
2
1 x2 / 2
2 2
e dx 0.9545
This corresponds
+- 2 sigma
Sayfa 49
Area under the standard normal curve between [-3, 3] is:
3
1 x2 / 2
3 2
e dx 0.9973
This corresponds
+- 3 sigma
Sayfa 50
Area under the standard normal curve between [a, b] is:
b
1 x2 / 2
a 2
e dx (b) (a)
Sayfa 51
Sayfa 52
Example:
2.3
1
e
x2 / 2
dx (2.3) (1.2) 0.99 0.12 0.87
2 1.2
( 2.3) 0.99
(1.2) 0.12
Sayfa 53
Alternatively one can use Octave’s normcdf(x) function:
2.3
1 x2 / 2
1.2 2
e dx (2.3) (1.2) 0.8742
octave:> normcdf(2.3)
ans = 0.9893
octave:> normcdf(-1.2)
ans = 0.1151
octave:> normcdf(2.3)-normcdf(-1.2)
ans = 0.8742
Sayfa 54
Example: Evaluate the integral
1.4
1
e
x2 / 2
dx
2 0
Sayfa 55
Example: Evaluate the integral
1.1
1
e
x2 / 2
dx
2
Sayfa 56
Example: Evaluate the integral
0.5
1
òe
- x2 /2
dx
2p -0.5
Sayfa 57
Example: Let X be a random variable with the standard
normal distribution. Find:
(a) P(0<X<1.4)
(b) P(X<-1.1)
(c) P(|X|<0.5)
(d) P(X>3)
(e) P(X>5)
Sayfa 58
If a random varibale X is normally distributed, we compute
the probability that X lies between a and b as follows.
a b
a* b*
2. Then we compute the probability from
Sayfa 59
Example: Suppose the temperature during June is normally
distributed with mean 20 oC and standard deviation 3.33 oC.
Find the probability p that the temperature is between 21.11 oC
and 26.66 oC (Answer: 0.3479)
Sayfa 60
Example: Mean weight of 500 male students at a certain
university is 72 kg and the standard deviation is 5 kg.
Assuming that the weights are normally distributed, find how
many students weigh:
(a) between 66 and 75 kg (Answer: 305)
(b) more than 80 kg (Answer: 27)
Sayfa 61
Example Normal Distributions
Here we will examine some interesting real data whose
values are distributed normally.
Sayfa 62
Annual Rainfall (1960-2012)
Mean : <x> = 651.10 mm
Std. Dev. : σ = 74.35 mm
Data: http://www.mgm.gov.tr
Sayfa 63
Air temperature in Istanbul for the last 105 years.
Mean temperature: <x> = 21.97 oC
Std. Dev. : σ = 1.12 oC
Data: http://data.giss.nasa.gov/tmp/gistemp/STATIONS/tmp_649170620000_14_0/station.txt
Sayfa 64
Background Radiation in Gaziantep (2013)
Mean : <x> = 101.3 counts / sec
Std. Dev. : σ = 2.5 counts / sec
Sayfa 66
2. Which of the following is a random experiment?
(a) Tossing a coin.
(b) Rolling a single 6-sided die.
(c) Choosing a marble from a jar.
(d) All of the above.
3. Which of the following is an outcome?
(a) Rolling a pair of dice.
(b) Landing on red.
(c) Choosing 2 marbles from a jar.
(d) None of the above.
4. Which of the following experiments does NOT have equally
likely outcomes?
(a) Choose a number at random from 1 to 7.
(b) Toss a coin.
(c) Choose a letter at random from the word SCHOOL.
(d) None of the above.
Sayfa 67
5. What is the probability of choosing a vowel from the English
alphabet?
6. A number from 1 to 11 is chosen at random. What is the
probability of choosing an odd number?
7. What is the probability of choosing a king from a standard
deck of playing cards?
8. What is the probability of choosing the letter i from the word
probability?
9. What is the probability of choosing a jack or a queen from a
standard deck of 52 playing cards?
10. What is the sample space for choosing a letter from the
word mathematics?
11. What is the sample space for choosing a prime number less
than 15 at random?
12. What is the probability that a single throw of a die will result
in either 2 or 5?
Sayfa 68
13. A fair coin is tossed 5 times. Find the probability of getting
(a) exactly four heads (b) at least two heads (c) no heads.
Sayfa 69
16. A communication system contains 6 stations. Independent
probability of each station being functional is 90%. If the
system requires at least 4 stations to be functional what is
the probability that the communication system is functional.
(Answer: 0.9842)
Sayfa 70
18. Given the random variable and corresponding probability
mass function (pmf)
X = {1, 2, 3, 4, 5}
f(x) = {0.1, 0.3, 0.4, 0.1, 0.1}
Calculate
(a) ∑ f(xi)
(b) P(1<x<5)
(c) E[X]
(d) E[X2]
(e) RMS
(f) Variance
(g) standard deviation
Sayfa 71
19. Given the probability density function f(x) = 3x2/8.
Calculate
(a) Mean
(b) RMS
(c) P(x>0.5)
21. Given the pdf f(x) = k exp(-0.1x) for 0 < x < inf.
(a) Compute the normalization constant k.
(b) Find P(x>2).
Sayfa 72
22. Evaluate the following integrals:
2
1
z2 / 2
e dz
2 1
2
1
( z 1) 2 / 8
e dz
2 2 1
Sayfa 73
23. Suppose the diameters, D, of screws
manufactured by a company are normally distributed with
mean 0.25 cm and standard deviation 0.02 cm. A screw is
considered defective if its diameter D < 0.22 cm.
A sample of 250 screws are selected randomly.
Estimate the number of defective screws in this sample.
Sayfa 74