A particular brand of candy-coated chocolate comes in five different colors that we shall denote as A1 = {brown}, A2 = {yellow}, A3 = {orange}, A4 = {green}, and A5 = {coffee}. Let pi equal the probability that the color of a piece of candy selected at random belongs to Ai, i = 1, 2, ..., 5. Test the null hypothesis H0: p1 = 0.4, p2 = 0.2, p3 = 0.2, p4 = 0.1, p5 = 0.1, using a random sample of n = 580 pieces of candy whose colors yielded the respective frequencies 224, 119, 130, 48, and 59. You may select the significance level or give an approximate p-value.
required special directions: Use the R instruction pchisq to find the p-value; suggest