0% found this document useful (0 votes)
8 views27 pages

Random Variables in Mathematical or Applied Statisics

let's dive through the basics of random variables in statistics, everything you need to know to solve every problem related to RV

Uploaded by

lwazisom55
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)
8 views27 pages

Random Variables in Mathematical or Applied Statisics

let's dive through the basics of random variables in statistics, everything you need to know to solve every problem related to RV

Uploaded by

lwazisom55
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/ 27

CHAPTER 2

Random Variable

A random variable is essentially a random number. Random variables are upper case letters
and they can take on various values depending on the random outcome of an experiment. If
the random variable is given by a capital letter, the corresponding small letter denotes the
various values that the random variable can take on. Because the random variable depend on
the random outcomes of the experiment given in , the random variable is a function of .

2.1 Discrete Random Variable

Discreet random variable: A random variable X is discreet if it can take on a finite (or infinite
and countable) number of values, usually integers.

Events are often expressed as random variables in statistic, and we have to calculate
probabilities for these events (probability of the random variable).

Probability mass function: Suppose a random variable X can take on the values
(these values are known as mass points). The probability mass function (or frequency
function) of X is defined as the function such that: or
.

Properties of p: i)

ii) ∑

The probability mass function (frequency function) can be represented by a bar chart. The
height of each bar equals the probability of the corresponding value of the random variable.

Example 1

A coin is tossed 3 times.

Sample space:

i) Let the random variable denote the number of heads.

1
The values (mass points) that the random variable can take on is .

The probability mass function is then:

The probability mass function (frequency function) is represented by a bar chart in


Rice, p.36.

ii) Let the random variable Y denote the number of tails.

The values (mass points) that the random variable can take on is .

The probability mass function is then:

iii) Let the random variable Z denote the number of heads minus the number of tails.

The values (mass points) that the random variable can take on is .

The probability mass function is then:

2
Example 2

Two socks are selected at random from a drawer containing five brown socks and three
green socks. Let X be the random variable where X is the number of brown socks selected.

The values (mass points) that the random variable can take on is .

The probability mass function is then:

Example 3

Check whether the following function:

can serve as the frequency function of a discreet random variable.

and ∑

Thus, the given function can serve as the frequency function of the random variable with
values {1,2,3,4,5}.

Cumulative distribution function (distribution function)

There are many problems in which it is of interest to know the probability that the value of a
random variable is less than or equal to some real numbers.

Suppose X is a discreet random variable. Define a and b such that , then


∑ .

3
Example 4 (continuation of Example 1)

Find

Cumulative distribution function (cdf): The cumulative distribution function of a random


variable X is defined as: .

Properties of the cdf: i)

ii) and as

( )

iii) is non-decreasing (it always accumulates)

Example 5 (continuation of Example 1)

Find the cdf of the total number of heads obtained in three tosses of a balanced coin.

Observe that this distribution is defined not only for the values taken on by the given
random variables, but for all real numbers. For example and .
Although the probabilities of getting “at most 1.7 heads” or “at most 100 heads” in three
tosses, may not be of real significance.

The cdf is shown graphically in Rice, p. 37.

4
Example 6 (continuation of Example 2)

Find the cdf of the random variable X in the example about the socks.

The distribution function can also be used to obtain the mass function (frequency function).
The mass points are those points where the distribution “jumps” and the values of the mass
function at the respective mass points are equal the size of these “jumps”.

Example 7 (continuation of Example 1)

5
Example 8

Find the probability mass function from the following cdf:

Note: There is a one-to-one relationship between . From we can


determine and vice versa.

Example 9

Consider the following frequency function:

Since ∑ , therefore therefore .

Next we look at a number of important discrete random variables.

2.1.1 Bernoulli Random Variable

A Bernoulli random variable X only takes on values of 0 or 1 with the following probabilities:

The frequency function of X is:

6
2.1.2 Binomial Random Variable

