Harold Nelson
2023-03-23
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.1 ✔ purrr 0.3.4
## ✔ tibble 3.2.1 ✔ dplyr 1.1.1
## ✔ tidyr 1.2.1 ✔ stringr 1.4.1
## ✔ readr 2.1.2 ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
First, let’s get immersed in a 19th century method of computing probabilities using a normal curve table.
Watch https://www.youtube.com/watch?v=xI9ZHGOSaCg
It’s only 11 minutes.
What is the probability that a pizza will be less than 16 inches in diameter if the diameters of pizzas is normal with a mmean of 16.3 and a standard deviation of .2?
## [1] 0.0668072
Do this using rdrr.io
The point is that anyone who can connect to the internet has immediate access to this level of R functionality. There is no need to install R. Do this with your phone.
Given the same assumptions as above, find the probability that a pizza has a diameter greater than 16.5?
Given the same assumption as above, what is the probability that a pizza has a diameter between 15.95 and 16.63?
## [1] 0.9104694
I asked ChatGPT to solve the problem. Here is the conversation.
https://sharegpt.com/c/A506DPO.
ChatGPT produced the correct code, but the numerical answer was different.
Read https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/Normal.
What questions are answered by these functions?
I am at the position .7 on the z-axis. How large is the area under the curve to the left of me?
## [1] 0.7580363
How about to the right of me?
## [1] 0.09680048
I see that the area under the curve to the left of me is .75. Where am I?
## [1] 0.6744898
How high above me is the curve?
## [1] 0.3011374
I want 1,000 random numbers from the standard normal distribution.
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -2.939300 -0.644394 0.004504 0.011788 0.702654 2.683616
The functions p, d, q, and r exist for every theoretical distribution. The “norm” is replaced by something else for another distribution.
For example, in the case of the binomial distribution, we have the following.