0% found this document useful (0 votes)
13 views15 pages

Lecture

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 15

Simulation and Modeling

Lecture ( 7 )
Random Variables
Random Variables

• Random Variables

• A random variable is a numerical quantity that is generated by a random experiment.

• A random variable is a number generated by a random experiment.

• We will denote random variables by capital letters, such as X or Z, and the actual values that they can
take by lowercase letters, such as x and z.

• Example:-

Experiment Number X Possible Values of X


Roll two fair dice Sum of the number of dots on the top faces 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Random Variables
Types of Random Variable

there are two random variables, such as:

 Discrete Random Variable

 Continuous Random Variable

Discrete Random Variables

A random variable is called discrete if it has either a finite or a countable number of possible values.

A discrete random variable can take only a finite number of distinct values such as 0, 1, 2, 3, 4, … and
so on.

 A random variable is a number generated by a random experiment.

 A random variable is called discrete if its possible values form a finite or countable set.

 A random variable is called continuous if its possible values contain a whole interval of
numbers.
Discrete Random Variables

Examples of a Discrete Random Variable

 A very basic example about discrete random variables is a die that has six faces and equal
chances of any face coming on top.

 random variable can take any of the following discrete values from 1 to 6.

 Mathematically the collection of values that a random variable takes is denoted as a set.

 let the random variable be X.

 Thus, X = {1, 2, 3, 4, 5, 6}
Discrete Random Variables

Other examples of discrete random variables. Some of these are as follows:

 The number of arrivals at an emergency room between midnight and 6:00 a.m.

 The number of boys in a randomly selected three-child family.

 The number of vehicles owned by a randomly selected household.

 The number of cars that pass through a given intersection in an hour.

 The number of people in a household.

 The number of accidents that occur at a given intersection in a week.

 The number of red balls drawn in a sample of 10 balls taken from a jar containing both red and
blue balls.

 The number of goals scored in a soccer match.


Probability Distributions for Discrete Random Variables

The probability distribution of a discrete random variable X is a list of each possible value
of X together with the probability that X takes that value in one trial of the experiment.

The probabilities in the probability distribution of a random variable X must satisfy the following two
conditions:

 Each probability P(X) must be between 0 and 1 : 0 < P(x) < 1

 The sum of all the probabilities is σ 𝑃 𝑥 = 1


Example:-
Let X be a random variable that can take only three values ( 1 , 2 and 3 ), each with Probability .
Then, 1/3 is a discrete variable. Its support is
Probability Distributions for Discrete Random Variables

Let The sample space S = { 1 , 2 , 3 }

1
𝑖𝑓 𝑥 ∈ 𝑆
𝑃 𝑥 = ቐ3
0 𝑖𝑓 𝑥 ∉ 𝑆

For example P(2) = 1/3 2 ⋲ S , P(4 ) = 0 4 ∉ 𝑆

Example:- A fair coin is tossed twice. Let X be the number of heads that are observed.

a. Construct the probability distribution of X.

b. Find the probability that at least one head is observed.


Probability Distributions for Discrete Random Variables
• Solution:-

a. The possible values that X can take are 0, 1, and 2. Each of these numbers corresponds to an
event in the sample space

S= { HH , HT , TH , TT }

of equally likely outcomes for this experiment:

X = 0 to { TT }

X = 1 to { HT , TH }

X = 2 to { HH }

The probability of each of these events, hence of the corresponding value of X, can be found
simply by counting, to give x 0 1 2
P(x) 0.25 0.5 0.2

This table is the probability distribution of X.


Probability Distributions for Discrete Random Variables

• Solution:-

b. Find the probability that at least one head is observed.

the sample space

S= { HH , HT , TH , TT }

At least one head” is the event X ≥ 1, which is the union of the mutually exclusive events X = 1
and X = 2. Thus

X = { HT , TH ,HH}

P(x ≥ 1) = P( 1 ) + P ( 2 )  0.25 + 0.50  0.75

x 0 1 2
P(x) 0.25 0.5 0.25
Mean And Variance Of Discrete Random Variable

The mean and variance of a discrete random variable are helpful in having a deeper understanding
of discrete random variables.

The mean (also called the expected value) of a discrete random variable X is the number.

The formulas for the mean of a random variable are given below:

Mean of a Discrete Random Variable:

𝐸 𝑋 = 𝜇 = ෍ 𝑥 𝑃(𝑥 )

Example:- Find the mean of the discrete random variable X whose probability distribution is

X -2 1 2 3.5
P(x) 0.21 0.34 0.24 0.21
Mean And Variance Of Discrete Random Variable

Solution:-

The formulas for the mean of a random variable are given below

𝐸 𝑋 = 𝜇 = ෍ 𝑥 𝑃(𝑥 )

X -2 1 2 3.5
P(x) 0.21 0.34 0.24 0.21

𝐸 𝑋 = 𝜇 = -2 * 0.21 + 1 * 0.34 + 2 * 0.24 + 3.5 * 0.21  1.135


Mean And Variance Of Discrete Random Variable

The variance, σ2, of a discrete random variable X is the number


𝜎 2 = ෍(𝑥 − 𝜇 )2 𝑝(𝑥)

Example:- Find the variance of the discrete random variable X whose probability distribution is

X -2 1 2 3.5
P(x) 0.21 0.34 0.24 0.21
Types of Discrete Random Variables

There are various types of Discrete Random Variables, some of which are as follows:
 Binomial Random Variable

 Geometric Random Variable

 Bernoulli Random Variable

 Poisson Random Variable


Conclusion and considerations
Probability as Used in Simulation

Random Variables
A random variable is a numerical quantity that is generated by a random experiment.
A random variable is a number generated by a random experiment.
Types of Random Variable
there are two random variables, such as:
Discrete Random Variable
Continuous Random Variable
A random variable is a number generated by a random experiment.
A random variable is called discrete if its possible values form a finite or countable
set.
A random variable is called continuous if its possible values contain a whole interval
of numbers.
The probability distribution of a discrete random variable X is a list of each
possible value of X together with the probability that X takes that value in one trial of
the experiment.
Discrete Random Variables
Continuous Random Variable

A random variable is called continuous if its possible values contain a whole interval of numbers.

it is said to be a continuous random variable. When X takes any value in a given interval (a, b), it
is said to be a continuous random variable in that interval.

You might also like