Bernoulli trail: An experiment where only one of two outcomes are possible, a “success” and
a “failure”.

Assume now n repeated independent Bernoulli trails. Let denotes the number of
successes obtained from these n Bernoulli trails. is then said to be a binomial random
variable.

Properties of a binomial random variable:

i) The experiment consists of independent and identical trails.

ii) Each trail results in one of two possible outcomes: success and failure.

iii) The probability of a success for a single trail is and the probability of a failure is

Example 10

Calculate the probability of getting 5 heads in 12 flips of a coin. Is a binomial random


variable?

Binomial probability mass function: Let denote the probability of success in a Bernoulli
trial. If is a binomial random variable, then the mass function of is given by:

( )
{

Proof: Consider one possible realization of success (and thus failures). The
probability of this realization is (from independence of Bernoulli trials and the multiplicative
rule):

1(s) 2(s) 3(f) 4(f) - - - - - - n-1(s) n(f)

The number of these realizations is ( ) seeing as there are ( ) ways of choosing success
from repeated trials. Therefore

( )

7
Properties of the binomial probability mass function:

i)

ii) ∑

Example 11

i) Find the probability of getting 5 heads in 12 flips of a coin.

( ) ( )( ) ( )

ii) Find the probability of getting less than 2 heads in 12 flips of a coin.

( )( ) ( ) ( )( ) ( )

iii) Find the probability of getting 2 or more heads in 12 flips of a coin.

Or

[ ]

Example 12

i) Find the probability that 7 of 10 persons will recover from a tropical disease if we can
assume independence and the probability is 0.8 that any one of them will recover
from the disease.

( )

ii) Find the probability that at least 8 of 10 persons will recover from a tropical disease.

( ) ( )

( )

See Examples A and B (Rice, p. 38 - 39).

8
Note: Let be independent Bernoulli random variables with .
Then is a binomial random variable.

2.1.3 Geometric Random Variable

Assume repeated independent Bernoulli trials, where is the probability of success at each
trail. Let denote the number of repetitions until the first success is obtained. is called a
geometric random variable.

Geometric probability mass function:

1(f) 2(f) 3(f) 4(f) - - - - - - k-1(f) k(s)

Therefore:

Properties of a geometric mass function:

i)

ii) ∑

Example 13

If the probability is 0.75 that a applicant for a driver’s license will pass the road test on any
given try, what is the probability that an applicant will finaly pass the test of the 4th try?

Example 14

If the probability that a person exhibits side-effects as a result of a certain new drug is 0.02.
What is the probability that the fith person in a study of people that take the drug is the first
person to exhibit the effect?

Let be the number of people who take the medication until the first person exhibits side-
effects. Then is a geometric random variable with , and

See Example A (Rice, p. 40).

9
Negative Binomial random variable

The negative binomial distribution is a generalization of the geometric distribution. Suppose


that repeated independent Bernoulli trails are exercised (with probability of success) until
successes are obtained. If is the number of trials until r successes are obtained then is
a negative binomial random variable.

Negative Binomial probability mass function:

( )

1 2 3 4 - -- - - - - - k-1 k

The probability to get successes:

The probability to get failures:

The last trail is a success, and the remaining successes can be obtained from
repetitions in ( ) ways.

See Example B (Rice, p. 41).

Example 15

The probability is 0.4 that a child exposed to a certain disease will catch it. What is the
probability that the tenth child exposed to the disease will be the third to catch it?

( ) ( )

Example 16

If a coin is tossed, what is the probability that with the 4 th toss we have observed 2 heads?

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )

2.1.4 Hypergeometric random variable

10
Suppose a container holds balls, where of them are black and are white. Draw
balls simultaneously (without replacement). Let be the number of black balls drawn in this
way. We say that is a hypergeometric random variable with parameters and

( )( )
( )
.

Similar to the Binomial distribution but it only applies to sampling without replacement.
Consider a set of elements of which are successes and are failures.

