Download BAHASA PEMROGRAMAN

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

Probability wikipedia , lookup

History of statistics wikipedia , lookup

Transcript
STATISTICS AND PROBABILITY
IN CIVIL ENGINEERING
TS4512
Doddy Prayogo, Ph.D.
1
The Most Common
Discrete Probability Distributions
1) --- Bernoulli distribution
2) --- Binomial
3) --- Geometric
4) --- Poisson
2
Bernoulli distribution
• The Bernoulli distribution is the “coin flip” distribution.
• X is Bernoulli if its probability function is:
p
1 w. p.
X 
0 w. p. 1  p
X=1 is usually interpreted as a “success.” E.g.:
X=1 for heads in coin toss
X=1 for male in survey
X=1 for defective in a test of product
X=1 for “made the sale” tracking performance
3
Bernoulli distribution
• Expectation:
E X   p1  1  p0  p
• Variance:
  E X 
V X   E X
2
2
 p1  1  p 0   p 
2
2
 p  p  p1  p 
2
4
2
Binomial distribution
• The binomial distribution is just n independent Bernoullis
• added up. Testing for defects “with replacement.”
–
–
–
–
5
Have many light bulbs
Pick one at random, test for defect, put it back
Pick one at random, test for defect, put it back
If there are many light bulbs, do not have to replace
Binomial distribution
• Let’s figure out a binomial r.v.’s probability function.
• Suppose we are looking at a binomial with n=3.
• We want P(X=0):
– Can happen one way: 000
– (1-p)(1-p)(1-p) = (1-p)3
• We want P(X=1):
– Can happen three ways: 100, 010, 001
– p(1-p)(1-p)+(1-p)p(1-p)+(1-p)(1-p)p = 3p(1-p)2
• We want P(X=2):
– Can happen three ways: 110, 011, 101
– pp(1-p)+(1-p)pp+p(1-p)p = 3p2(1-p)
• We want P(X=3):
– Can happen one way: 111
– ppp = p3
Binomial distribution
• So, binomial r.v.’s probability function
0

1
X 
2

3
PX x   # of ways  p 1  p 
x
n!
n x
x

p 1  p 
x ! n  x  !
7
n x
w. p.
1  p 
3
w. p. 3 p 1  p 
2
w. p. 3 p 2 1  p 
w. p.
p3
Binomial distribution
• Typical shape of binomial:
– Symmetric
8
• Expectation:


E  X   E   Zi    E  Zi    p  np
i 1
 i 1  i 1
n
Variance:
n
n
 n  n
V  X   V   Z i   V Z i 
 i 1  i 1
n
  p1  p   np1  p 
i 1
9
Binomial distribution
• A salesman claims that he closes a deal 40% of the time.
• This month, he closed 1 out of 10 deals.
• How likely is it that he did 1/10 or worse given his claim?
10
Binomial distribution
PX  0  
PX 1 
10!
0
10
0.4
0.6
     11 0.006   0.006
0!10!
10!
9
0.4
0.6
    10  0.4  0.010   0.040
1! 9!
Note:
PX ( X  1)  0.046
Less than 5% or
1 in 20.
So, it’s unlikely
that his success
rate is 0.4.
10  9 8  7 
10!
4
6
PX  4  
 0.4   0.6  
 0.0256  0.0467   0.251
4! 6!
4  3 2 
11
Binomial and normal / Gaussian
distribution
The normal distribution
is a good approximation
to the binomial
distribution. (“large” n,
small skew.)
B(n, p)
Prob. density function:
Geometric Distribution
• A geometric distribution is usually interpreted as number
of time periods until a failure occurs.
• Imagine a sequence of coin flips, and the random variable
X is the flip number on which the first tails occurs.
• The probability of a head (a success) is p.
13
Geometric
• Let’s find the probability function for the geometric
distribution:
PX 1  1  p 
PX 2   p1  p 
PX 3  p p 1  p   p 1  p 
2
etc.
So,
PX  x   ?
PX x   p
x 1
1  p 
(x is a positive integer)
Geometric
• Notice, there is no upper limit on how large X
can be
• Let’s check that these probabilities add to 1:


x 1
x 1
 PX x    p
x 1

1  p   1  p  p x 1
x 1

1
 1  p  p  1  p 
1
1  p 
x 0
x
15
Geometric series

1
p 

1 p
x 0
x

 xp
x 0
x 1
(| p | 1)Geometric
differentiate both sides w.r.t. p:
1
1
 1
 1 
2
(1  p )
(1  p ) 2
See Rosen
page 158,
example 17.
• Expectation:


x 1
x 1
 xPX x    xp
x 1
1  p   1  p  xpx 1
1
1
 1  p 

2
1  p  1  p
Variance:
p
V X  
1  p 2
16

x 1
Poisson distribution
• The Poisson distribution is typical of random variables
which represent counts.
– Number of requests to a server in 1 hour.
– Number of sick days in a year for an employee.
17
• The Poisson distribution is derived from the
following underlying arrival time model:
– The probability of an unit arriving is uniform through time.
– Two items never arrive at exactly the same time.
– Arrivals are independent --- the arrival of one unit does not make the
next unit more or less likely to arrive quickly.
18
Poisson distribution
• The probability function for the Poisson
distribution with parameter  is:
•  is like the arrival rate --- higher means
more/faster arrivals
e   x
Px  X  x  
for x  0,1,2,3,...
x!
E X   V  X   
19
Poisson distribution
• Shape
Low 
20
Med 
High 