Professional Documents
Culture Documents
2/136
Birleşik Olasılık Dağılımı
(Joint Probability Distributions)
Birleşik olasılık dağılımı kullanılarak X ve Y rassal
değişkenlerinin PMF hesaplanabilir:
𝑝𝑋 𝑥 = 𝑝𝑋,𝑌 𝑥, 𝑦 𝑎𝑛𝑑 𝑝𝑌 (𝑦) = 𝑝𝑋,𝑌 (𝑥, 𝑦)
𝑦 𝑥
3/136
Örnek:
Bir kutunun içinde 3 kırmızı, 4 beyaz ve 5 mavi top vardır. Rastgele 3 top
seçiliyor. X çekilen kırmızı ve Y çekilen beyaz top sayısı olsun. X ve Y’nin
birleşik olasılık kütle fonksiyonunu hesaplayınız.
p(i, j) = P{X = i,Y = j}.
5 4 5 4 5
3 10 1 2 40 2 1 30
𝑝 0,0 = 12 = , 𝑝 0,1 = 12 = , 𝑝 0,2 = 12 =
3
220 3
220 3
220
4 3 5 3 4 5
3 4 1 2 30 1 1 1 60
𝑝 0,3 = 12 = , 𝑝 1,0 = 12 = , 𝑝 1,1 = 12 =
3
220 3
220 3
220
3 4 3 5 3 4
1 2 18 2 1 15 2 1 12
𝑝 1,2 = 12 = , 𝑝 2,0 = 12 = , 𝑝 2,1 = 12 =
3
220 3
220 3
220
3
3 1
𝑝 3,0 = 12 =
3
220
4/136
Örnek: Marjinal PMF
X ve Y’nin birleşik PMF aşağıda verilmiş olsun. X ve Y’nin
marjinal PMF’lerini hesaplayınız.
5/136
Örnek: Marjinal PMF
The joint PMF is represented by a table, where the number in each
square (x, y) gives the value of pX,Y (x, y).
To calculate the marginal PMF pX(x) for a given value of x, we add
the numbers in the column corresponding to x.
◼ For example pX(2) = 8/20.
To calculate the marginal PMF pY (y) for a given value of y, we add
the numbers in the row corresponding to y.
◼ For example pY (2) = 5/20.
6/136
Örnek:
Suppose that 15 percent of the families in a certain community have
no children, 20 percent have 1 child, 35 percent have 2 children,
and 30 percent have 3. Suppose further that in each family each
child is equally likely (independently) to be a boy or a girl. If a
family is chosen at random from this community, then B is the
random variable that shows number of boys, and G is the random
variable that shows number of girls. Calculate the joint probability
mass function such that P(B=b, G=g).
Solution: P{B = 0,G = 0} = P{no children} = .15
P{B = 0,G = 1} = P{1 girl and total of 1 child}
1
= P{1 child}P{1 girl|1 child} = 0.20 ∗
2
P{B = 0,G = 2} = P{2 girls and total of 2 children}
12
= P{2 children}P{2 girls|2 children} = 0.35 ∗
2
7/136
8/136
Çoklu Rassal Değişkenlerin Fonksiyonu
Z = g(X, Y ) X ve Y’nin fonksiyonu olan bir rassal değişken olsun.
Z’nin olasılk kütle fonksiyonu pX,Y kullanılarak hesaplanabilir:
𝑝𝑍 𝑧 = 𝑝𝑋,𝑌 𝑥, 𝑦
{(𝑥,𝑦)|𝑔 𝑥,𝑦 =𝑧}
Beklenen Değer:
𝐸[𝑔(𝑥, 𝑦)] 𝑔(𝑥, 𝑦)𝑝𝑋,𝑌 𝑥, 𝑦
𝑥,𝑦
9/136
Örnek:
X ve Y rassal değişkenlerinin birleşik olasılık kütle fonksiyonu
yukardaki tabloda verilmiş olsun ve Z = X + 2Y. Z rassal
değişkeninin PMF ve beklenen değerini hesaplayınız.
The PMF of Z can be calculated using the formula
𝑝𝑍 𝑧 = 𝑝𝑋,𝑌 𝑥, 𝑦
{(𝑥,𝑦)|𝑥+2𝑦=𝑧}
We have, using the PMF given in the figure above:
1 1 2 2 4
𝑝𝑍 3 = ,𝑝 4 = , 𝑝𝑍 5 = , 𝑝𝑍 6 = , 𝑝𝑍 7 = ,
20 𝑍 20 20 20 20
3 3 2 1 1
𝑝𝑍 8 = , 𝑝𝑍 9 = , 𝑝𝑍 10 = , 𝑝𝑍 11 = , 𝑝𝑍 12 =
20 20 20 20 20
10/136
Çözüm 2: E[Z] beklenen değer özellikleri kullanılarak
aşağıdaki gibi hesaplanabilir:
E [Z] = E [X] + 2E[Y]
From the marginal PMFs of X and Y:
3 6 8 3 51
𝐸 𝑋 =1∗ +2∗ +3∗ +4∗ =
20 20 20 20 20
3 7 7 3 50
𝐸 𝑌 =1∗ +2∗ +3∗ +4∗ =
20 20 20 20 20
51 50
𝐸𝑍 = +2∗ = 7.55
20 20
11/136
İkiden Fazla Rassal Değişken için PMF
X, Y , ve Z’nin birleşik olasılık fonksiyonu:
pX,Y,Z (x, y,z) = P(X = x, Y = y, Z=z) (bütün olası (x, y, z)
değerleri için)
PMF aşağıdaki gibi hesaplanabilir:
𝑝𝑋,𝑌 𝑥, 𝑦 = 𝑝𝑋,𝑌,𝑍 𝑥, 𝑦, 𝑧
𝑧
𝑝𝑋 𝑥 = 𝑝𝑋,𝑌,𝑍 𝑥, 𝑦, 𝑧
𝑦 𝑧
Beklenen değer:
𝐸[𝑔(𝑥, 𝑦, 𝑧)] 𝑔(𝑥, 𝑦, 𝑧)𝑝𝑋,𝑌,𝑍 𝑥, 𝑦, 𝑧
𝑥,𝑦,𝑧
12/136
Özel Durum:
g: X, Y, Z’nin fonksiyonu olsun:
E[aX + bY + cZ + d] = aE[X] + bE[Y ] + cE[Z] + d
Bu kural genellenebilir:
E[a1X1+a2X2+…+anXn] = a1E[X1]+a2E[X2]+…+ anE[Xn]
13/136
Örnek:
Olasılık teorisi dersinde 300 öğrenci vardır. Her bir
öğrencinin A alma olasılığı birbirinden bağımsız olarak
1/3’tür. A alan öğrencilerin beklenen değeri nedir:
Çözüm 1:
A alan öğrencilerin sayısı (300,1/3) parametreli X binom
rassal değişkenidir
E[X]=np=300*1/3=100
14/136
Çözüm 2:
1 öğ𝑟𝑒𝑛𝑐𝑖 𝐴 𝑎𝑙𝚤𝑟𝑠𝑎,
𝑋𝑖 = ቊ
0 𝑑𝑖ğ𝑒𝑟 𝑑𝑢𝑟𝑢𝑚𝑑𝑎
X1,X2, . . . , Xn Bernouli rassal değişkenidir. p = 1/3 ve p(1 − p) = (1/3)(2/3) =
2/9.
X = X1+X2+…+Xn toplamı A alan öğrencilerin sayısını verir.
X : n bağımsız denemedeki “başarı” sayısını verdiği için n ve p.parametreli
Binom rassal değişkenidir.
Fakat, E[X]’i hesaplarken X’in Xi rassal değişkenlerinin doğrusal fonksiyonu
olduğu için beklenen değer özelliği kullanılabilir:
300 300
1 1
𝐸 𝑋 = 𝐸 𝑋𝑖 = = 300 ∗ = 100
3 3
𝑖=1 𝑖=1
300 300
𝐆𝐞𝐧𝐞𝐥 𝐨𝐥𝐚𝐫𝐚𝐤: 𝐸 𝑋 = 𝐸 𝑋𝑖 = 𝑝 = 𝑛𝑝
𝑖=1 𝑖=1
15/136
Örnek: Şapka Problemi
n kişinin katıldığı bir partide herkes şapkasını bir kutuya koyuyor ve
rastgele bir şekilde tekrar bir şapka alıyor. X kendi şapkasını alan
kişi sayısını gösteren rassal değişken olduğuna göre E(X) değerini
hesaplayınız.
Çözüm:
1 i 𝑘𝑖ş𝑖𝑠𝑖 𝑘𝑒𝑛𝑑𝑖 ş𝑎𝑝𝑘𝑎𝑠𝚤𝑛𝚤 𝑠𝑒ç𝑒𝑟𝑠𝑒,
Let 𝑋𝑖 = ቊ
0 𝑑𝑖ğ𝑒𝑟 𝑑𝑢𝑟𝑢𝑚𝑑𝑎
P(𝑋𝑖 =1)=1/n ve P(𝑋𝑖 = 0)=1-1/n
1 1 1
𝐸 𝑋𝑖 = 1 ∗ + 0 ∗ 1 − =
n n n
Beklenen değeri hesaplanmak istenen: X = X1+X2+…+Xn
1
E[X] = E[X1] + E[X2] + ・ ・ ・ + E[Xn] = n = 1
n
16/136
Örnek:
Suppose there are 25 different types of coupons and suppose that
each time one obtains a coupon, it is equally likely to be any one of
the 25 types. Compute the expected number of different types that
are contained in a set of 10 coupons.
Let X denote the number of different types in the set of 10 coupons.
We compute E[X] by using the representation X = X1 + · · · + X25
1 if at least one type i coupon is in the set of 10
where 𝑋𝑖 = ቊ
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
E[Xi] = P{Xi = 1}= P{at least one type i coupon is in the set of 10}
2410
= 1 − P{no type i coupons are in the set of 10}=1 −
25
2410
Thus: E[X] = E[X1] + · · · + E[X25] = 25(1 − )
25
17/136
Examples:
A city's temperature is modeled as a random variable with mean
and standard deviation both equal to 10 degrees Celsius. A day is
described as "normal" if the temperature during that day ranges
within one standard deviation from the mean. What would be the
temperature range for a normal day if temperature were expressed
in degrees Fahrenheit?
A stock market trader buys 100 shares of stock A and 200 shares of
stock B. Let X and Y be the price changes of A and B respectively
over a certain time period and assume that the joint PMF of X and
Y is uniform over the set of integer x and y satisfying -2 ≤ x ≤ 4,
-1≤ y- x ≤ 1.
(a) Find the marginal PMFs and the means of X and Y.
(b) Find the mean of the trader's profit.
18/136
Koşullama
Bir A olayının gerçekleştiği bilindiği durumda olasılık modelinde
normal olasılıklar yerine koşullu olasılıklar kullanılabilir.
Koşullu olasılık konusunu daha önce ele almıştık:
◼ Normal olasılıklar gibi olasılık aksiyomlarını sağlıyorlardı. Farkları ise yeni
bir örnek uzayda ele alınmalarıydı
Şimdi ise olasılık kütle fonksiyonlarını bir olayın gerçekleşmesine
koşullayarak hesaplayacağız.
19/136
Bir Rassal Değişkeni Bir Olaya Koşullama
X rassal değişkeninin koşullu PMF, A olayı gerçekleştiği zaman
ve P(A) > 0:
𝑃({𝑋 = 𝑥 ∩ 𝐴})
𝑝𝑋|A 𝑥 = 𝑃 𝑋 = 𝑥|A =
𝑃(𝐴)
Örnek: X bir zar atıldığında gelen sayı ve A gelen sayının çift
olması olsun. 𝑝𝑋\A 𝑥 =?
𝑝𝑋|A 𝑥 = 𝑃 𝑋 = 𝑥|𝑎𝑡𝚤ş ç𝑖𝑓𝑡
𝑃({𝑋 = 𝑣𝑒 𝑋 ç𝑖𝑓𝑡})
=
𝑃(𝑎𝑡𝚤ş ç𝑖𝑓𝑡)
1
𝑖𝑓 𝑥 = 2,4,6
𝑝𝑋|A 𝑥 = ቐ 3
0 𝑑𝑖ğ𝑒𝑟 𝑑𝑢𝑟𝑢𝑚𝑙𝑎𝑟𝑑𝑎
20/136
Bir Rassal Değişkeni Bir Olaya Koşullama
Koşullu olasılık kütle fonksiyonu koşullu olmayana
benzer bir şekilde hesaplanır:
◼ pX|A(x) hesaplamak için, we add the probabilities of the
outcomes that give rise to X = x olasılıklarını ve A olayının
içinde olan olasılıkları toplayıp, toplam değerini P(A)’ya bölüp
normalize ediyoruz.
21/136
Bir Rassal Değişkeni Başka Bir Rassal Değişkene Koşullama
22/136
Bir Rassal Değişkeni Başka Bir Rassal Değişkene
Koşullama
Koşullu olasılık formülünden:
𝑃(𝑋 = 𝑥, 𝑌 = 𝑦) 𝑝𝑋,𝑌 𝑥, y
𝑝𝑋|𝑌 𝑥|y = =
𝑃(𝑌 = 𝑦) 𝑝𝑌 (𝑦)
pY (y) > 0 olan bir y değerini sabitleyelim
◼ pX|Y (x | y) fonksiyonu x’in bir fonksiyonu olsun.
◼ Bu fonksiyon bir olasılık kütle fonksiyonudur (PMF), çünkü:
Herbir olası x değeri için negatif olmayan bir sayı vermekte ve toplamı
1 olmaktadır.
◼ Bu fonksiyonun şekli pX,Y (x, y) ile aynıdır. Tek farklılık, pY (y)
ile normalize edilmesidir.
𝑝𝑋|Y 𝑥|y = 1
𝑥
23/136
Bir Rassal Değişkeni Başka Bir Rassal Değişkene
Koşullama
24/136
Bir Rassal Değişkeni Başka Bir Rassal Değişkene
Koşullama
25/136
Example: Professor May B. Right
Professor May B. Right often has her facts wrong, and
answers each of her students’ questions incorrectly with
probability 1/4, independently of other questions. In each
lecture May is asked 0, 1, or 2 questions with equal
probability 1/3. Let X and Y be the number of questions
May is asked and the number of questions she answers
wrong in a given lecture, respectively.
First, construct joint PMF of pX,Y (x, y) :
◼ Then, we need to calculate all the probabilities
P(X = x, Y = y) for all combinations of values of x and y.
26/136
Example:Professor May B. Right
This can be done by using a sequential description of the
experiment and the multiplication rule:
pX,Y (x, y) = pY (y)pX|Y (x | y),
For example, for the case where one question is asked
and is answered wrong, we have:
1 1 1
pX,Y (1, 1) = pX(x)pY |X (y | x) = ∗ =
4 3 12
27/136
Example:Professor May B. Right
28/136
Example: Independent rolls of a 6-sided die
Consider four independent rolls of a 6-sided die. Let X be the
number of 1’s and let Y be the number of 2’s obtained. What is the
joint PMF of X and Y ?
The marginal PMF pY is given by the binomial formula
𝑦 4−𝑦
4 1 5
𝑝𝑌 𝑦 = y= 0, 1, . . . , 4.
𝑦 6 6
To compute the conditional PMF pX|Y , note that given that Y = y, X
is the number of 1’s in the remaining 4 − y rolls, each of which
can take the 5 values 1, 3, 4, 5, 6 with equal probability 1/5.
Thus, the conditional PMF pX|Y is binomial with parameters 4 − y
and p = 1/5:
4−𝑦 1 𝑥 4 4−𝑦−𝑥
pX |Y (x | y) = 𝑥
for all x and y such that
5 5
x, y = 0, 1, . . . , 4, and 0 ≤ x + y ≤ 4.
29/136
Example: Independent rolls of a 6-sided die
The joint PMF is now given by
pX,Y (x, y) = pY (y)pX|Y (x | y)
30/136