You are on page 1of 33

ENG 3120

Statistics

Dr. Deniz Karataş


deniz.karatas@cbu.edu.tr
COURSE OUTLINE
• COURSE5&6 RANDOM VARIABLE, DISCRETE
RANDOM VARIABLE, PROBABILITY DISTRIBUTIONS,
BERNOULLI, BINOMIAL, POISSON PROBABILITY
DISTRIBUTIONS
DEFINITIONS
• Random Variable • Multinomial Distribution
• Variable whose values are determined by chance • A probability distribution resulting from an
• Probability Distribution experiment with a fixed number of independent
• The values a random variable can assume and the trials. Each trial has two or more mutually exclusive
corresponding probabilities of each. outcomes. The probability of each outcome must
remain constant from trial to trial.
• Expected Value
• Poisson Distribution
• The theoretical mean of the variable.
• Binomial Experiment • A probability distribution used when a density of
items is distributed over a period of time. The
• An experiment with a fixed number of independent trials. sample size needs to be large and the probability of
Each trial can only have two outcomes, or outcomes success to be small.
which can be reduced to two outcomes. The probability
of each outcome must remain constant from trial to trial. • Hypergeometric Distribution
• Binomial Distribution • A probability distribution of a variable with two
• The outcomes of a binomial experiment with their outcomes when sampling is done without
corresponding probabilities. replacement.
PROBABILITY DISTRIBUTIONS
• Probability Functions • Probability Distributions
• A probability function is a function which • A listing of all the values the random variable
assigns probabilities to the values of a can assume with their corresponding
random variable. probabilities make a probability distribution.
• All the probabilities must be between 0 and • A note about random variables. A random
1 inclusive variable does not mean that the values can be
• The sum of the probabilities of the outcomes anything (a random number).
must be 1. • Random variables have a well defined set of
• If these two conditions aren't met, then the outcomes and well defined probabilities for the
occurrence of each outcome.
function isn't a probability function. There is
no requirement that the values of the • The random refers to the fact that the
random variable only be between 0 and 1, outcomes happen by chance -- that is, you
only that the probabilities be between 0 and don't know which outcome will occur next.
1.
Random Variables
A random variable x represents a numerical value associated with
each outcome of a probability distribution.

A random variable is discrete if it has a finite or countable number


of possible outcomes that can be listed.
x

0 2 4 6 8 10

A random variable is continuous if it has an uncountable number or


possible outcomes, represented by the intervals on a number line.

0 2 4 6 8 10
Random Variables
Example:
Decide if the random variable x is discrete or continuous.
a.) The distance your car travels on a tank of gas
The distance your car travels is a continuous random
variable because it is a measurement that cannot be
counted. (All measurements are continuous random
variables.)

b.) The number of students in a statistics class


The number of students is a discrete random variable
because it can be counted.
Discrete Probability Distributions
A discrete probability distribution lists each possible value the
random variable can assume, together with its probability. A
probability distribution must satisfy the following conditions.

In Words In Symbols

1. The probability of each value of the 0  P (x)  1


discrete random variable is between
0 and 1, inclusive.

2. The sum of all the probabilities is 1. ΣP (x) = 1


Constructing a Discrete Probability Distribution

Guidelines
Let x be a discrete random variable with possible outcomes x1, x2,
… , xn.
1. Make a frequency distribution for the possible outcomes.
2. Find the sum of the frequencies.
3. Find the probability of each possible outcome by dividing its
frequency by the sum of the frequencies.
4. Check that each probability is between 0 and 1 and that the
sum is 1.
Constructing a Discrete Probability Distribution

Example:
The spinner below is divided into two sections. The probability of
landing on the 1 is 0.25. The probability of landing on the 2 is 0.75.
Let x be the number the spinner lands on. Construct a probability
distribution for the random variable x.

x P (x)
1 0.25 Each probability is
2 0.75 between 0 and 1.

The sum of the probabilities is 1.


Constructing a Discrete Probability Distribution

Example:
The spinner below is spun two times. The probability of landing on
the 1 is 0.25. The probability of landing on the 2 is 0.75. Let x be
the sum of the two spins. Construct a probability distribution for the
random variable x.
The possible sums are 2, 3, and 4.

P (sum of 2) = 0.25  0.25 = 0.0625

Spin a 1 on the first “and” Spin a 1 on the second


spin. spin.

Continued.
Constructing a Discrete Probability Distribution

Example continued:
P (sum of 3) = 0.25  0.75 = 0.1875

Spin a 1 on the first “and” Spin a 2 on the second


spin. spin.

“or”
P (sum of 3) = 0.75  0.25 = 0.1875
Sum of
spins, x P (x)
Spin a 2 on the first “and” Spin a 1 on the second
2 0.0625 spin. spin.
3 0.375
4 0.1875 + 0.1875 Continued.
Constructing a Discrete Probability Distribution

Example continued:

P (sum of 4) = 0.75  0.75 = 0.5625

Spin a 2 on the first “and” Spin a 2 on the second


spin. spin.

Sum of
spins, x P (x)
2 0.0625 Each probability is between 0 and 1, and
the sum of the probabilities is 1.
3 0.375
4 0.5625
Graphing a Discrete Probability Distribution

Example:
Graph the following probability distribution using a histogram.
Sum of P(x)
P (x) Sum of Two Spins
spins, x 0.6
2 0.0625
0.5
3 0.375
4 0.5625 0.4

Probability
0.3

0.2

0.1
0 x
2 3 4
Sum
Mean
The mean of a discrete random variable is given by
μ = ΣxP(x).
Each value of x is multiplied by its corresponding probability and
the products are added.

Example:
Find the mean of the probability distribution for the sum of the two
spins.
x P (x) xP (x)
2 0.0625 2(0.0625) = 0.125 ΣxP(x) = 3.5
3 0.375 3(0.375) = 1.125 The mean for the two spins
4 0.5625 4(0.5625) = 2.25 is 3.5.
Variance
The variance of a discrete random variable is given by
2 = Σ(x – μ)2P (x).

Example:
Find the variance of the probability distribution for the sum of the
two spins. The mean is 3.5.

x–μ (x – μ)2 P (x)(x – μ)2 ΣP(x)(x – 2)2


x P (x)
2 0.0625 –1.5 2.25  0.141  0.376

3 0.375 –0.5 0.25  0.094


4 0.5625 0.5 0.25 The variance for the
 0.141 two spins is
approximately 0.376
Standard Deviation
The standard deviation of a discrete random variable is given by

σ = σ 2.

Example:
Find the standard deviation of the probability distribution for the
sum of the two spins. The variance is 0.376.
σ  σ2
x P (x) x–μ (x – μ)2 P (x)(x – μ)2
2 0.0625 –1.5 2.25 0.141  0.376  0.613
3 0.375 –0.5 0.25 0.094 Most of the sums
differ from the mean
4 0.5625 0.5 0.25 0.141
by no more than 0.6
points.
Expected Value
The expected value of a discrete random variable is equal to the
mean of the random variable.
Expected Value = E(x) = μ = ΣxP(x).

Example:
At a raffle, 500 tickets are sold for $1 each for two prizes of $100
and $50. What is the expected value of your gain?
Your gain for the $100 prize is $100 – $1 = $99.

Your gain for the $50 prize is $50 – $1 = $49.

Write a probability distribution for the possible gains (or outcomes).

Continued.
Expected Value
Example continued:
At a raffle, 500 tickets are sold for $1 each for two prizes of $100
and $50. What is the expected value of your gain?
Gain, x P (x) E(x) = ΣxP(x).
1
$99 500 1 1 498
 $99   $49   ($1) 
1 500 500 500
$49
500
 $0.70
