Description
Patrick Gardocki
3-109
X = number of passengers that do not show up X follows a binomial distribution
a)
4
P(X ≥ 5) = 1 − P(X ≤ 4) = 1 − P x = 0.9961
x=0
1 – pbinom(4,125,0.1)
## [1] 0.9961414
b)
5
P(X > 5) = 1 − P(X ≤ 5) = 1 − P x
x=0 = 0.9885
1 – pbinom(5,125,0.1)
## [1] 0.9885678 3-173
a)
ED = number of emergency department visits per day λT = 1.8
5 −1.8 x
P(ED > 5) = 1 − P e x(1! .8) = 0.0103
x=0
1 – ppois(5,1.8)
## [1] 0.01037804
b)
EW = number of emergency department visits per week λT = 1.8 × 7 = 12.6
4 −12.6 x
P(ED < 5) = P e x(12! .6) = 0.00497
x=0
ppois(4,12.6)
## [1] 0.004979028
c)
ET = number of visits in T days λT = 1.8T
P(ET ≥ 1) = 1 − P(ET
e−1.8T = 0.01 = ln(e−1.8T) = ln(0.01) → T = 2.558 days
log(0.01)/-1.8
## [1] 2.558428
d)
5 −λ x
Solve for λ. P(ED > 5) = 0.1 = 1 − P e x(!λ)
x=0
4-4
f(x) = x23 for x > 1
a)
2
P(X < 2) = R x23dx = −x21|21 = 0.75
1
integrand <- function(x) {2/xˆ3} integrate(integrand,1,2)
## 0.75 with absolute error < 8.3e-15
b)
P(X > 5) = dx
integrand <- function(x) {2/xˆ3} integrate(integrand,5,Inf)
## 0.04 with absolute error < 5.8e-07
c)
8
P(4 < X < 8) = R x23dx = −x21|84 = 0.0468
4
integrand <- function(x) {2/xˆ3} integrate(integrand,4,8)
## 0.046875 with absolute error < 5.2e-16
d)
P(X < 4 or X > 8) =
integrand <- function(x) {2/xˆ3} a <- integrate(integrand,1,4) b <- integrate(integrand,8,Inf) a[[1]] + b[[1]]
## [1] 0.953125
e)
Find x, where P(X < x) = 0.95.
x
P(X < x) =
4-82
Let W be required water in million gallons. Let S be storage capacity of 350 million gallons.
µ = 310 million; σ = 45 million X ∼ N(310,452)
a)
P(W > S
pnorm(310,350,45)
## [1] 0.1870314
b)
P(W > w) = P(Z > w−45310) = 1 − Φ(45w ) = 0.01
Φ(w−45310) = 0.99 → w−45310 = 2.326 (From Cumulative Standard Normal Table) x = 414.685 million gallons
qnorm(0.99)*45+310
## [1] 414.6857
c)
P(W < w) = P(Z < w−45310) = Φ(w−45310) = 0.05
Φ(w−45310) = 0.05 → w−45310 = −1.644 (From Cumulative Standard Normal Table) x = 235.981 million gallons
qnorm(0.05)*45+310
## [1] 235.9816
d)
Find µ, X ∼ N(µ,452 P(W > S
→ µ = 350 − 2.33 × 45 = 245.15
Given 1.4 million people, mean daily demand per person = 175.107 gallons
4-117
λ = E(1X) = X = time until first call
a)
∞
P(X > −x dx = e−2 = 0.1353
integrand <- function(x) {(1/15)*exp(-x/15)} integrate(integrand,30,Inf)
## 0.1353353 with absolute error < 3.6e-05
b)
∞
P(X ≤ 10) = P(X > 10) Since expect 0 calls in first 10 minutes P(X > −x dx = e−2/3 = 0.5134 integrand <- function(x) {(1/15)*exp(-x/15)} integrate(integrand,10,Inf)
## 0.5134171 with absolute error < 8e-07
c)
10
P(5 < X < 10) = R 151 e−15x dx = e−1/3 − e−2/3 = 0.2031
5
integrand <- function(x) {(1/15)*exp(-x/15)} integrate(integrand,5,10)
## 0.2031142 with absolute error < 2.3e-15
d)
x
P(X < x) = 0.90 → P(X < x) = R 151 e−15x dx = 1 − e−x/15 = 0.90 → ln(0.10) × −15
0
∴ x = 34.5387 minutes
log(0.1)*-15
## [1] 34.53878 5-6
a)
P(X = x,Y = y) = for X ≥ 0,Y ≥ 0,X + Y ≤ 4
The table below shows the PMF table for x,y ∈ {0,1,2,3,4}
df = data.frame() library(kableExtra) library(knitr) for (i in 0:4){
c0 = choose(60,4-i)*choose(30,0)*choose(10,i)/choose(100,4) c1 = choose(60,4-1-i)*choose(30,1)*choose(10,i)/choose(100,4) c2 = choose(60,4-2-i)*choose(30,2)*choose(10,i)/choose(100,4) c3 = choose(60,4-3-i)*choose(30,3)*choose(10,i)/choose(100,4) c4 = choose(60,4-4-i)*choose(30,4)*choose(10,i)/choose(100,4) out = c(c0,c1,c2,c3,c4) df = rbind(df,out)
}
colnames(df)<-c(“x=0″,”x=1″,”x=2″,”x=3″,”x=4”) row.names(df) <- c(“y=0″,”y=1″,”y=2″,”y=3″,”y=4″)
kable(df,”latex”,align=”c”, caption=”PMF”,label=”5-6a”)%>% kable_styling(latex_options = “hold_position”)
Table 1: PMF
x=0 x=1 x=2 x=3 x=4
y=0 0.1243578 0.2618059 0.1963545 0.0621234 0.0069889
y=1 0.0872686 0.1354169 0.0665608 0.0103539 0.0000000
y=2 0.0203125 0.0206568 0.0049921 0.0000000 0.0000000
y=3 0.0018362 0.0009181 0.0000000 0.0000000 0.0000000
y=4 0.0000536 0.0000000 0.0000000 0.0000000 0.0000000
b)
fx(x) is the sum of the columns in the PMF table. fx(0) = 0.2338 ; fx(1) = 0.4187 ; fx() = 0.2679 ; fx(3) = 0.0724 ; fx(4) = 0.0069
colSums(df[ ], na.rm=TRUE)
## x=0 x=1 x=2 x=3 x=4
## 0.233828714 0.418797697 0.267907350 0.072477351 0.006988887
c)
4
E(X) = Pxi ∗ f(xi) = 1.2001
0
0*0.2338 + 1*0.4188 + 2*0.2679 + 3*0.0725 + 4*0.0070
## [1] 1.2001
d)
fY |3(y) = f xyfx(3(3),y)
From 5-6 part b, using when x=3, andfx(3) = 0.0724, the PMF
df1 = data.frame(y=c(“0″,”1″,”2″,”3″,”4”),f=c(0.857,0.143,0,0,0)) names(df1) <- c(“y”,”$f_{Y|3}(y)$”)
kable(df1,”latex”,align=”c”, caption=”PMF”,label=”5-6a”,escape = FALSE)%>% kable_styling(latex_options = “hold_position”)
Table 2: PMF
y fY |3(y)
0 0.857
1 0.143
2 0.000
3 0.000
4 0.000
e)
4
E(Y |X = 3) = Pyi ∗ fY |3(y)i = 0 ∗ 0.857 + 1 ∗ 0.143 = 0.143
0
f)
V (Y |X (Y |X = 3)2 = 02 ∗ 0.857 + 12 ∗ 0.143 − 0.1432 = 0.123 g)
X and Y are not independent.
fxy(x,y) ̸= fx(x) × fy(y) for all x and y
For example, fxy(1,1) = 0.1354 ;fx(1) = 0.4187 ;fy(1) = 0.2994
0.1354 ̸= 0.4187 × 0.2994
Q2
a)
The probability of a correct lassificationa follows a binomial distribution. P(X) = x3 × 0.98x × 0.023−x
df = data.frame() library(kableExtra) library(knitr) c0 = dbinom(0:3,3,0.98) for (x in 1:4){
out = c(c0[x]) df = rbind(df,out)
}
names(df) <- c(“P(x)”)
row.names(df) <- c(“$f(0)$”,”$f(1)$”,”$f(2)$”,”$f(3)$”)
kable(df,”latex”,align=”c”, caption=”PMF”,label=”Q2″,escape = FALSE)%>% kable_styling(latex_options = “hold_position”)
Table 3: PMF
P(x)
f(0) 0.000008
f(1) 0.001176
f(2) 0.057624
f(3) 0.941192
b)
c0 = pbinom(0:3,3,.98) df = data.frame() library(kableExtra) library(knitr) for (x in 1:4){
out = c(c0[x]) df = rbind(df,out)
}
names(df) <- c(“P(x)”) row.names(df) <- c(“$F(0)$”,”$F(1)$”,”$F(2)$”,”$F(3)$”)
kable(df,”latex”,align=”c”, caption=”CDF”,label=”Q2″,escape = FALSE)%>% kable_styling(latex_options = “hold_position”)
Table 4: CDF
P(x)
F(0) 0.000008
F(1) 0.001184
F(2) 0.058808
F(3) 1.000000
F(x) = 0 for x ≤ 0
F(x) = 1 for x ≥ 3
c)
3
E(X) = P x ∗ f(x) = 2.94
x=0 3
V (X) = P x2 ∗ f(x) − E(X)2 = 0.0588
x=0
0*.000008 + 1*0.001176 + 2*0.057624 + 3*.941192
## [1] 2.94
0ˆ2*.000008 + 1ˆ2*0.001176 + 2ˆ2*0.057624 + 3ˆ2*.941192 – 2.94ˆ2
## [1] 0.0588




Reviews
There are no reviews yet.