library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
x<-qnorm(0.9, mean=70, sd=10)
Students will have to score at least 83 points in order to score an A on the test. The calculations were made as the following:
I used the function “qnorm” since I wanted to find the value of x that was placed in a certain range rather than the percentage.
I then wrote “0.9” in order to find the value of x when its probability is 90%, as the values above x will then represent the top 10%.
I then inserted the values of the mean and the standard deviation of the data accordingly.
sample_mean<-35
sample_std_dev<-5
sample_size<-10
percentage<-95
t_value<-qt(percentage/100,df=sample_size-1,sample_mean, sample_std_dev)
print(t_value)
## [1] 57.6914
The least weight of the milk has to be approximately 58kg. The calculation was conducted as the following:
I assigned the mean, standard deviation, sample size, and the percentage accordingly.
I used the “qt” function as I wanted to find the value that was on 95%.
I subtracted 1 from the sample size to indicate the degrees of freedom.
The final answer was 57.6914.
sample_mean <- 35
sample_std_dev <- 5
threshold <-40
sample_size <-10
t_value <- (threshold - sample_mean) / (sample_std_dev / sqrt(sample_size))
answer <- 1 - pt(t_value, df = sample_size - 1)
answer * 100
## [1] 0.5753993
Farms with the average of 40kg of milk is 58% of the whole. The calculation was conducted as teh following:
I assigned the mean, standard deviation, sample size, and the threshold accordingly.
I found the t_value by using the equation.
I subtracted pt(t_value, df=sample_size-1) from 1 to find the probability of the x value being HIGHER than the threshold.