Conditional Distribution and Independence
Conditional Distribution and Independence
𝑃[𝑎 ≤ 𝑥 ≤ 𝑏] = ∫ 𝑓(𝑥) 𝑑𝑥
−∞
Let's now revisit this question that we can interpret probabilities as integrals. It is now
clear that for a continuous random variable X, we will always have Pr(X = x) = 0, since
the area under a single point of a curve is always zero. In other words, if X is a
continuous random variable, the probability that X is equal to a particular value will
always be zero. We again note this important difference between continuous and discrete
random variables.
Example#1
Let X be a random variable having the function
𝑐𝑥 0≤𝑥≤2
f(x) = {
0 𝑜𝑡ℎ𝑒𝑟𝑖𝑠𝑒
Find
(i) the value of the constant c so that function f(x) may be density function
(ii) 𝑷(𝟏/𝟐) ≤ 𝑿 ≤ 𝟑/𝟐)
(iii) 𝑷(𝑿 > 𝟏)
Solution
(i)
+∞
The function f(x) will be density function if 𝑓(𝑥) ≥ 0 and ∫−∞ 𝑓(𝑥) 𝑑𝑥 = 1
So
2 𝑥2 2 𝑐
∫0 𝑐𝑥 𝑑𝑥 = 𝑐 |
2 0
= 2 (4 − 0) = 1
1
c=2
Since c> 0, 𝑡ℎ𝑒 𝑓𝑖𝑟𝑠𝑡 𝑐𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛 𝑖𝑠 𝑠𝑎𝑡𝑖𝑠𝑓𝑖𝑒𝑑 . 𝑡ℎ𝑢𝑠 𝑡ℎ𝑒 𝑑𝑒𝑛𝑖𝑠𝑡𝑦 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑜𝑓 𝑋 𝑖𝑠
f(x) = 𝑥⁄2, 0 ≤ 𝑥 ≤ 2
(ii)
1 3/2 1 𝑥2 3/2 1 9 1 1
𝑃(1/2 ≤ 𝑥 ≤ 3/2) = 2 ∫1/2 𝑥 𝑑𝑥 = 2 . 𝑑𝑥 | = 4 (4 − 4) = 2
2 1/2
(iii)
1 2 1 𝑥2 2 1 3
𝑃(𝑋 > 1) = 2 ∫1 𝑥 𝑑𝑥 = 2 . | = 4 (4 − 1) = 4
2 1
Example#2
A continuous random variable X that can assume values between x=0 and x=2 has a density
function given by f(x)=x/2.Show that the area under the curve is equal to 1.
Solution
Do it Yourself.
Example#3
A continuous random variable X has a density Function f(x)= c(4-x) for x=1 to x=3, zero
otherwise find c.
Solution
Do it Yourself.
Example 4#
𝑥+1
A continuous random variable X has a density function 𝑓(𝑥) = for x=2 to x=4.
8
Find
(i) 𝑃(𝑋 < 3.5)
(ii) 𝑃(2.4 ≤ 𝑋 ≤ 3.5)
(iii) 𝑃(𝑋 = 1.5)
Solution
Do it Yourself.
Example#5
A continuous Random Variable has the function
𝑘𝑥 0≤𝑥≤2
𝑓(𝑥) {𝑘(4 − 𝑥) 2 ≤ 𝑥 ≤ 4
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Find the value of the constant k and also find out P(0.5 ≤ 𝑋 ≤ 2.5).
Solution
Do it Yourself.
Distribution Function For Continuous Random Variable
The Cumulative Distribution Function In the continuous Case
𝑥
F(x) = 𝑃(𝑋 ≤ 𝑥) = 𝑃(−∞ ≤ 𝑋 ≤ 𝑥) = ∫−∞ 𝑓(𝑡) 𝑑𝑡
𝑥
𝑑 𝐹(𝑥) 𝑑
= ∫ 𝑓(𝑡) 𝑑𝑡 = 𝑓(𝑥)
𝑑𝑥 𝑑𝑥
−∞
Example#1
Obtain the distribution function for the density function
𝑥
F(x) = 2 0≤x≤2
Solution
F(x) = 𝑃(𝑋 ≤ 𝑥) = 𝑐
𝑥
For any x such that −∞ < 𝑥 < 0, 𝐹(𝑥) = ∫−∞ 0 𝑑𝑥 = 0
0 𝑥𝑥 𝑥2
If 0 < 𝑥 ≤ 2 we have , 𝐹(𝑥) = ∫−∞ 0 𝑑𝑥 + ∫0 2 𝑑𝑥 = 4
0 2𝑥 ∞
And finally for x>2 we have F(x)= ∫−∞ 0 𝑑𝑥 + ∫0 2 𝑑𝑥 + ∫2 0 𝑑𝑥 = 1
Hence
0 𝑓𝑜𝑟 𝑥 < 0
𝑥2
F(x) ={ 𝑓𝑜𝑟 0 ≤ 𝑥 ≤ 2
1 𝑓𝑜𝑟 𝑥 > 2
𝑓(𝑥) = 𝑘𝑥
0
0≤𝑥≤2
𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
find (i) the value of constant (ii) P(X>1) (iii) Compute the distribution function F(x)
Solution
Do it Yourself
Example#3
A Continuous r.v X Has The d.f F(x) as Follows
0 𝑓𝑜𝑟 𝑥 < 0
2𝑥 2
F(x) = 𝑓𝑜𝑟 0 ≤ 𝑥 ≤ 1
5
3 2 𝑥2
− + (3𝑥 − ) 𝑓𝑜𝑟 1 ≤ 𝑥 ≤ 2
{ 5 5 2
= else where
= 0.75
Example#4
A r.v X is of Continuous type with p.d.f
f(x)= 2x , 0 𝑥 1
1
(iv) Find (i) 𝑃(𝑋 = 2)
1
(v) 𝑃 (𝑋 ≤ 2)
1
(vi) 𝑃(𝑋 > 4)
1 1
(vii) 𝑃 (4 ≤ 𝑋 < 2)
Solution
Example#5
If X is a continuous random variable with density function
𝑥
0≤𝑥≤4
𝑓(𝑥) = 8
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Find (i) the distribution function F(x)
(ii) find P(2≤X≤3) using the distribution function.
Solution
(i)
Do it Yourself
(ii)
The distribution function can be used to find
= 5/16 Ans
Example#6
A continuous r.v has the density function function
f(x)=1/a -a/2xa/2
Find the cumulative distribution function of X.
Solution
Do it Yourself
Example#7
Consider the density function
f(x){𝑘√𝑥 𝑓𝑜𝑟 0 ≤ 𝑥 ≤ 1
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
(i) Evaluate k
(ii) Find F(x) and use it to evaluate P(0.3 X 0.6)
Solution
Do it Yourself
Example#8
Consider the density function
𝑥2
−1≤𝑥 ≤2
𝑓(𝑥) = 3
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
(a) Verify that f(x) is a density function
(b) Find P(0 < x ≤1)
Solution
Do it Yourself
Example#9
A continuous r.v has the density function function
𝐾(3 − 𝑥 2 ) − 1 ≤ 𝑥 ≤ 1
𝑓(𝑥) =
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
(a) Determine k
1
(b) Use the value of F(x) to find P(𝑋 ≤ 2)
Solution
Do it yourself
Example#10
A r.v has the density function function
5(1 − 𝑦)4 0 ≤ 𝑦 ≤ 1
𝑓(𝑥) =
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
(a) Verify that above is valid density function.
(b) Use the value of F(x) to find P(𝑋 ≤ 0.1)
Solution
Do it Yourself
Mathematical Expectation
An important Concept in Probability and statistics is that of the mathematical expectation,
expected value or expectation of a random variable. The expected value of a random variable
tells where the center mass of the probability function is located, it gives a quick picture of the
long run “average” result when the experiment is performed over and over again.
We already discussed the mathematical expectation for discreate random variable.
So for a continuous random variable X with density function f(x), the expectation of X is
defined as
+∞
E(X) = ∫−∞ 𝑥𝑓(𝑥) 𝑑𝑥
The expectation of X is usually called the mean of X and is denoted by .Whenever several
random variables such As X,Y……… are being studied together, the symbol should be
subscripted to indicate the particular variable involved, that is E(X) = 𝜇𝑥 and E(Y) = 𝜇𝑦 .When
only one variable is being studied,the subscripts are often omitted.
If X is a continuous random variable with density function f(x), the expectation of the function
g(X) is given by
+∞
E(g(x)) = ∫−∞ 𝑔(𝑥)𝑓(𝑥) 𝑑𝑥
Example#1
The random variable X Has the density function given by
2𝑥
f(x) = 3 1≤ 𝑥 ≤ 2
: : : : :
If X and Y are continuous random variables, then joint density function F(x, y) is defined as
𝑥 𝑦
F(x, y) =P(X≤ 𝑥, 𝑌 ≤ 𝑦) =∫−∞ ∫−∞ 𝑓(𝑥, 𝑦) 𝑑𝑥 𝑑𝑦
Question#1
Two marbles are selected at random from a box containing 3 black ball,2 red and 3 green
marbles. If X is the number of black marbles and Y is the number of red marbles selected, then
find the joint probability function f(x, y) and also find P(X+Y≤1)
Solution
represents the probability that no black ,no red ,two green marbles are selected
x\y 0 1 2 P(X=x)=g(x)
0 3/28 6/28 1/28 10/28
1 9/28 6/28 0 15/28
2 3/28 0 0 3/28
P(Y=y)=h(y) 15/28 12/28 1/28 1
The above joint probabilities can also represented by the formula
or
6 5
∫ ∫ 𝑐(2𝑥 + 𝑦)𝑑𝑥𝑑𝑦 = 1
2 0
6
𝑦2 5
𝑐 ∫ (2𝑥𝑦 + )│ 𝑑𝑥 = 1
2 2 0
6
25
𝑐 ∫ (10𝑥 + )𝑑𝑥 = 1
2 2
10𝑥 2 25𝑥 6
𝑐( + │
2 2 2
210c=1
c=1/210
So the Joint density function of X and Y is
(2𝑥 + 𝑦)/210 2 < 𝑥 < 6,0 < 𝑦 < 5
{
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Marginal Distributions
From the joint probability distribution of the random variables X and Y, we can find the
probability distribution of X alone or that of Y alone. Such Probability distributions are called
marginal probability distributions.
If X and Y are discrete random variables and f(𝑥𝑖 , 𝑦𝑖 ) is their joint probability function, the
marginal probability functions of X and Y are defined respectively by
g(𝑥𝑖 ) = ∑𝑗 f(𝑥𝑖 , 𝑦𝑗 ) and h(𝑦𝑗 )=∑𝑖 f(𝑥𝑖 , 𝑦𝑗 )
Note that
This is simply the statement that the total probability of all the entries is 1
If X and Y are Continuous random variable f(x, y) is their joint density function, the marginal
density function of X and Y are defined respectively by
∞ ∞
g(x) = ∫−∞ 𝑓(𝑥, 𝑦) 𝑑𝑦 and h(y)=∫−∞ 𝑓(𝑥, 𝑦) 𝑑𝑥
g(0)=f(0,0)+f(0,1)+f(0,2)
=3/28 + 6/28 + 1/28
=10/28
= 9/28+ 6/28+0
= 15/28
g(2)=f(2,0)+f(2,1)+f(2,2)
= 3/28+0+0
= 3/28
x 0 1 2
g(x) 10/28 15/28 3/28
y 0 1 2
h(y) 15/28 12/28 1/28
Question#2
Find the marginal Density function of X and Y
Solution
Taking the data of Question#2
∞
g(x) = ∫−∞ 𝑓(𝑥, 𝑦) 𝑑𝑦
5
g(x) = ∫0 (2𝑥 + 𝑦)/210 𝑑𝑦
= 4x+5/84
So the marginal Density Function of X is
(4𝑥 + 5/84 2 𝑥 6
{
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
∞
h(y)=∫−∞ 𝑓(𝑥, 𝑦) 𝑑𝑥
6
h(y)=∫2 2𝑥 + 𝑦/210 𝑑𝑥
=16+2y/105
So the marginal Density Function of Y is
(16 + 2𝑦/105 0 𝑦 5
{
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Conditional Distribution
We have already defined the conditional probability of event A given event B has occurred as
𝑃(𝐴∩𝐵)
P(A/B) = 𝑃(𝐵)
Provided P(B) ≠ 0. If X and Y are discrete random variables and A and B are the events X=x
and Y=y, then above equation become
𝑃(𝑋=𝑥,𝑌=𝑦) 𝑓(𝑥,𝑦)
P(X=x / Y=y) = = ℎ(𝑦)
𝑃(𝑦=𝑦)
Where f(x,y) is the joint probability function of X and Y And h(y) is the marginal probability of
Y .Thus the conditional probability function of X given Y is Defined as
𝑓(𝑥,𝑦)
f(x/y) = ,h(y) ≠ 0
ℎ(𝑦)
Question#1
Find the conditional probability function of f(x/1)
Solution
Taking the data of Question#1
The conditional distribution of X given Y=y is given by
f(x|y)=f(x,y) / h(y) where as h(y)>0
𝑃(𝑋=𝑥,𝑌=1 𝑓(𝑥,1)
f(x/1)= P(X=x|Y=1)= = ℎ(1) 𝑤ℎ𝑒𝑟𝑒𝑎𝑠 𝑥 = 0,1,2
𝑃(𝑦=1)
𝑓(1,1) 6/28
f(1|1)= = 12/28 = 1/2
ℎ(1)
𝑓(2,1) 0
f(2|1)= = 12/28 = 0
ℎ(1)
Question#2
The conditional Density Function of X and Y is given
Solution
Taking the data of Question#2 of joint density function and marginal distribution
(i)
𝑓(𝑥,𝑦)
f(x/y) = ,h(y) > 0
ℎ(𝑦)
(2𝑥+𝑦)/210 2𝑥+𝑦
=(2𝑦+16)/105 = 2(2𝑦+16) 𝑤ℎ𝑒𝑟𝑒 𝑎𝑠 2 < 𝑥 < 6
(ii)
𝑓(𝑥,𝑦)
f(y/x)= 𝑔(𝑥) , 𝑔(𝑥) > 0
(2𝑥+𝑦)/210 2(2𝑥+𝑦)
= = 𝑤ℎ𝑒𝑟𝑒 𝑎𝑠 0 < 𝑦 < 5
(4𝑥+5)/84 5(4𝑥+5)
Independence of two random variable
Previously We noted that two events A and B are independent if P(A∩B)
=P(A)P(B) Using the same responsing, we can say that two random variables X and Y are
independent if the event that X assumes a specific value 𝑥𝑖 is independent of the event that Y
assumes a specific value 𝑦𝑗 no matter what specific values are selected .
More precisely the variables X and Y of the joint probability function f(x,y) are statistically
independent random variables if and only if the joint joint probability function can be expressed
as the product of the marginal probability functions that is if and only if f(x,y)=f(x)h(y)
Question#1
Variable X and Y are independent ?
Solution
Taking the data of Question#1
The variables X and Y independents if f(x,y)=g(x)h(y)
Let us consider the pair of (0,1)
f(0,1)=g(0)h(1)
From Part (i) of Question#1
f(0,1)=6/28
From Part (iii) of Question#1
g(0)=10/28
h(1)=12/28
g(0)h(1)=10/28+12/28
=15/28
So
f(0,1) ≠g(0)h(1) So X and Y are not independent
Few Questions Related to Continuous
Question#1
Given the following joint p.d.f
1
f(x,y) = 8 (6 − x − y), 0 ≤ x ≤ 2,2 ≤ y ≤ 4