# Chi square goodness of fit test for Exp(1) in r

Our teacher has posted the following task: We have 100 random numbers in our disposal that come from Exp(1) and the task is to perform the chi square test in order to check if the numbers come indeed from Exp(1)(he basically wants us to get more confortable with the r environment,so we have to look for everything by ourselves*). Although i know how to perform the test and answer about the null hypothesis based on the pvalue, i have no clue on how to separate the interval from zero to infinity(in the r environment)We need that in order to calculate the probabilities. I also have in mind that we need all our expected values to be bigger than 5. Any ideas?

*we are amateurs who started using r one week ago,we are familiar with basic stuff only.

sum((Observed - 10)^2/10)

gives you the $$\chi^2$$ value, and all that's left is for you to get the p-value, for which you'll need the degrees of freedom and the appropriate function call. Hopefully that's enough to get you started!