Find the probability to obtain successes in trails: There are ( ) ways to choose of the
successes and there are ( ) ways to choose of the failures.

Therefore, there are ( ) ( ) ways to choose successes and failures, but there
are ( ) ways to choose of the elements in the set.

( )( )
Therefore, ( )
.

Example 17

Suppose that an urn contains 10 balls of which 6 are black and 4 are white. Let denote the
number of black balls drawn when taking 3 balls without replacement. Find .

( )( ) ( )( )

( ) ( )

Example 18

As part of an air-pollution survey, an inspector decides to examine the exhaust of six of the
company’s 24 trucks. If 4 of the company’s trucks emit excessive amounts of pollutants
what is the probability that none of them will be included in the inspector’s sample?

( )( )

( )

See Example A (Rice, p. 42).

11
2.1.5 Poisson random variable

-
Poisson probability mass function: { with

parameter .

Properties of a Poisson mass function:

i)

ii) ∑

Proof:

∑ ∑ { }

Example 19

The average number of traffic accidents on the N12 between Potchefstroom and
Johannesburg is 2 per week. Assume that the number of accidents in a week follow a
Poisson distribution with .

i) Calculate the probability that no accidents occur between Potchefstroom and


Johannesburg during a 1-week period.

The average number of accident per week is . Let X be the number of accidents
in a 1 week period.

ii) Calculate the probability that at most three accidents occur during a two week
period.

During a two week period the average number of accidents is equal to .

12
Example 20

A hospital switchboard receives emergency calls at a rate of 2 every 30 minutes. What is the
probability that there are at least 1 emergency call between 02:00 and 04:00 on a specific
day?

The average number of emergency calls in a 30 minute period is . During a two hour
period the average number of calls is equal to 8.

See Example C (Rice, p. 46).

The Poisson distribution can be derived as the limit of a binomial distribution as the number
of trails, , approaches infinity and the probability of success on each trail, , approaches
zero in such a way that . The binomial frequency function is

Setting the frequency function becomes

( ) ( ) ( ) ( )

As

, therefore ( ) .

( )

( )( )( ) ( )

( )

( )
Proof: Let ( ) then ( )

( )
L'Hospital

13
Therefore and

Therefore

( ) ( ) ( ) ( ) which is the
Poisson frequency function.

Note: Suppose is binomial with parameters and , then it follows from above that as
becomes large and small (with ):

∑ ( ) ∑ ∑

The Poisson approximation works well if and .

Example 21

Suppose that 3% of the screws manufactured by a machine are defective. The screws are
packed into boxes which can hold 50 screws each. Use the Poisson approximation to
calculate the probability that a certain box will contain less than 4 defective screws.

Let X be the number of screws that are defective, then X is a binomial random variable with
and . We want to calculate :

Let . Then, by making use of the Poisson approximation:

[ ]

Check this answer by calculating the exact binomial probability.

See Example A (Rice, p. 44).

14
2.2 Continuous random variables

Continuous random variables take on values on a continuous scale, such as heights, weights
and length of life of a particular product.

These variables can take on infinitely many values corresponding to points on a line interval.
If you try to assign a positive probability to each of these uncountable values, the
probabilities will no longer sum to 1, as with discreet random variables. A different
approach should therefore be used to generate the probability distribution for a continuous
random variable.

For a continuous random variable the role of the frequency function is taken by the density
function (pdf) .

Density function: A density function of a continuous random variable , denoted , is a


continuous, real-valued function such that:

i)

ii) ∫

iii) ∫

The density function of a continuous random variable is given by a smooth curve as follows:

0.04 0.04

0.035 0.035

0.03 0.03

0.025 0.025

0.02
𝑓 𝑥 0.02

0.015 0.015

0.01 0.01

0.005 0.005

0 0
-20 -10 0 10 20 30 40 50 60 -20 -10 0 10 20 30 40 50 60

a b

The area beneath the curve is always 1.