–$1 498
500
Because the expected value is negative, you can
Winning no expect to lose $0.70 for each ticket you buy.
prize
PROBABILITY DISTRIBUTIONS
• Here's an example probability distribution • Some of you might be confused by only dividing by N.
Recall that this is the population variance, the sample
that results from the rolling of a single fair variance, which was the unbiased estimator for the
die. population variance was when it was divided by n-1.
x 1 2 3 4 5 6 sum • Using algebra, this is equivalent to:
p(x) 1/6 1/6 1/6 1/6 1/6 1/6 6/6=1
• Recall that a probability is a long term relative frequency.
• Mean, Variance, and Standard Deviation So every f/N can be replaced by p(x). This simplifies to be:
• Consider the following.
• The definitions for population mean and
variance used with an ungrouped frequency • What's even better, is that the last portion of the variance
distribution were:  is the mean squared. So, the two formulas that we will be
using are:
PROBABILITY DISTRIBUTIONS
• Here's the example we were working • The mean is 21/6=7/2 or 3.5
on earlier.
x 1 2 3 4 5 6 sum • The variance is 91/6 - (7/2)2 =
35/12 = 2.916666...
p(x) 1/6 1/6 1/6 1/6 1/6 1/6 6/6 = 1 • The standard deviation is the
square root of the variance =
x*p(x) 1/6 2/6 3/6 4/6 5/6 6/6 21/6 = 3.5 1.7078

x2*p(x) 1/6 4/6 9/6 16/6 25/6 36/6 91/6 =


