You are on page 1of 39

STATISTICS

and
PROBABILIT
Y
SECOND SEMESTER
COMPUTING PROBABILITY
CORRESPONDING TO A
GIVEN RANDOM VARIABLE

This Photo by Unknown Author is licensed under CC BY


RANDOM VARIABLES
A Random Variable
is a set of possible
values from a random
experiment.
Example: Tossing a coin: we could
get Heads or Tails.
Random Possible Random
variable value events
0 Head
X
1 Tail
A Random Variable’s set of values is
the Sample Space.
Example: Throw a die once
Random Variable X= “The score shown on the top
face.”
X could be 1, 2, 3, 4, 5 or 6
So the sample space is {1, 2, 3, 4, 5, 6}
PROBABILITY
PROBABILITY
P(x = 1)= 1/6
We can show the probability of any
one value using this style: P(X= P(x = 2)= 1/6
value) = probability of that value P(x = 3)= 1/6
P(x = 4)= 1/6
Example: Throw a die once
P(x = 5)= 1/6
X= {1, 2, 3, 4, 5, 6}
P(x = 6)= 1/6
Example:

How many heads when we toss three coins?


X= “The number of the Heads” is the Random Variable
In this case, there could be 0 Heads (if all the coins land Tails up),
1 Head, 2 Heads or 3 Heads.
So the Sample Space = {0, 1, 2, 3}
The three coins can land in eight possible ways:
H H H X= “Number of Heads”
H H T
H T H P(x = 3)= 1/8
H T T P(x = 2)= 3/8
P(x = 1)= 3/8
T H H
P(x = 0)= 1/8
T H T
T T H
T T T
Example:

2. Two dice are tossed. The random variable is X= “The sum


of the scores on the two dice”.

Let’s make a table of all the possible values.


1st die
1 2 3 4 5 6

1 2 3 4 5 6 7 There are 6 x 6= 36
2 3 4 5 6 7 8
possible outcomes, and the
sample space (which is the
2nd
die
3 4 5 6 7 8 9
sum of the scores on the
4 5 6 7 8 9 10 two dice) is {2, 3, 4, 5, 6, 7,
5 6 7 8 9 10 11
8, 9, 10, 11, 12}
6 7 8 9 10 11 12
Let’s count how often each value occurs,
and work out the probabilities:
2 occurs just once, so P(X = 2)= 1/36 8 occurs five times, so P(X = 8)= 5/36
3 occurs twice, so P(X = 3)= 2/36 or 1/18 9 occurs 4 times, so P(X = 9)= 4/36 or 1/9
4 occurs three times, so P(X = 4)= 3/36 or 10 occurs thrice, so P(X = 10)= 3/36 or 1/12
1/12
11 occurs twice, so P(X= 11)= 2/36 or 1/18
5 occurs four times, so P(X = 5)= 4/36 or 1/9
12 occurs just once, so P(X = 12)= 1/36
6 occurs five times, so P(X = 6)= 5/36
7 occurs six times, so P(X = 7)= 6/36 or 1/6
THE PROBABILITY SCALE
Probabilities are given on a scale of 0 to 1, as
decimals or as fractions; sometimes probabilities are
expressed as percentages using a scale of 0% to
100%, particularly on weather forecasts.
0 This is the probability of something that is
impossible.

1 This is the probability that something is certain.

½ This is the probability of something that is


likely to happen as it is not to happen.
THE PROBABILITY OF A SINGLE EVENT

For equally likely events: 𝑝(𝑎 𝑝𝑎𝑟𝑡𝑖𝑐𝑢𝑙𝑎𝑟 𝑜𝑢𝑡𝑐𝑜𝑚𝑒)

= 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑤𝑎𝑦𝑠 𝑜𝑏𝑡𝑎𝑖𝑛𝑖𝑛𝑔 𝑜𝑢𝑡𝑐𝑜𝑚𝑒


𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒
Example:
1) A cardis taken at random from a full pack of 52 playing cards. What is
the probability that is:
(a) Red card
(b) a queen
(c) a red ace
(d) the seven of hearts
Example:

