You are on page 1of 25

4/27/2018

Discrete Uniform
Distribution
KNS2723 NUMERICAL METHODS AND STATISTICS
MR ABDUL AZIM ABDULLAH

Random Variables (RV)


 Is a result of a chance event, that can be measure or
count.
 Example of random processes:
1. flipping coins,
2. rolling dice,
3. traffic counting
4. measuring the rain

1
4/27/2018

Random Variables (RV)

 Suppose we are about to roll a dice 4 times and record


the number of sixes
 The number of sixes in 4 rolls is a random variable that will
eventually take on a value
 We will observe 0,1,2,3,4 #of sixes
 Map outcome of a random process to numbers

Random Variables (RV)


 RV is denoted by a capital letter such as “X”
 For example, random variable X = number of sixes in 4
rolls
 The outcomes are denoted by lowercase letter “x”
 For example, the outcomes for rolling sixes can be listed
as
x = 0, x = 1, x = 2, x = 3, x = 4
 RV for coin flipping can be quantify as

2
4/27/2018

Discrete RV vs Continuous RV
Discrete Continuous
 A set of data is said to be  A set of data is said to be continuous if
discrete if the values the values belonging to the set can take
belonging to the set are any value within a finite or infinite
distinct or separate. interval.
 Discrete RV is a set of data  Continuous RV is a set of data that can
that can be COUNTED be MEASURED
 e.g. in roll of a dice you can  e.g. height of sunflower grown from the
only have {1,2,3,4,5,6}. This seed. Let say it can grow up to 70 inches
data is discrete because you tall. So the height of a sunflower can
cannot get a 2.5. So, in this take any value between 0 to 70 [0, 70]
case we have six distinct  e.g. Measure amount of rain per day by
values for 6 different using a container with max capacity of
outcomes. 1L. The amount of rain can take any
value between 0 to 1L [0,1]

Discrete RV vs Continuous RV
Discrete Continuous
 Number of language  Height of a child
spoken
 Length of hair grows per day
 Number of books on a
 Speed of a train
shelf
 Time it takes to sprint 100 m
 Number of students
 Weight of random animals in the
 Purchasing tickets
zoo

Discrete RV cannot be Continuous RV can be broken down


broken down into fractions into fractions and decimals
or decimals

3
4/27/2018

Discrete RV vs Continuous RV

Discrete Continuous

Probability Distribution Function


(PDF)
 PDF of a discrete RV X is a list of each possible value of X together
with the probability that X takes that values in one trial of the
experiment
 In simple terms, PDF is a function describing the probabilities of each
particular event occurring
 The probability of the different possible outcomes can be plot so
that we can see how that distribution is spread out amongst those
possible outcomes

 Characteristics of probability distribution


1. 0 ≤ P(X=x) ≤ 1
2. ∑ P(X=x) = 1

4
4/27/2018

Example 1: PDF
We flips a fair coins three times and we would like to find out the
number of heads we can get.

Let X = number of heads for 3 flips of a fair coin


What are the possible outcomes when we flips a fair coins 3 times?

Value of X Frequency Probability


HHH THH (x) P (X = x)
HHT THT 0 1 1/8
HTH TTH 1 3 3/8 PDF
HTT TTT 2 3 3/8
3 1 1/8
TOTAL 8 1

Example 1

3/4
Pobability

1/2 Plot of PDF

1/4

0
0 1 2 3
P(X=x) 1/8 3/8 3/8 1/8

5
4/27/2018

Example 2: Probability Model


Let say you like to visit a bubble tea outlet every 6 pm after lecture.
However, you are not keen to a long queue. So, you are interested to
the probability on how many people are in line at the given time of
visit.
Every time you visit the outlet, you observed how many people are in
the queue
X = number of people in queue
After 50 visits you come out with the following table,

Number of people Time observed Probability


in queue (x) Estimate P(X = x)
0 24 0.48
1 18 0.36
2 8 0.16
Total 50 1

Example 2: Probability Model


Let say you are going to visit the bubble tea shop for 100 times for next
two years. How many times you can expect to see 2 people in the
queue.

From the probability distribution table, P (X = 2) = 0.16

So, the number of times you will see 2 people in queue for the next 100
visit
100 x 0.16 = 16 times

6
4/27/2018

Example 3
A report by the Ministry of Health reveal that approximately 48%
Malaysian adults have high cholesterol. Suppose we randomly sample
2 Malaysian adults, what is the probability that one or more adult we
sample have high cholesterol.

Let X = number of adults in our sample that have high cholesterol.


List the possible values of X and their probability of occurring

Possibilities LL LH HL HH
Value of X 0 1 1 2
(x)
Probabilities 0.52*0.52 0.52*0.48 0.52*0.48 0.48*0.48
=0.2704 =0.2496 =0.2496 =0.2304

Example 3
Now we can construct the PDF using the probability distribution table

Possibilities NN NC CN CC
Probability
Value of X 0 1 1 2 distribution
(x) table for all
Probabilities 0.52*0.52 0.52*0.48 0.52*0.48 0.48*0.48 possibilities/
=0.2704 =0.2496 =0.2496 =0.2304 outcomes

x 0 1 2 Total
P(X=x) 0.2704 0.2496*2 0.2304 1 PDF
=0.4992

7
4/27/2018

Example 3
0.6

0.5
Probabilities

0.4

0.3
Plot of PDF
0.2

0.1

0
0 1 2
X 0.2704 0.4992 0.2304

What is the probability that one or more adult selected randomly have high cholesterol?

P(X≥1) = P(X=1)+P(X=2) = 0.4992+0.2304 = 0.7296 @ 72.96%

Cumulative Distribution Function


(CDF)
 The CDF of a RV X is a function F that, when evaluated at a point x,
gives the probability that the RV will take on a values less than or
equal to x

F(x) = P(X ≤ x)
 Properties;
1. 0 ≤ F(x) ≤ 1; -∞ < x < ∞
Note: P(X > x1) = P(x1 < X < ∞)
2. F(- ∞) = 0; F(∞) = 1 = F(∞) – F(x1)
3. If x1 < X2 then F(x1) ≤ F(x2) = 1 – F(x1)

4. P (x1< x ≤ x2) = F(x2) – F(x1)

8
4/27/2018

Example 4: CDF
Given the probability distribution for RV X, find the CDF and find
P(X ≤ 4.5), P(X > 4.5), P(1.5 < X ≤ 4.5).

x 1 2 4 6
PDF
P(X = x) 0.2 0.5 0.1 0.2

x 1 2 4 6
F(x) = P(X ≤ x) = P(X ≤ 1) = P(X ≤ 2) = P(X ≤ 4) 1
CDF = 0.2 = P(X=1)+P(X=2) = P(X=1)+P(X=2)+P(X=4)
=0.2+0.5 =0.2+0.5+0.1
=0.7 =0.8

x 1 2 4 6
Example 4 P(X = x) 0.2 0.5 0.1 0.2
F(x) 0.2 0.7 0.8 1
1.2
F(X)

1
find P(X ≤ 4.5), P(X > 4.5), P(1.5 < X ≤ 4.5)?
0.8

0.6

0.4

0.2

0
-4 -2 0 2 4 6 8
X

9
4/27/2018

Example 5
Let say we are flipping a fair coin twice. Find the PDF and CDF of the
outcome of the experiment.

Example 6
Using the following PDF, find the value of a and its CDF.

x 3 5 6 8 9
P(X=x) 0.1 0.2 0.1 0.5 a

10
4/27/2018

Example 7
The table shows the CDF of a certain experiment. Find its PDF.

x 4 7 9 11
F(x) 0.3 0.4 0.9 1

Example 8
Given the mathematical expression of a CDF for a certain random
event. Find the PDF for that expression.

𝑥+𝑘
𝐹 𝑥 = ; x =1, 2, 3, 4
6

11
4/27/2018

Mean, Variance and Standard


Deviation

Mean, Variance and Standard


Deviation
 Knowing the mean, 𝜇 and standard deviation, 𝜎 of the probability
distribution of x, in conjunction with Chebyshev’s rule and the
Empirical rule, we can make statements about the likelihood of
values of x falling within the intervals 𝜇 ± 𝜎, 𝜇 ± 2𝜎 and 𝜇 ± 3𝜎.
 Depending on the shape of probability distribution, p(x), the
following probability statements can be made:

12
4/27/2018

Mean, Variance and Standard


Deviation

Example 9: Skin Cancer Treatment

13
4/27/2018

Example 9: Skin Cancer Treatment

Binomial RV

 aka Bernoulli RV

14
4/27/2018

Example 10: Assessing Binomial RV

Example 11 Binomial Probability

15
4/27/2018

Binomial RV

Example 12 Binomial Probability


Formula
Refer to Example 11. Use the formula for a binomial RV to find the
probability distribution of x, where x is the number of adults who pass
the fitness test. Graph the distribution.

16
4/27/2018

Example 12 Binomial Probability


Formula

Binomial RV

17
4/27/2018

Example 13 Mean and Standard


Deviation of Binomial RV
Refer to Example 11 and 12. Calculate the mean, µ and standard
deviation, σ of the number of the four adults who pass the test.
Interpret the results.

18
4/27/2018

Binomial Tables

 Calculating binomial probabilities becomes tedious when n is large.


 For some values of n and p, the binomial probabilities have been
tabulated in Table II of Appendix A (McClave J.T., and Sincich T.
(2012). Statistics. 12th Edition, Prentice Hall, New Jersey, pp 765-768)
 Table II contains a total of nine table corresponding to n = 5, 6, 7, 8,
9, 10, 15, 10 and 25.

Binomial Tables # trials

Probability
of success

Values Cumulative
of the binomial
RV x probabilities

The cumulative binomial distributions corresponding to n = 10, p = 0.1 and x = 2 is


highlighted in the table

19
4/27/2018

Binomial Tables

Find the values of


P(x = 2) = ?
P(x > 2) = ?

Example 14 Using the Binomial


Table

20
4/27/2018

Example 14 Using the Binomial


Table

The Hypergeometric RV

 Note that both the hypergeometric and binomial characteristics


stipulate that each draw, or trial, results in one or two outcomes
 Hypergeometric trials are dependent while the binomial trials are
independent.
 The draws are dependent because the probability of drawing an S (or
F) is dependent on what occurs on preceding draws

21
4/27/2018

The Hypergeometric RV

Example 16 Hypergeometric
Distribution

22
4/27/2018

Example 16 Hypergeometric
Distribution

The Poisson RV
 Poisson probability distribution is useful in describing the number of
rare events that will occur during a specific period or in a specific
area or volume
 Typical examples
1. The number of traffic accidents per month at a busy intersection
2. The number of noticeable surface defects (scratches, dents, etc.)
found by quality inspectors on a new automobile
3. The number of parts per million of some toxin found in the water or
air emissions from a manufacturing plant
4. The number of diseased tress per acre of certain woodland
5. The number of death claims received per day by an insurance
company
6. The number of unscheduled admissions per day to a hospital

23
4/27/2018

The Poisson RV

The calculation of Poisson probabilities is made easier by the use of Table III
in Appendix A (pp 769-772), which gives the cumulative probabilities P(x ≤ k)
for various values of λ

Example 15 Poisson Probabilities

24
4/27/2018

THANK YOU

25

You might also like