3metode Simulasi
3metode Simulasi
𝑓 𝑥
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x
6 Contoh 1 (lanjutan) 𝑥
𝑓(𝑥) = 2
0≤𝑥≤2
0 selainnya
1 untuk 𝑥 > 2
r
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
x
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
10 Pembangkitan dengan Excel untuk Contoh 1
0.4
0.3
0.2 f(x)
0.1
0
0 1 2 3 4 5 6
1
𝑥−2 , 2≤𝑥 ≤3
15 Contoh 2 (lanjutan) 𝑓(𝑥) = 1
2
𝑥
2− , 3≤𝑥 ≤6
2 3
0, selainnya
𝐹 𝑥 = 𝑓 𝑥 𝑑𝑥
1 1 𝑥 1
𝐹 𝑥 = 𝑥 − 2 𝑑𝑥 + 2− 𝑑𝑥 = − 𝑥 − 12𝑥 + 24
2 2 3 12
16 Contoh 2 (lanjutan)
Contoh 2
1
17 𝑥−2 , 2≤𝑥≤3
𝐹(𝑥) = 4
(lanjutan)
1
− 𝑥 − 12𝑥 + 24 , 3 ≤ 𝑥 ≤ 6
12
1, 𝑥>6
Langkah 2 Membangkitan variabel acak r dari U(0,1)
Langkah 3: Menentukan variabel acak sebagai solusi dari inverse
fungsi sebaran kumulatif
Fungsi inverse sebaran peluang kumulatif juga dibuat berdasarkan
interval x pada fungsi
F(x)
1
0.75
1
𝑥=3⇒𝐹 3 = 3−2 = 0.25 0.5
F(x)
4
0.25
0
0 1 2 3 4 5 6
18 Contoh 2 (lanjutan)
0, 𝑥<2 1
𝐹 2 = 2−2 =0
1 4
𝑥−2 , 2≤𝑥≤3
𝐹(𝑥) = 4 1
1 𝐹 3 = 3 − 2 = 0.25
− 𝑥 − 12𝑥 + 24 , 3 ≤ 𝑥 ≤ 6 4
12 1
1, 𝑥>6 𝐹 3 =− 3 − 12 3 + 24 = 0.25
12
1
𝐹 6 =− 6 − 12 6 + 24 =1
12
F(x) adalah r
Selang fungsi berdasarkan nilai r
1
𝑥 − 2 = 𝑟, untuk 0 ≤ 𝑟 < 0.25
4
1
− 𝑥 − 12𝑥 + 24 = 𝑟, untuk 0.25 ≤ 𝑟 ≤ 1
12
1
𝑥 − 2 = 𝑟, untuk 0 ≤ 𝑟 < 0.25
19 4
1
− 𝑥 − 12𝑥 + 24 = 𝑟, untuk 0.25 ≤ 𝑟 ≤ 1
12
1
𝑥−2 = 𝑟, untuk 0 ≤ 𝑟 < 0.25
4
1
− 𝑥 − 12𝑥 + 24 = 𝑟, untuk 0.25 ≤ 𝑟 ≤ 1
12
dengan pengaturan:
Karena maka
Sehingga untuk mempermudah perhitungan, dapat diganti
dengan