0% found this document useful (0 votes)
10 views4 pages

PRCCCCC

Uploaded by

neeru.kum22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

PRCCCCC

Uploaded by

neeru.kum22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EXPERIMENT -6

Aim :- Calculate expected value and variance in the context of single random variable.
Description
There are two main types of random variables:
1. Discrete Random Variable: Takes on a countable number of distinct values. For
example, the number of heads in a series of coin flips.
a) Expected Value (𝑬[𝑿]): is a measure of the central tendency of a random variable. It
represents mean of the possible values that a random variable can take, weighted by their
probabilities. It's calculated by summing the products of each value and its probability:

𝐸[𝑋] = 𝑥 𝑃(𝑋 = 𝑥 )

where 𝑥 are the possible values of the random variable 𝑋 and 𝑃(𝑋 = 𝑥 ) is the probability of 𝑋
taking the value 𝑥 .
b) Variance (Var(𝑿)): measures the spread or dispersion of a random variable's possible
values around the expected value. It quantifies how much the values of the random variable
differ from the expected value. A higher variance indicates greater variability in the values.
Variance is calculated as the expected value of the squared deviation of a random variable
from its mean:

𝑉𝑎𝑟(𝑋) = (𝑥 − 𝐸[𝑋]) 𝑃(𝑋 = 𝑥 )

OR
𝑉𝑎𝑟(𝑋) = 𝐸[𝑋 ] − (𝐸[𝑋])
where

𝐸[𝑋 ] = 𝑥 𝑃(𝑋 = 𝑥 )

Also,
2. Continuous Random Variable: Takes on an infinite number of possible values within
a given range. For example, the height of individuals in a population.
a) Expected Value (𝑬[𝑿]): It's calculated by integrating the product of the value and its
probability density function over the entire range.

𝐸[𝑋] = 𝑥 𝑓(𝑥 ) 𝑑𝑥

where 𝑓(𝑥) is the probability density function (PDF) of the random variable 𝑋.
b) Variance (Var(𝑿)):

𝑉𝑎𝑟(𝑋) = (𝑥 − 𝐸[𝑋]) 𝑓(𝑥) 𝑑𝑥

OR
𝑉𝑎𝑟(𝑋) = 𝐸[𝑋 ] − (𝐸[𝑋])
where

𝐸[𝑋 ] = 𝑥 𝑓 (𝑥 ) 𝑑𝑥

Commands and Calculations in ‘R’

 For Discrete Random Variable

Suppose we have a discrete random variable with possible values and their associated
probabilities.

Example 1:

Let 𝑋 be a discrete random variable with the following values and probabilities:

 𝑥 = 1, 𝑃(𝑋 = 1) = 0.2
 𝑥 = 2, 𝑃(𝑋 = 2) = 0.5
 𝑥 = 3, 𝑃(𝑋 = 3) = 0.3

Input

Output

Example 2: A class XII has 20 students whose marks (out of 30) are 14, 17, 25, 14, 21, 17, 17,
19, 18, 26, 18, 17, 17, 26, 19, 21, 21, 25, 14 and 19 years. If random variable X denotes the
marks of a selected student given that the probability of each student to be selected is equally
likely.

a) Prepare the probability distribution of the random variable X.


b) Find mean, variance and standard deviation of X.

Solution: a)

Input

Output

b) Input

Output
 For Continuous Random Variable

Example 1: Consider a continuous random variable 𝑿 with probability density function:


2𝑥, 0≤𝑥≤1
𝑓(𝑥) = 2(2 − 𝑥), 1 < 𝑥 ≤ 2
0, otherwise

Find expected value and variance of 𝑋.

Input

Output

Practice Questions
Ques1. Consider a discrete random variable 𝑋 with the following possible values and their
corresponding probabilities:
 Values: 0, 3, 5, 10
 Probabilities: 0.2, 0.1, 0.1, 0.6
Calculate the expected value 𝐸[𝑋] and variance 𝑉𝑎𝑟[𝑋] of the random variable.

Ques 2. Consider 𝑋 as a random variable representing the outcome of rolling a fair six-sided
die. Calculate the expected value and variance of the random variable.

Ques 3. Consider a continuous random variable 𝑋 with probability density function:


6𝑥 (1 − 𝑥 ), 0 < 𝑥 < 1
𝑓 (𝑥 ) =
0, otherwise

Find expected value and variance of 𝑋.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy