I have this problem:
I open a sachet of smarties and I get the following analogy:
22 brown , 19 red , 12 yellow , 15 blue and 8 green.
The question is this: Are more red smarties made than blue?
How can I answer this question using test of significance?
Thank you!
You have not shown an attempt to work this problem, so I have to guess what you are studying and what approach is intended. Here are some hints in what I hope is the right direction.
Assume that your sachet is a random sample from production. Then you have a random sample of $15+19 = 34$ red and blue smarties of which $X = 19$ are red. Under the null hypothesis that red and blue smarties are equally likely, $X \sim \mathsf{Binom}(n=34,\, p=1/2).$
The P-value of a test of this null hypothesis, against the one-sided alternative that red ones are more likely, is $P(X \ge 19) = 0.3038.$ (You can compute this probability using the formula for the binomial PDF (or PMF), using printed tables of this binomial distribution, or using software. Also, you could get a reasonably accurate result using the normal approximation to the binomial distribution. (I will leave that part for you.)
Because the P-value exceeds $0.05 = 5\%$ you cannot reject the null hypothesis at the 5% level of significance. Also, if the two colors are equally likely, then you might 'expect' to get about 17 each of red and blue, but taking random variation into account you would have to allow for a little variation one way or the other. From this point of view, the difference between 17 and 19 is hardly surprising.
Another approach to analyzing these data would be to use a chi-squared goodness-of-fit (GOF) test to see if all five colors are equally likely. Then the observed counts are $X = (22, 19, 12, 15, 8)$ and the corresponding expected counts are all $E = 76/5 = 15.2.$ The GOF statistic is $$Q = \sum_{i=1}^5 \frac{(X_i - E)^2}{E} = 8.08.$$ Under the null hypothesis that all colors are equally likely, $Q \stackrel{aprx}{\sim} \mathsf{Chisq}(df=4),$ and you would reject the null hypothesis at the 5% level if $Q > 9.488.$ So you do not have evidence to claim that the various colors have different probabilities. That is not proof that all colors have probability $1/5$ of occurring, but you do not have a large enough sample to cast doubt on that.
The procedure for doing the GOF test in R statistical software is shown below. If you have not already studied the GOF test, perhaps you will encounter it soon.