42
JURUSAN TEKNIK SIPIL UNIVERSITAS ANDALAS oleh : Purnawan, PhD ----- Kuliah ke 4 ----- STATISTIKA dan PROBABILITAS

051210170613Kuliah Statistik 4 - Probabilitas

Embed Size (px)

DESCRIPTION

ku

Citation preview

  • JURUSAN TEKNIK SIPIL

    UNIVERSITAS ANDALAS

    oleh :

    Purnawan, PhD

    ----- Kuliah ke 4 -----

    STATISTIKA dan

    PROBABILITAS

  • Bab 4 Penggunaan Probabilitas dan

    Distribusi Probabilitas

  • Materi Bab 4

    Menjelaskan 3 pendekatan untuk menganalisa

    probabilitas

    Menerapkan aturan umum probabilitas

    Menggunakan Theorema Bayesia untuk

    probabilitas kondisional

    Membedakan antara distribusi probabilitas

    diskret dan kontinu

    Menghitung expected value dan standard deviation untuk distribusi probabilitas diskret

  • Definisi penting

    Probability merupakan kesempatan bahwa sebuah kejadian tidak pasti akan terjadi (nilai

    antara 0 dan 1)

    Experiment merupakan proses untuk memperoleh hasil dari kejadian yang tidak pasti

    Elementary Event hasil yang sangat dasar yang mungkin dari eksperimen sederhana

    Sample Space pengumpulan dari semua hasil dasar

  • Ruang Sampel

    (sample space) Ruang sampel adalah kumpulan dari semua

    kemungkinan yang dihasilkan

    Contoh : kemungkinan muka dadu ada 6 muka

    Contoh : kemungkinan muka kartu ada 52 muka

  • Kejadian (event)

    Kejadian dasar (elementary event) sebuah

    hasil dari sebuah ruang sampel dengan satu

    karakteristik

    - Contoh : Kartu merah dari kumpulan kartu

    Kejadian (event) kejadian yang

    menghasilkan dua atau lebih hasil secara

    serentak

    - Contoh : Sebuah kartu as merah dari kumpulan kartu

  • Visualizing Events

    Tabel kemungkinan (contingency)

    Diagram pohon

    Merah 2 24 26

    Hitam 2 24 26

    Total 4 48 52

    As Not As Total

    Full Deck

    of 52 Cards

    Sample

    Space

    Sample

    Space 2

    24

    2

    24

  • Elementary Events

    Dari catatan konsultan mobil, tipe bahan bakar

    dan tipe kendaraan

    2 tipe bahan bakar : Bensin, Diesel

    3 tipe kendaraan : Truk, Mobil, SUV

    6 possible elementary events:

    e1 Bensin, Truk

    e2 Bensin, Mobil

    e3 Bensin, SUV

    e4 Diesel, Truk

    e5 Diesel, Mobil

    e6 Diesel, SUV

    Mobil

    Mobil

    e1

    e2

    e3

    e4

    e5

    e6

  • Konsep Probabilitas

    Kejadian Mutually Exclusive

    Jika E1 terjadi, kemudian E2 tidak terjadi

    E1 dan E2 tidak mempunyai elemen yang

    berkaitan

    Kartu Hitam

    Kartu

    Merah

    Sebuah kartu

    tidak dapat

    berwarna hitam

    dan merah saat

    bersamaan.

    E1 E2

  • Independent and Dependent Events

    - Independent : kejadian yang satu tidak

    mempengaruhi probabilitas kejadian yang lain

    - Dependent : kejadian yang satu

    mempengaruhi probabilitas kejadian yang lain

    Konsep Probabilitas

  • Independent Events

    E1 = muka koin hasil lemparan pertama

    E2 = muka koin hasil lemparan kedua

    Hasil dari lemparan koin kedua tidak tergantung oleh

    hasil lemparan koin pertama.

    Dependent Events

    E1 = berita ramalan hujan

    E2 = membawa payung pergi kerja

    Probabilitas kejadian kedua dipengaruhi oleh

    kejadian pertama

    Independent vs Dependent Events

  • Perhitungan Probabilitas

    Classical Probability Assessment

    Kejadian Frekuensi Relatif

    Penilaian Probabilitas Subyektif

    P(Ei) = Jumlah kejadian Ei yg dpt terjadi

    Jumlah total kejadian dasar

    Freq. Relatif dari Ei = Jumlah kejadian Ei

    N

    Sebuah pendapat atau pertimbangan oleh

    pengambil keputusan tentang kemungkinan besar

    sebuah kejadian

  • Aturan Probabilitas

    Aturan utk

    Nilai Probabilitas

    dan Jumlah

    Nilai Individu Jumlah Seluruh Nilai

    0 P(ei) 1

    Utk setiap

    kejadian ei

    1)P(ek

    1i

    i

    dimana :

    k = jumlah kejadian dasar didalam

    suatu ruang sampel

    ei = i

    th kejadian dasar

  • Aturan Penjumlahan utk Kejadian Dasar

    Probabilitas suatu kejadian Ei adalah sama

    terhadap jumlah dari probabilitas dari

    kejadian dasar Ei.

    Sehingga, jika:

    Ei = {e1, e2, e3}

    kemudian :

    P(Ei) = P(e1) + P(e2) + P(e3)

  • Aturan Pelengkap (Complement Rule)

    Pelengkap dari suatu kejadian E adalah

    kumpulan semua kejadian dasar yangtidak

    mengandung kejadian E. Pelengkap dari

    kejadian dinyatakan dengan E.

    Aturan Pelengkap :

    P(E)1)EP( E

    E

    1)EP(P(E) Atau

  • Aturan Penambahan (addition rule) utk dua kejadian

    P(E1 E2) = P(E1) + P(E2) - P(E1 E2)

    E1 E2

    P(E1 E2) = P(E1) + P(E2) - P(E1 E2) Jangan dihitung

    elemen ini dua kali !

    Addition Rule:

    E1 E2 + =

  • Contoh : Addition Rule

    P(Red Ace) = P(Red) +P(Ace) - P(Red Ace)

    = 26/52 + 4/52 - 2/52 = 28/52 Jangan

    dihitung

    dua As

    merah dua

    kali !

    Black

    Color Type Red Total

    Ace 2 2 4

    Non-Ace 24 24 48

    Total 26 26 52

  • Addition Rule utk Mutually Exclusive Events

    Jika E1 dan E2 adalah mutually exclusive,

    then

    P(E1 E2) = 0

    Sehingga :

    P(E1 E2) = P(E1) + P(E2) - P(E1 E2)

    = P(E1) + P(E2)

    E1 E2

  • Probabilitas Bersyarat (Conditional Probability)

    Conditional probability untuk setiap

    dua kejadian E1 , E2 :

    )P(E

    )E P(E)E|P(E

    2

    2121

    0)P(Edimana 2

  • Berapa probabilitas bahwa sebuah mobil

    mempunyai CD player dan AC ?

    Misal : Kita ingin menghitung P(CD | AC)

    Contoh : Conditional Probability

    Pada kumpulan mobil bekas yang banyak, 70% mempunyai AC dan 40% mempunyai CD player serta 20% dari mobil tsb mempunyai keduanya

  • No CD CD Total

    AC .2 .5 .7

    No AC .2 .1 .3

    Total .4 .6 1.0

    Pada kumpulan mobil bekas yang banyak, 70% mempunyai AC dan 40% mempunyai CD player serta 20% dari mobil tsb mempunyai keduanya

    .2857.7

    .2

    P(AC)

    AC)P(CDAC)|P(CD

    (lanjutan)

    Contoh : Conditional Probability

  • Contoh : Conditional Probability

    No CD CD Total

    AC .2 .5 .7

    No AC .2 .1 .3

    Total .4 .6 1.0

    Untuk mobil ber-AC, kita hanya melihat baris atas (70% mobil). Pada baris ini, 20% mobil mempunyai CD player. 20% dari 70% adalah sekitar 28.57%.

    .2857.7

    .2

    P(AC)

    AC)P(CDAC)|P(CD

    (lanjutan)

  • Independent Events

    Conditional probability untuk

    independent events E1 , E2:

    )P(E)E|P(E 121 0)P(Edimana 2

    )P(E)E|P(E 212 0)P(Edimana 1

  • Multiplication Rules

    Multiplication rule untuk 2 kejadian E1 dan E2 :

    )E|P(E)P(E)EP(E 12121

    )P(E)E|P(E 212 Note: Jika E1 dan E2 independent, lalu

    Dan multiplication rule disederhanakan menjadi

    )P(E)P(E)EP(E 2121

  • Contoh : Diagram Pohon

    Diesel P(E2) = 0.2

    Gasoline

    P(E1) = 0.8

    Car: P(E4|E1) = 0.5

    P(E1 and E3) = 0.8 x 0.2 = 0.16

    P(E1 and E4) = 0.8 x 0.5 = 0.40

    P(E1 and E5) = 0.8 x 0.3 = 0.24

    P(E2 and E3) = 0.2 x 0.6 = 0.12

    P(E2 and E4) = 0.2 x 0.1 = 0.02

    P(E3 and E4) = 0.2 x 0.3 = 0.06

    Car: P(E4|E2) = 0.1

  • Teorema Bayes

    where:

    Ei = ith event of interest of the k possible events

    B = new event that might impact P(Ei)

    Events E1 to Ek are mutually exclusive and collectively

    exhaustive

    )E|)P(BP(E)E|)P(BP(E)E|)P(BP(E

    )E|)P(BP(EB)|P(E

    kk2211

    iii

  • A drilling company has estimated a 40%

    chance of striking oil for their new well.

    A detailed test has been scheduled for more

    information. Historically, 60% of successful

    wells have had detailed tests, and 20% of

    unsuccessful wells have had detailed tests.

    Given that this well has been scheduled for a

    detailed test, what is the probability that the well will be successful?

    Contoh : Teorema Bayes

  • Let S = successful well and U = unsuccessful well

    P(S) = 0.4 , P(U) = 0.6 (prior probabilities)

    Define the detailed test event as D

    Conditional probabilities:

    P(D|S) = 0.6 P(D|U) = 0.2

    Revised probabilities

    Event Prior

    Prob.

    Conditional

    Prob.

    Joint

    Prob.

    Revised

    Prob.

    S (successful) 0.4 0.6 0.4*0.6 = 0.24 0.24/0.36 = 0.67

    U (unsuccessful) 0.6 0.2 0.6*0.2 = 0.12 0.12/0.36 = 0.33

    Sum = .36

    (continued)

    Contoh : Teorema Bayes

  • Given the detailed test, the revised probability

    of a successful well has risen to .67 from the

    original estimate of .4

    Contoh : Teorema Bayes

    Event Prior

    Prob.

    Conditional

    Prob.

    Joint

    Prob.

    Revised

    Prob.

    S (successful) 0.4 0.6 0.4*0.6 = 0.24 0.24/0.36 = 0.67

    U (unsuccessful) 0.6 0.2 0.6*0.2 = 0.12 0.12/0.36 = 0.33

    Sum = .36

    (lanjutan)

  • Introduction to Probability Distributions

    Random Variable

    Represents a possible numerical value from

    a random event

    Random Variables

    Discrete

    Random Variable

    Continuous

    Random Variable

  • Experiment: Toss 2 Coins. Let x = # heads.

    T

    T

    Discrete Probability Distribution

    4 possible outcomes

    T

    T

    H

    H

    H H

    Probability Distribution

    0 1 2 x

    x Value Probability

    0 1/4 = .25

    1 2/4 = .50

    2 1/4 = .25

    .50

    .25

    Pro

    bab

    ilit

    y

  • A list of all possible [ xi , P(xi) ] pairs

    xi = Value of Random Variable (Outcome)

    P(xi) = Probability Associated with Value

    xis are mutually exclusive

    (no overlap)

    xis are collectively exhaustive

    (nothing left out)

    0 P(xi) 1 for each xi

    S P(xi) = 1

    Discrete Probability Distribution

  • Discrete Random Variable Summary Measures

    Expected Value of a discrete distribution (Weighted Average)

    E(x) = Sxi P(xi)

    Example: Toss 2 coins,

    x = # of heads,

    compute expected value of x:

    E(x) = (0 x .25) + (1 x .50) + (2 x .25) = 1.0

    x P(x)

    0 .25

    1 .50

    2 .25

  • Standard Deviation of a discrete distribution

    where:

    E(x) = Expected value of the random variable

    x = Values of the random variable

    P(x) = Probability of the random variable having the value of x

    Discrete Random Variable Summary Measures

    P(x)E(x)}{x 2x

    (continued)

  • Example: Toss 2 coins, x = # heads, compute standard deviation (recall E(x) = 1)

    Discrete Random Variable Summary Measures

    P(x)E(x)}{x 2x

    .707.50(.25)1)(2(.50)1)(1(.25)1)(0 222x

    (continued)

    Possible number of heads

    = 0, 1, or 2

  • Two Discrete Random Variables

    Expected value of the sum of two discrete random variables:

    E(x + y) = E(x) + E(y)

    = S x P(x) + S y P(y)

    (The expected value of the sum of two random variables is the sum of the two expected values)

  • Covariance

    Covariance between two discrete random

    variables:

    xy = S [xi E(x)][yj E(y)]P(xiyj)

    where:

    xi = possible values of the x discrete random variable

    yj = possible values of the y discrete random variable

    P(xi ,yj) = joint probability of the values of xi and yj occurring

  • Covariance between two discrete random

    variables:

    xy > 0 x and y tend to move in the same direction

    xy < 0 x and y tend to move in opposite directions

    xy = 0 x and y do not move closely together

    Interpreting Covariance

  • Correlation Coefficient

    The Correlation Coefficient shows the strength of the linear association between two variables

    where:

    = correlation coefficient (rho) xy = covariance between x and y x = standard deviation of variable x y = standard deviation of variable y

    yx

    yx

  • The Correlation Coefficient always falls

    between -1 and +1

    = 0 x and y are not linearly related.

    The farther is from zero, the stronger the linear

    relationship:

    = +1 x and y have a perfect positive linear relationship

    = -1 x and y have a perfect negative linear relationship

    Interpreting the Correlation Coefficient

  • Chapter Summary

    Described approaches to assessing probabilities

    Developed common rules of probability

    Used Bayes Theorem for conditional

    probabilities

    Distinguished between discrete and continuous

    probability distributions

    Examined discrete probability distributions and

    their summary measures

  • See you

    in the next chapter