Yes, it can be done. It sounds ilke you are supposed to compute the test statistic and then estimate the p-value by using a Monte Carlo simulation from the chi-square distribution with 3 DoF. Here are some hints:
Read "How to compute p-values" to learn how to estimate a p-value when you have a test statistic and N values from the simulated chi-square distribution
The blog at https://blogs.sas.com/content/iml has many simulation articles. If you go to your favorite search engine and type keywords site:https://blogs.sas.com/content/iml then your search is restricted to only that site.
Here's what you should do:
A. Figure out how to calculate the H-L statistic for your data. THis is the "test statistic."
B. You've already generated N random observations from chi-square(3) distribution.
C. Use the formula in the "How to compute p-values..." article to estimate the p-value for your test statistic.
Good luck.
... View more