15.1667
• Do not use rounded off values in
the intermediate calculations.
Only round off the final answer.
BERNOULLI PROBABILITY
DISTRIBUTIONS
• A Bernouilli distribution is a discrete • The probability density function (pdf) for this
probability distribution for a Bernouilli trial — distribution is px (1 – p)1 – x, which can also be
a random experiment that has only two written as:
outcomes (usually called a “Success” or a
“Failure”).
• For example, the probability of getting a
heads (a “success”) while flipping a coin is 0.5.
The probability of “failure” is 1 – p (1 minus • The expected value for a random variable, X,
the probability of success, which also equals from a Bernoulli distribution is:
0.5 for a coin toss).
E[X] = p.
• It is a special case of the binomial distribution For example, if p = .04, then E[X] = 0.4.
for n = 1. In other words, it is a binomial
distribution with a single trial (e.g. a single • The variance of a Bernoulli random variable
coin toss). is:
Var[X] = p(1 – p).
BERNOULLI PROBABILITY
DISTRIBUTIONS
• The probability function associated with a • Now, the idea behind the Bernoulli
Bernoulli variable is the following: distribution is that the experiment is
repeated only once. But what
happens if we run more than one trial,
under the assumption that trials are
independent among each other?
• Imagine you are about to toss a dice, and you
bet your money on the number 1: hence, • The answer to that question is the
number 1 will be your success (labeled with Binomial Distribution. This distribution
1), while any other number will be a failure describes the behavior the outputs
(labeled with 0). The probability of success is
1/6. If you want to compute the probability of of n random experiments, each having
failure, you will do like so: a Bernoulli distribution with
probability p.
BINOMIAL PROBABILITIES
• Binomial Experiment • Examples of binomial experiments
• A binomial experiment is an experiment which • Tossing a coin 20 times to see how many tails
satisfies these four conditions occur.
• A fixed number of trials • Asking 200 people if they watch ABC news.
• Each trial is independent of the others • Rolling a die to see if a 5 appears.
• There are only two outcomes • Examples which aren't binomial experiments
• The probability of each outcome remains • Rolling a die until a 6 appears (not a fixed
constant from trial to trial. number of trials)
• These can be summarized as: An experiment
• Asking 20 people how old they are (not two
with a fixed number of independent trials, each
of which can only have two possible outcomes.
outcomes)
• The fact that each trial is independent actually • Drawing 5 cards from a deck for a poker hand
means that the probabilities remain constant. (done without replacement, so not
independent)
BINOMIAL PROBABILITY FUNCTION
• Example: 1 FFFFSS 5/6 * 5/6 * 5/6 * 5/6 * 1/6 * 1/6 = (1/6)^2 * (5/6)^4
• What is the probability of rolling exactly two sixes in 6 2 FFFSFS 5/6 * 5/6 * 5/6 * 1/6 * 5/6 * 1/6 = (1/6)^2 * (5/6)^4
rolls of a die? 3 FFFSSF 5/6 * 5/6 * 5/6 * 1/6 * 1/6 * 5/6 = (1/6)^2 * (5/6)^4
4 FFSFFS 5/6 * 5/6 * 1/6 * 5/6 * 5/6 * 1/6 = (1/6)^2 * (5/6)^4
• There are five things you need to do to work a binomial 5 FFSFSF 5/6 * 5/6 * 1/6 * 5/6 * 1/6 * 5/6 = (1/6)^2 * (5/6)^4
story problem. 6 FFSSFF 5/6 * 5/6 * 1/6 * 1/6 * 5/6 * 5/6 = (1/6)^2 * (5/6)^4
• Define Success first. Success must be for a single trial. 7 FSFFFS 5/6 * 1/6 * 5/6 * 5/6 * 5/6 * 1/6 = (1/6)^2 * (5/6)^4
Success = "Rolling a 6 on a single die" 8 FSFFSF 5/6 * 1/6 * 5/6 * 5/6 * 1/6 * 5/6 = (1/6)^2 * (5/6)^4
9 FSFSFF 5/6 * 1/6 * 5/6 * 1/6 * 5/6 * 5/6 = (1/6)^2 * (5/6)^4
• Define the probability of success (p): p = 1/6 10 FSSFFF 5/6 * 1/6 * 1/6 * 5/6 * 5/6 * 5/6 = (1/6)^2 * (5/6)^4
• Find the probability of failure: q = 5/6 11 SFFFFS 1/6 * 5/6 * 5/6 * 5/6 * 5/6 * 1/6 = (1/6)^2 * (5/6)^4
12 SFFFSF 1/6 * 5/6 * 5/6 * 5/6 * 1/6 * 5/6 = (1/6)^2 * (5/6)^4
• Define the number of trials: n = 6 13 SFFSFF 1/6 * 5/6 * 5/6 * 1/6 * 5/6 * 5/6 = (1/6)^2 * (5/6)^4
• Define the number of successes out of those trials: x = 2 14 SFSFFF 1/6 * 5/6 * 1/6 * 5/6 * 5/6 * 5/6 = (1/6)^2 * (5/6)^4
15 SSFFFF 1/6 * 1/6 * 5/6 * 5/6 * 5/6 * 5/6 = (1/6)^2 * (5/6)^4
• Anytime a six appears, it is a success (denoted S) and
• Notice that each of the 15 probabilities are exactly the same: (1/6)^2 * (5/6)^4.
anytime something else appears, it is a failure (denoted F).
The ways you can get exactly 2 successes in 6 trials are • Also, note that the 1/6 is the probability of success and you needed 2 successes.
The 5/6 is the probability of failure, and if 2 of the 6 trials were success, then 4 of
given below. The probability of each is written to the right the 6 must be failures. Note that 2 is the value of x and 4 is the value of n-x.
of the way it could occur. Because the trials are
• Further note that there are fifteen ways this can occur. This is the number of ways 2
independent, the probability of the event (all six dice) is the successes can be occur in 6 trials without repetition and order not being important,
product of each probability of each outcome (die) or a combination of 6 things, 2 at a time.
BINOMIAL PROBABILITY FUNCTION
• The probability of getting exactly x success in n trials, with the • Mean, Variance, and Standard Deviation
probability of success on a single trial being p is:
• P(X=x) = nCx * px * q(n-x)=nCx * px * q(1-x)
• Where; p is the probability of each choice we want
• x is the the number of choices we want
• n is the total number of choices • Another way to remember the variance is mu-q
• Example: (since the np is mu).
• A coin is tossed 10 times. What is the probability that exactly 6 • Example:
heads will occur.
• Success = "A head is flipped on a single coin" • Find the mean, variance, and standard deviation
for the number of sixes that appear when rolling
• p = 0.5
30 dice.
• q = 0.5
• Success = "a six is rolled on a single die". p = 1/6, q
• n = 10 = 5/6.
• x=6
• The mean is 30 * (1/6) = 5. The variance is 30 *
• P(x=6) = 10C6 * 0.5^6 * 0.5^4 = 210 * 0.015625 * 0.0625 = (1/6) * (5/6) = 25/6. The standard deviation is the
0.205078125
square root of the variance = 2.041241452
MULTINOMIAL PROBABILITIES
• A multinomial experiment is an extended • The probability that a person will pass a College Algebra
binomial probability. The difference is that in class is 0.55, the probability that a person will withdraw
before the class is completed is 0.40, and the probability
a multinomial experiment, there are more that a person will fail the class is 0.05.
than two possible outcomes. However, there
• Find the probability that in a class of 30 students, exactly
are still a fixed number of independent trials, 16 pass, 12 withdraw, and 2 fail.
and the probability of each outcome must
remain constant from trial to trial. Outcome x p(outcome)
Pass 16 0.55

