Null Hypothesis (H0):
The observed ice cream flavor distribution is the same as the expected distribution.
Alternative Hypothesis (H1):
The observed ice cream flavor distribution is different from the expected distribution.Hypotheses ## R Code
library(readxl)
## Warning: package 'readxl' was built under R version 4.6.1
A5Q1_1 <- read_excel("A5Q1-1.xlsx")
names(A5Q1_1)
## [1] "flavor"
Obs <- table(A5Q1_1$flavor)
sum(Obs)
## [1] 250
expected <- c(0.20, 0.20,0.20,0.40)
result <- chisq.test(Obs,p=expected)
result
##
## Chi-squared test for given probabilities
##
## data: Obs
## X-squared = 41.6, df = 3, p-value = 4.878e-09
Since the p-value (4.878 × 10⁻⁹) is less than the significance level of 0.05, we reject the null hypothesis.
There is sufficient evidence to conclude that the observed distribution of ice cream purchases is significantly different from the expected distribution of 20% chocolate, 20% strawberry, 20% mango, and 40% vanilla.