Consider the probability that x equals some particular value, say . Since there are no area
above a single point ( ) in the probability distribution for a continuous random variable,
our definition implies that the probability is 0.

Therefore

15
Cumulative distribution function: The cdf of a continuous random variable is defined just as
it was in the discrete case:

There exists a one-to-one relationship between distribution functions and density funtions:

i) ∫ (by definition)

ii)

There is also a relationship between distribution functions and probabilities:

∫ ∫ ∫

Example 22

If has the probability density

Find and ( ).

i) ∫

[ ] ( )

Therefore .

ii) ( ) ∫ [ ] ( )

Example 23

Find the cdf of the random variable X in the previous example, and use it to re-evaluate
( ).

i) ∫ ∫ [ ]

ii) ( ) ( ) ( )

16
Example 24

The probability density of the continuous random variable X is given by


.

a) Find

∫ [ ] [ ]

b) Find cdf and recalculate (a)

∫ [ ]

Example 25

Show that represents a pdf and calculate .

i) ∫ [ ]

ii) ∫ ( )[ ]

Example 26

The density function of a random variable Y is given by

a) Find

∫ [ ] [ ( )]

[ ]

b) Find

∫ [ ]

[ ( )] [ ]

c) Find the cdf and recalculate a and b

17
∫ [ ] [ ] [ ]

[ ]

[ ]

Uniform distribution

A uniform random variable on the interval [0, 1] is a model for what we mean when we say
“choose a number at random between 0 and 1”. Any real number in the interval is a
possible outcome.

Uniform density function (i): A uniform random variable on an interval [0, 1] ( )


has a density function given by

f(x)

0 1

Example 27

( ) ∫ ∫ [ ]

( ) ∫ ∫ [ ]

Uniform density function (Ii): A uniform random variable on an interval [a, b] ( )


has a density function given by

18
1/(b-a)

a b

Example B (Rice p. 48)

The cdf of a uniform random variable on [0, 1] is:

∫ ∫ [ ] for

F(x)
1

0 1

The cdf of a uniform random variable on [a, b] is:

∫ ∫ [ ] for

a b

Example 28

At a particular hospital a study is done over a long period of time (covering many patients)
and it is found that the distribution of “time of death” is uniform over the course of a day
for a random unknown patient.

i) What is the probability that a random patient dies before 8am on the day of their
death?

[ ]

ii) What is the probability that a random patient dies during visiting hours, if visiting
hours are 10am to noon?

19
iii) What is the probability that a random patient dies during visiting hours, if visiting
hours are 10am to noon and 6pm to 9pm?

iv) What is the probability that a random patient dies at exactly midnight?

pth Quantiles: The pth quantile of a df is defined as the number such that

( ) therefore

is called the first quartile (lower quartile)

is called the second quartile (median)

is called the third quartile (upper quartile)

See Example C (Rice, p. 48)

Exponential distribution

The Exponential distribution is used to model continuous random variables such as waiting
times (for example at a supermarket till) and lifetimes associated with electronic
components.

Exponential density function: An exponential random variable with parameter has a


density function

20
2.5

1.5

𝑓 𝑥

0.5

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x

Properties of the exponential :

i)

ii) ∫ [ ]

We can now determine the distribution function (cdf) of :

∫ [ ]

