Chi squared test to confirm game is fair and consistent with paytable I have a game that people can play. They play 1.0 in game currency and can win an amount of in game currency ranging from 0.0 to 25.000 in game currency. I have orchestrated it so the expected return for a customer is 0.35.
The game has been played 17000 times and the average amount of in game currency won is 0.298 of the total amount played. How can I craft a test to check whether there is some bias somewhere? I was thinking a ch i squared test but would I need to do 17000 calculations of (win - 0.35)^2/0.35 and then sum these and compare to the chi squared table with n=17000 degrees of freedom? Or am I totally off the mark? 
 A: Chi-square test is for count data, for example the number of time a dice is rolled a 6.
What does the distribution looked like from the results of the 17000 games?  If it looks approximately normal, then calculating the z-score will determine if your game is fair.
A: *

*The chi-square test is used to test whether the observed distribution matches your theoretical orchestrated distribution.

*When you are only interrested in the question whether the observed mean 0.298 is significantly different from 0.35 then you can use a z-test. This would be valid since the sample distribution of the observed mean will approach asymptotically a normal distribution for large $n$.
We do not have information about your theoretic distribution or your observations. But in the worst (largest variance) case you have 
$$P(X) = \begin{cases} 0.014 & \text {if} & X=25.0\\
                        0.986 & \text {if} & X= 0.0\\
                        0 & \text {if} & X \notin \lbrace 25.0,0.0  \rbrace
 \end{cases}$$
This results in a mean value of 0.35 (your null hypothesis). And it has a variance of $$\sigma_X^2 = 0.014*0.986*25^2 \approx 8.63$$.
Then the variance of the mean of 17000 games is that value divided by 17000 $$\sigma_{\bar{X}}^2 = \frac{\sigma_X^2}{17000} \approx 5 \times 10^{-4}$$ Then the standard error $\sigma_{\bar{X}}$, will be around 0.023 and this means your observed difference, of $0.35-0.298 = 0.052$, is 2.3 times the standard error which is quite big (p value around 2.1%).

The underlying distribution of $X$ is not so much important. The distribution of $X$ might be discrete, but the distribution of the mean of 17000 independent draws from $X$ are not discrete and resemble a normal distribution.
(if this is like a lottery with 17000 fixed ballots, then the draws are not independent).
See this simulation:
set.seed(1)                       # set randomizer for replicability
x <- seq(25/17000/2,0.5,25/17000) # levels for histogram

# simulate 
samplemeanX <- replicate(10^5, mean(sample(    x = c(0,25), 
                                            size = 17000, 
                                         replace = TRUE, 
                                            prob = c(0.986,0.014))))
# plot histogram
hist(samplemeanX, 
     freq=0, breaks = x, xlim = c(0.25,0.45),col = 0+2*(x<=0.298),
     main="100 000 repetitions of 17 000 games", xlab = "mean of 17000 games")

# add curve based on Gaussian
sigma <- sqrt(0.014*0.986*25^2/17000)   # variance of the Gaussian
lines(x, dnorm(x , 0.35, sigma))        # plot the curve

resulting in this image:

Note that this displays the extreme case where the prices concentrate around 0 and 25. If you have more intermediate prizes then the variance of the mean of 17000 draws will be smaller and it will be even less probable than the computed 2.1%. 
Thus we can say p-value < 2.1%. (now the difficult part is how to interpret that value, is there a bias? or is this just a coincidence? .... we do not know. A statistical test can not give you a definite answer. But a reasonable person would have a certain level beyond which the coincidence is doubted and one acts as if there is a bias, even when it is not completely 100% certain.)
