Ans.
dbinom(3,15,0.1)
## [1] 0.1285054
Ans.
pbinom(2,15,0.1)
## [1] 0.8159389
Ans.
dbinom(4,15,0.1)
## [1] 0.04283515
Ans.
dpois(5,10)
## [1] 0.03783327
Ans.
1-ppois(34,20)
## [1] 0.001489034
3.Scores on a recent national statistics exam were normally distributed with a mean of 80 and a standard deviation of 6.
Ans.
1-pnorm(71,80,6)
## [1] 0.9331928
Ans.
pnorm(92,80,6)-pnorm(89,80,6)
## [1] 0.04405707
Ans.
qnorm(0.975,80,6)
## [1] 91.75978
Ans.
334/(1-pnorm(89,80,6))
## [1] 4999.461
4.The price of a bond is uniformly distributed between $80 and $85.
Ans.
1-punif(83,80,85)
## [1] 0.4
Ans.
punif(85,80,85) - punif(81,80,85)
## [1] 0.8
5.The time between arrivals of customers at the drive-up window of a bank follows an exponential probability distribution with a mean of 10 minutes.
Ans.
pexp(7,1/10)
## [1] 0.5034147
Ans.
pexp(7,1/10)-pexp(3,1/10)
## [1] 0.2442329
Ans.
1-pnorm(30400,20000,8000)
## [1] 0.09680048
Ans.
pnorm(15600,20000,8000)
## [1] 0.2911597
Ans.
minimum = round(qnorm(0.025,20000,8000),0)
maximum = round(qnorm(0.975,20000,8000),0)
cat(sprintf("\nMinimum Salary = %d",minimum))
##
## Minimum Salary = 4320
cat(sprintf("\nMaximum Salary = %d",maximum))
##
## Maximum Salary = 35680
Ans.
total = round(189/(1-pnorm(32240,20000,8000)),0)
cat(sprintf("\nTotal number of students = %d",total))
##
## Total number of students = 3000
7.The length of time patients must wait to see a doctor in a local clinic is uniformly distributed between 15 minutes and 2 1/2 hours.
Ans. 0
Ans.
punif(120,15,150) - punif(45,15,150)
## [1] 0.5555556
Ans.
1- punif(120,15,150)
## [1] 0.2222222
8.The salaries at a corporation are normally distributed with an average salary of $19,000 and a standard deviation of $4,000.
Ans.
pnorm(13480,19000,4000)-pnorm(12520,19000,4000)
## [1] 0.03117718
Ans.
1- pnorm(11880,19000,4000)
## [1] 0.962462
Ans.
pnorm(28440,19000,4000)
## [1] 0.9908625
9.The time it takes a worker on an assembly line to complete a task is exponentially distributed with a mean of 8 minutes.
Ans.
pexp(4,1/8)
## [1] 0.3934693
Ans.
pexp(10,1/8) - pexp(6,1/10)
## [1] 0.2623068
Ans.
1-pnorm(60,48,8)
## [1] 0.0668072
Ans.
(1-pnorm(36,48,8))*100
## [1] 93.31928
Ans.
minimum = round(qnorm(0.025,48,8),3)
maximum = round(qnorm(0.975,48,8),3)
cat(sprintf("\nMinimum life expectancy = %f months",minimum))
##
## Minimum life expectancy = 32.320000 months
cat(sprintf("\nMaximum life expectancy = %f months",maximum))
##
## Maximum life expectancy = 63.680000 months
Ans.
qnorm(0.05,48,8)
## [1] 34.84117
Ans.
pexp(7,1/14)
## [1] 0.3934693
Ans.
pexp(7,1/14)-pexp(3.5,1/14)
## [1] 0.1722701
Ans.
dpois(7,7)
## [1] 0.1490028
Ans.
dpois(0,7)
## [1] 0.000911882
Ans.
ppois(3,7)
## [1] 0.08176542
Ans.
1-ppois(16,7)
## [1] 0.0009581832
Ans.
dbinom(2,8,0.1)
## [1] 0.1488035
Ans.
1-pbinom(1,8,0.1)
## [1] 0.1868953
Ans.
dbinom(0,8,0.1) * 100
## [1] 43.04672
Ans.
dbinom(3,6,0.2)
## [1] 0.08192
Ans.
dbinom(4,6,0.2)
## [1] 0.01536
Ans.
dbinom(0,6,0.2)
## [1] 0.262144
Ans.
dpois(10,15)
## [1] 0.04861075
Ans.
ppois(14,15)-ppois(10,15)
## [1] 0.3471893
Ans.
ppois(6,15)
## [1] 0.0076319
##
## Cell Contents
## |-------------------------|
## | Count |
## |-------------------------|
##
## Total Observations in Table: 200
##
## | SelectedMajor
## Gender | Management | Marketing | Others | Row Total |
## -------------|------------|------------|------------|------------|
## Male | 40 | 10 | 30 | 80 |
## -------------|------------|------------|------------|------------|
## Female | 30 | 20 | 70 | 120 |
## -------------|------------|------------|------------|------------|
## Column Total | 70 | 30 | 100 | 200 |
## -------------|------------|------------|------------|------------|
##
##
## NULL
Ans.
datamatrix = matrix(c(40,30,10,20,30,70),nrow = 2,ncol = 3)
row.names(datamatrix) = c("Male","Female")
colnames(datamatrix) = c("Management","Marketing","Others")
margin.table(datamatrix,2)/margin.table(datamatrix)
## Management Marketing Others
## 0.35 0.15 0.50
Answer is 0.15.
Ans.
datamatrix = matrix(c(40,30,10,20,30,70),nrow = 2,ncol = 3)
row.names(datamatrix) = c("Male","Female")
colnames(datamatrix) = c("Management","Marketing","Others")
prop.table(datamatrix,1)
## Management Marketing Others
## Male 0.50 0.1250000 0.3750000
## Female 0.25 0.1666667 0.5833333
Answer is 0.25
Ans.
datamatrix = matrix(c(40,30,10,20,30,70),nrow = 2,ncol = 3)
row.names(datamatrix) = c("Male","Female")
colnames(datamatrix) = c("Management","Marketing","Others")
prop.table(datamatrix)
## Management Marketing Others
## Male 0.20 0.05 0.15
## Female 0.15 0.10 0.35
Answer is 0.2
Ans.
datamatrix = matrix(c(40,30,10,20,30,70),nrow = 2,ncol = 3)
row.names(datamatrix) = c("Male","Female")
colnames(datamatrix) = c("Management","Marketing","Others")
prop.table(datamatrix,2)
## Management Marketing Others
## Male 0.5714286 0.3333333 0.3
## Female 0.4285714 0.6666667 0.7
Answer is 0.571
##
## Cell Contents
## |-------------------------|
## | Count |
## |-------------------------|
##
## Total Observations in Table: 200
##
## | Sex
## MaritalStatus | Male | Female | Row Total |
## --------------|-----------|-----------|-----------|
## Single | 20 | 30 | 50 |
## --------------|-----------|-----------|-----------|
## Married | 100 | 50 | 150 |
## --------------|-----------|-----------|-----------|
## Column Total | 120 | 80 | 200 |
## --------------|-----------|-----------|-----------|
##
##
## NULL
Ans.
datamatrix = matrix(c(20,100,30,50),nrow = 2,ncol = 2)
colnames(datamatrix) = c("Male","Female")
row.names(datamatrix) = c("Single","Married")
prop.table(datamatrix)
## Male Female
## Single 0.1 0.15
## Married 0.5 0.25
Answer is 0.15
Ans.
datamatrix = matrix(c(20,100,30,50),nrow = 2,ncol = 2)
colnames(datamatrix) = c("Male","Female")
row.names(datamatrix) = c("Single","Married")
(margin.table(datamatrix,2)/margin.table(datamatrix)) *100
## Male Female
## 60 40
Answer is 60%
Ans.
datamatrix = matrix(c(20,100,30,50),nrow = 2,ncol = 2)
colnames(datamatrix) = c("Male","Female")
row.names(datamatrix) = c("Single","Married")
prop.table(datamatrix,2)
## Male Female
## Single 0.1666667 0.375
## Married 0.8333333 0.625
Answer is 0.375
Ans.
datamatrix = matrix(c(20,100,30,50),nrow = 2,ncol = 2)
colnames(datamatrix) = c("Male","Female")
row.names(datamatrix) = c("Single","Married")
cat(sprintf("\nMarginal Probabilities\n"))
##
## Marginal Probabilities
(margin.table(datamatrix,2)/margin.table(datamatrix))
## Male Female
## 0.6 0.4
cat(sprintf("\nConditional Probabilities\n"))
##
## Conditional Probabilities
prop.table(datamatrix,1)
## Male Female
## Single 0.4000000 0.6000000
## Married 0.6666667 0.3333333
Since the Marginal and Conditional Probabilities aren’t correspondingly equal, it can be concluded that marital status is not independent of gender.
Ans.
##
## library(PROBShiny)
##
## PROBShiny()
Ans. 0.8125
What proportion of students is expected to pass the course?
Given that a person passes the course, what is the probability that he/she attended classes on Fridays?
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. 0.668 b. 0.8802
##
## library(PROBShiny)
##
## PROBShiny()
Ans. 75% or 0.75
21.On a recent holiday evening, a sample of 500 drivers was stopped by the police. Three hundred were under 30 years of age. A total of 250 were under the influence of alcohol. Of the drivers under 30 years of age, 200 were under the influence of alcohol.
Let A be the event that a driver is under the influence of alcohol. Let Y be the event that a driver is less than 30 years old.
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. P(Y) = 0.6 P(A) = 0.5
b. 0.2
c. They are not independent events
##
## library(PROBShiny)
##
## PROBShiny()
Ans. 0.9130
23.A machine is used in a production process. From past data, it is known that 97% of the time the machine is set up correctly. Furthermore, it is known that if the machine is set up correctly, it produces 95% acceptable (non-defective) items. However, when it is set up incorrectly, it produces only 40% acceptable items.
An item from the production line is selected. What is the probability that the selected item is non-defective?
Given that the selected item is non-defective, what is the probability that the machine is set up correctly?
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. 0.9335 b. 0.9871
Find the probability of scoring above 400.
Find the probability that a student who scored above 400 reviewed for the test.
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. 0.79 b. 0.7532
What percentage of students in this sample was female?
Given that a person is female, what is the probability that she is an engineering major?
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. 44% b. 27.3% or 0.273
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. 8.8% or 0.88
51.2% or 0.512
42.6% or 0.426
48.8% or 0.488
27.Records of a company show that 20% of the employees have only a high school diploma; 70% have bachelor degrees; and 10% have graduate degrees. Of those with only a high school diploma, 10% hold management positions; whereas, of those having bachelor degrees, 40% hold management positions. Finally, 80% of the employees who have graduate degrees hold management positions.
##
## library(PROBShiny)
##
## PROBShiny()
Ans. a. 38%
b. 21.1% or 0.21
Ans.
##
## library(NDP)
##
## NDP()
Ans.
##
## library(NDP)
##
## NDP()
What is the probability of selling between 9,500 and 11,000 tickets?
Ans.
##
## library(NDP)
##
## NDP()