Therefore {

0.9

0.8

0.7

0.6

𝜆𝑥
𝐹 𝑥 𝑒
F(x)

0.5

0.4

0.3

0.2

0.1

0
0 5 10 15 20 25 30
x

It is easy to obtain the pth quantile of :

Then by definition

21
Thus

( )
( )

The memoryless property of the exponential density:

The exponential distribution is used to model lifetimes or waiting times.

Suppose that the lifetime ( ) of, say, an electronic component is to be modelled. Suppose
also that the component has already lasted for a certain period of time , and that now we
want to determine the probability that the component will last for at least another time
units, that is, we want to calculate .

s s+t

Assume that has an exponential distribution, then:

∫ [ ]
∫ [ ]

Also

∫ [ ]

Therefore, .

This is called the memoryless property of the exponential distribution.

Example 29

Suppose that the amount of time taken for a light bulb to burn out is exponentially
distributed with a mean of 10 hours, . A person enters a room where a light bulb has
already been burning for three hours. The person would like to work for five hours in the
room. What is the probability that the person will get their work done before the light bulb
expires?

∫ [ ]

22
Example 30

A petrol station in a remote town gets very few customers. The time between two
successive customers arriving is exponentially distributed, with an average of 2 hours
between customers. Suppose a customer has just left the petrol station. The average of an
exponential distribution is therefore is this example.

i) Give the density function of the inter-arrival time.

ii) What is the probability that no customers arrive for at least 3 hours?

( )

iii) What is the probability that the next customer arrives in 1 to 2 hours’ time?

∫ [ ] or

iv) What is the probability that the next customer arrives within 10 minutes?

( )
( ) ( ) or ( ) ∫

v) If no customers arrived at the petrol station for 4 hours, what is the probability that
no customers arrive in the next 5 hours either?

Gamma distribution

Gamma function: The gamma function is defined as ∫

Properties of the gamma function: i)

ii) ( ) √

23
Density function of the Gamma random variable: A Gamma random variable has the
following density function:

Properties of the gamma density function:

i)

ii) ∫ (Try to show this)

Note: If , then exponential density function.

is the shape parameter and is the scale parameter.

See Example A (Rice, p. 54).

Normal distribution

Density function of the Normal random variable: A continuous random variable X is normally
distributed with parameters and if it has the following density function:

is called the mean and it is a measure of location, is called the standard deviation and it
is a measure of spread.

The cdf cannot be evaluated in close form (the integral over the pdf cannot be evaluated
explicitly).

The normal distribution makes use of the following notation: .

The normal density is symmetric about and it has a bell-shape (see Figure 2.13, Rice, p.
55).

Note: If and , then we say is the standard normal density.


Beta distribution

Density function of the Beta random variable: A continuous random variable X is beta
distributed with parameters and if it has the following density function:

24
The beta density is useful for modelling random variables that are restricted to the interval
[0,1].

Note: The case is the uniform distribution.

2.3 Functions of Random Variables

Suppose that a random variable X has a density function . We might be interested in


finding the density function of another random variable Y which is a function of X:
. For example, if X is the velocity of a particle with mass m, we might be
interested in the kinetic energy of the particle given by .

Notation: has a cdf and density function

has a cdf and density function .

To illustrate techniques for solving such a problem, we first develop some useful facts about
the normal distribution.

Proposition A, Rice p. 59: Suppose . Let with and b constants.


Then .

Proof: ( ) ( )

Differentiate on both sides to y to get the density function

( )
( )
√ √

Therefore

Result:

Suppose and let where and .

Then .

But and ( )

Thus and .

Suppose now that we want to calculate is :

( ) ( )

( ) ( ) ( ) ( )

25
Where is the distribution function of a random variable.

We read the probabilities of the standard normal distribution from the standard normal
table.

Normal distribution probabilities

[ ]

See Examples A and B (Rice p.60 – p.61)

Proposition B, Rice p. 62: Let X be a continuous random variable with density function
and let where is a differentiable, monotonic function. Then the density function
of Y is given by:

( ) | |

Example D (Rice, p. 62)

Let U be uniform on [0, 1], . Let . Determine the density


function of V:

( ) ( ) ( ) ( )

Differentiate of both sides to V:

( )( )

Alternative: (Using Proposition B)

26
( ) | | ( )

Example 31

Suppose X has density function . Calculate the density function of


.

( ) ( )

Differentiate of both sides to Y:

( )
( )

Alternative: (Using Proposition B)

( ) | |
( )

Example 32

The density function of X is: . Find the density function of .

( ) | |

27

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