Calculate number of faces and dices from toss samples

I have a sample of data. That data comes from tossing n dices with k faces and adding the values of each dice. How can I calculate k and n?

My approach: I know that the expected value of 1 dice of k faces is $$ E=\frac{k+1}{2} $$ and the variance is $$ Var=\frac{k^2-1}{12} $$ Because each toss is independent, the variance and expected value of tossing n dices with k faces would be $$ E=n\frac{k+1}{2},\qquad Var=n\frac{k^2-1}{12} $$

Using this, I could calculate the mean and variance of the sample and solve the system of equations which gives me $$ n = \frac{E^{2}}{E + 3 \, \mathit{Var}},\qquad k = \frac{E + 6 \, \mathit{Var}}{E} $$ The problem is that when I try with some known results, for example, 1 or 2 6 faces dice the values are incorrect. What am I doing wrong?


Solution 1:

I don't see any mistake. So I've made a sanity check. I´ve calculated $k$ and $n$ with your formulas for a one 6-sided die: $E=\frac{7}{2}, \, Var=\frac{35}{12}$

$$n = \frac{\frac{49}{4}}{\frac{7}{2} + 3 \cdot \frac{35}{12}}=\frac{\frac{49}{4}}{\frac{14}{4} + \frac{35}{4}}=1$$

$$k = \frac{\frac{7}{2} + 6 \cdot \frac{35}{12} }{\frac{7}{2}}=\frac{\frac{7}{2} + \frac{35}{2} }{\frac{7}{2}}=6$$

It seems right.