# How to test whether the probability of a given colour of skittle is equal to that of another colour? [closed]

From a family pack skittles, some of the colours of different skittles are counted:

• 41 green,
• 48 purple
• 100 red
• 63 yellow.

Now I want to test if the probabilty of green is equal to the probability of purple; H0: P(green) = P(purple).

• How do I test this is R?
• Do I use a chi square test?
• Could you explain what you mean by "probability" in this context? For instance, if we were to draw one candy at random out of this pack, the probability of getting a green would equal $41/(41+48+100+63)$ and the probability of getting a purple would be similarly computed: it's obviously greater and the question is entirely trivial.
– whuber
Oct 4, 2011 at 16:17
• @whuber I suspect the question is the usual "Is this random chance or is there a systematic pro-Reddist conspiracy in the depths of the Skittle factory?" Oct 5, 2011 at 1:40
• @Epi Probably, but it usually isn't fruitful to answer a question based on what one suspects it might mean. A great answer to a vague question can often confuse more than it helps. That's why I have invited Wimpey to clarify this.
– whuber
Oct 5, 2011 at 1:52
• I have solved my problem, and for those interested in the answer, here is my R I/O: x = c(41, 48) chisq.test(x, p=c(0.5, 0.5))\$p.value 0:4580882. I hope this also clarifies my question, I am not sure how to formulate it in another way then I did before. Thanks for the help though. Oct 5, 2011 at 14:18
• For the record, Wimpey's solution in the comments above is incorrect and tests something completely different to what he/she originally asked. Jan 24, 2012 at 11:13