(a) Red card


There are 26 cards in the pack,
𝑝 (𝑟𝑒𝑑) = =
Example:

(b) a queen
There are 4 queens in the pack,
𝑝 (𝑞𝑢𝑒𝑒𝑛) = =
Example:

(c) a red ace


There are 2 red aces in the pack,
𝑝 (𝑟𝑒𝑑 𝑎𝑐𝑒) = =
Example:

(d) the seven of hearts


There is only 1 seven of hearts in the
pack,
𝑝 (𝑠𝑒𝑣𝑒𝑛 𝑜𝑓 ℎ𝑒𝑎𝑟𝑡𝑠) =
Example:
2) A packet of sweets contains 18 red sweets, 12 green sweets and 10
yellow sweets. A sweet is taken at random from the packet. What is
the probability that the sweet is:
(a) Red,
(b) Not green,
(c) Green or yellow?
Example:

Solution:
The total number of sweets in the packet
is 40, so there are 40 equally likely
outcomes when one is taken at random.
Example:

(a) There are 18 red sweets,


so: 𝑝(𝑟𝑒𝑑) = =
Example:

(b) Not green,


There are 28 sweets that are not green
in the packet,
𝑝 (𝑛𝑜𝑡 𝑔𝑟𝑒𝑒𝑛) = =
Example:
(c) Green or yellow?
There are 22 sweets that are green or
yellow in the packet,
𝑝 (𝑔𝑟𝑒𝑒𝑛 𝑜𝑟 𝑦𝑒𝑙𝑙𝑜𝑤) = =
A RANGE OF VALUES
Example:

Two dice are tossed. The random variable is X= “The sum of


the scores on the two dice”.
Example:
what is the probability that the sum of the scores is 5, 6,
7, or 8?
In other words: What is 𝑃(5 ≤ 𝑥 ≤ 8)?
𝑃(5 ≤ 𝑥 ≤ 8)= P(X=5) + P(X=6) + P(X=7) + P(X=8)
= (4 + 5 + 6 + 5)/36
= 20/36
= 5/9
Expected Value (or Mean) of a Discrete
Random Variable

For a discrete random variable, the expected value, usually denoted as


µ or E(X), is calculated using:
µ = 𝐸(x) = ∑𝑥 𝑖𝑓 (𝑥𝑖)
The formula means that we multiply each value, x, in the support by its
respective probability, f (x), and then add them all together. It can be
seen as an average value but weighted by the likelihood of the value.
Example:
x 0 1 2 3 4

F(x) 1/5 1/5 1/5 1/5 1/5

What is the expected value?


Answer

µ = 𝐸(𝑋) = ∑𝑥𝑓(𝑥) = 0 () + 1 () + 2
() + 3 () + 4 ()
=
=2
VARIANCE OF A
DISCRETE RANDOM
VARIABLE
VARIANCE OF A DISCRETE RANDOM VARIABLE

The variance of a discrete random variable is given by:


σ² = Var(X) = ∑ 𝑖𝑓(𝑥𝑖 ) − 𝐸 = ∑ 𝑖𝑓(𝑥𝑖 ) −
The formula means that first, we sum the square of each
value times its probability then subtract the square of the
mean. We will use this form of the formula in all of our
examples.
STANDARD DEVIATION OF A
DISCRETE RANDOM VARIABLE

The standard deviation of a


random variable, X, is the
square root of the variance.
σ = SD(X) = √𝑉𝑎𝑟(𝑋) = √σ²
Example:
x 0 1 2 3 4

F(x) 1/5 1/5 1/5 1/5 1/5

Find the variance and the standard deviation of X.


Answer
σ = SD(X) = √𝑉𝑎𝑟(𝑋) = √σ²
𝑉𝑎𝑟(𝑋)= [()+ ()+ ()+ ()+ ()] −
=6−4
=2
𝑆𝐷(𝑋) = √2
= 1.4142

You might also like