DevJourney · code I wrote while learning
Question5.Rmd
450 B---
title: "Q5 — Servicing times: P(mean > 83)"
author: "Upayan Mazumder"
date: "`r Sys.Date()`"
output: html_document
---
```{r}
# Q5
mu <- 80; sigma <- 20; n <- 40
se <- sigma/sqrt(n)
z <- (83 - mu)/se
p_value <- 1 - pnorm(z)
z; p_value
xs <- seq(-4,4,length=400); ys <- dnorm(xs)
plot(xs, ys, type='l', main='Q5: P(mean > 83)', ylab='Density')
abline(v=z, col='red')
polygon(c(z, xs[xs>z], max(xs)), c(0, ys[xs>z], 0), col=rgb(1,0,0,0.3))
```