• Instead of using a combination, as in the case Withdraw 12 0.40


of the binomial probability, the number of Fail 2 0.05
ways the outcomes can occur is done using Total 30 1.00
distinguishable permutations.
• The probability is found using this formula:

• An example here will be much more useful


than a formula.
BINOMIAL PROBABILITIES
DISTRUBITION
POISSON PROBABILITIES
• Named after the French mathematician Simeon • Example:
Poisson, Poisson probabilities are useful when there
are a large number of independent trials with a • If there are 500 customers per eight-hour day
small probability of success on a single trial and the
variables occur over a period of time. It can also be in a check-out lane, what is the probability
used when a density of items is distributed over a that there will be exactly 3 in line during any
given area or volume. five-minute period?
• The expected value during any one five
minute period would be 500 / 96 =
• Lambda in the formula is the mean number of 5.2083333. The 96 is because there are 96
occurrences. e is Euler’s constant (≈2.71828). If
you're approximating a binomial probability using five-minute periods in eight hours. So, you
the Poisson, then lambda is the same as mu or n * p. expect about 5.2 customers in 5 minutes and
• The Poisson distribution has the following want to know the probability of getting
properties: exactly 3.
• The mean of the distribution is equal to =n*p . • p(3;500/96) = e^(-500/96) * (500/96)^3 / 3!
• The variance is also equal to  . = 0.1288
BINOMIAL PROBABILITY DISTRIBUTION
TABLE
POISSON PROBABILITY DISTRIBUTION
TABLE
EXERCISES
EXERCISES
TAKEHOME EXERCISES
• Example1: Suppose that we are investigating the safety of a dangerous intersection. Past police records indicate a
mean of five accidents per month at this intersection. The number of accidents is distributed according to a
Poisson distribution, and the Highway Safety Division wants us to calculate the probability in any month of exactly
0, 1, 2, 3, or 4 accidents.
• Example2: Your company makes sports bikes. 90% pass final inspection (and 10% fail and need to be fixed). What
is the probabilities, expected Mean and Variance of the 4 next inspections?
• Example3: A fair coin is tossed five times. Use the binomial probability formula to calculate the probability of at
least four heads.
• Example4: One nanogram of Plutonium-239 will have an average of 2.3 radioactive decays per second, and the
number of decays will follow a Poisson distribution. What is the probability that in a 2 second period there are
exactly 3 radioactive decays?
• Example5: Let's say you are a cashier at Wal-Mart. It is 4:30pm and your shift ends at 5:00pm. The store policy is to
close your checkout line 15 minutes before your shift ends (in this case 4:45) so that you van finish checking-out
the customers already in your line and leave on-time. By examining overhead cameras, store data indicates that
between 4:30pm and 4:45pm each weekday, an average of 10 customers enter any given checkout line. What is
the probability that exactly 7 customers enter your line between 4:30 and 4:45? What is the probability that more
than 10 people arrive? (Which means you will probably be on shift later than 5:00pm)

You might also like