5 Distributions
5 Distributions
ioc.pdf
The probability of answering a question correctly by random is 1/5 = 0.2. We can nd the
probability of having exactly 4 correct answers by random attempts as follows.
To nd the probability of having four or less correct answers by random attempts, we apply the
function dbinom with x = 0, . . . , 4.
Alternatively, we can use the cumulative probability function for binomial distribution pbinom:
The Poisson distribution can be used to calculate the probabilities of various numbers of
successes based on the mean number of successes.
In order to apply the Poisson distribution, the various events must be independent.
Keep in mind that the term success does not really mean success in the traditional
positive sense. It just means that the outcome in question occurs.
ioc.pdf
K is the number of times an event occurs in an interval and K can take values 0, 1, 2, . . .
The occurrence of one event does not aect the probability that a second event will
occur. That is, events occur independently.
The rate at which events occur is constant. The rate cannot be higher in some intervals
and lower in other intervals.
If these conditions are true, then K is a Poisson random variable, and the distribution of K is a
Poisson distribution.
ioc.pdf
λ x e −λ
f (x) = P(k events in interval )= ,
x!
Example
The mean number of calls to a re station on a weekday is 8. What is the probability that on a
given weekday there would be 11 calls?
Answer:
8
11 e −8
p= = 0.072
11!
ioc.pdf
Problem
If there are twelve cars crossing a bridge per minute on average, nd the probability of having
seventeen or more cars crossing the bridge in a particular minute.
The probability of having sixteen or less cars crossing the bridge in a particular minute is given
by the function ppois (cumulative Poisson probability).
Hence the probability of having seventeen or more cars crossing the bridge in a minute is in the
upper tail of the probability density function.:
ioc.pdf
pnorm(x, mean=m, sd=s) gives the distribution function, i.e. the probability P(X < x);
dnorm(x, mean=m, sd=s) gives the value of probability density function f (x);
pnorm(x) gives the Standard Normal Distribution function i.e. pnorm(x, mean=0, sd=1);
dnorm(x) gives its density i.e. dnorm(x, mean=0, sd=1);
rnorm(n, mean=m, sd=s) generates n random numbers that are distributed as N (m, s);
qnorm(x, mean=m, sd=s)inverse to pnorm(x, mean=m, sd=s) , i.e. this is the quantile
function that yields the boundary probability P(X < x) that determines the given area x).
The parameter x have to belong to the section 0 6 x 6 1.
Problem
Assume that the test scores of a college entrance exam ts a normal distribution. Furthermore,
the mean test score is 72, and the standard deviation is 15.2. What is the percentage of
students scoring 84 or more in the exam?
We apply the function pnorm of the normal distribution with mean 72 and standard deviation
15.2. Since we are looking for the percentage of students scoring higher than 84, we are
interested in the upper tail of the normal distribution.
> qnorm(0.85,mean=70,sd=3)
[1] 73.1093
> pnorm(73.1093,mean=70,sd=3)
[1] 0.85
ioc.pdf
The p
parameters of the
p normal distribution
p are µ = 10 · 0.5 = 5 and
σ= Np(1 − p) = 10 · 0.5(1 − 0.5) = 2.5) = 1.5811
> mu <- 5
> (sigma <- sqrt(2.5))
[1] 1.581139
> (A <- pnorm(8.5, mean = mu, sd = sigma))
[1] 0.9865717
> (B <- pnorm(7.5, mean = mu, sd = sigma))
[1] 0.9430769
> A-B
[1] 0.0434948 ioc.pdf
> (q025<-round(qnorm(0.025,89,6/sqrt(10)),2))
[1] 85.28
> (q975<-round(qnorm(0.025,89,6/sqrt(10),
+ lower.tail=FALSE),2))
[1] 92.72
ioc.pdf
Randomly selected a group of 10 of the larger class with a mean score of 89 (sd = 6) on
the midterm.
Alternatively:
Transform the sample mean and standard error so that the standard normal distribution
can be used:
ioc.pdf