# Modelling the variance of dollar values of the rare/mythic slot in a Magic: the Gathering booster pack

I'm trying to model the variance of a certain kind of card that is pulled from a Magic: the Gathering trading card pack. My simplified model is this:

• I open a booster pack containing exactly one card. In this instance, the probability of getting a mythic is $$w_M=\frac{1}{8}$$ and the probability of a rare is $$1-w_M=\frac{7}{8}$$, so:
• $$\frac{7}{8}$$ of the time, it is a rare card that is selected from a list of $$i$$ equally likely rare cards having dollar values $$R = (r_1,...,r_i)$$
• $$\frac{1}{8}$$ of the time, it is a mythic card that is selected from another list of $$j$$ equally likely mythic cards having dollar values $$M = (m_1,...,m_j)$$

A example set of values we can easily work with might be:

• $$R = (0.1, 0.2, 0.5, 3.0, 3.5)$$
• $$M = (0.1, 5, 10)$$

Calculating the population variance of each component of $$R$$ or $$M$$ would be straightforward:

$$\sigma^2_R=\frac{\sum^i_{k=1}{(r_i - \mu_R)^2}}{i} = \frac{(0.1-1.46)^2+(0.2-1.46)^2+(0.5-1.46)^2+(3.0-1.46)^2+(3.5-1.46)^2}{5} = 2.1784$$ $$\sigma^2_M=\frac{\sum^j_{k=1}{(r_i - \mu_M)^2}}{i} = \frac{(0.1-5.033..)^2+(5-5.033..)^2+(10-5.033..)^2}{3} = 16.3356$$

However, I'm not sure how to combine these two values into something that accurately reflects the entire model of the variance of dollar values from getting a rare card $$\frac{7}{8}$$ of the time and a mythic card $$\frac{1}{8}$$ of the time. I expect that naively averaging variances like this doesn't work, but I think this incorrect calculation hints at what I'm trying to calculate:

$$\sigma^2_{R\cap M}= \frac{7\sigma^2_{R}+\sigma^2_{M}}{8}=\frac{7\times2.1784+16.3356}{8}=3.9481$$

After doing some research of what I've modelled, this feels like trying to calculate the variance of combined weighted discrete independent uniform distributions - that is to say, each of $$R$$ and $$M$$ are discrete uniform distributions in themselves, and I'm trying to combine them together in a way that one distribution is seven times more likely to occur than the other.

When looking at combining continuous independent uniform distributions, I found the Irwin-Hall distribution, but that seems to be modelling equally likely continuous independent uniform distributions and likely more complex than what I'm looking for.

Some ideas I have to work around my inability to combine these distributions would be:

• Experimentally calculate variance by simulating a large number of pack openings
• Making some combined uniform discrete distribution $$R_7M = R\cup R\cup R\cup R\cup R\cup R \cup R \cup M$$ that has seven of each rare value and one of each mythic value (this doesn't work because there isn't typically the same number of mythic and rares)
• Doing something like above but with tuples of overall probability and dollar values like $$RM = {(\frac{7}{7i+j},r_1), ..., (\frac{7}{7i+j},r_i), (\frac{1}{7i+j},m_1), ..., (\frac{1}{7i+j},m_j)}$$ and then calculating the variance using these tuples somehow?

I'm looking for a way that for arbitrary $$P_M, R, M$$ I can either transform the problem into something that I can calculate the variance on, or a way to calculate the combined weighed variance of the two distributions. I'm sure that I'm just forgetting some basic concept of statistics and probability - this concept of combined variance feels like something that would have been covered in an introductory statistics class, but I'm just not finding the right words to describe it.

• Your $R_7M$ approach won't work unless the number of rares and the number of mythics is equal. I'd by far prefer your $RM$ approach over that. Except the probabilities should be $\frac {7i}8$ and $\frac j8$. Aug 31 at 6:30
• You are describing a mixture distribution (en.wikipedia.org/wiki/Mixture_distribution). See section "Moments" of the wikipedia link which describes how to express the variance of the mixture in terms of the variances of the components. Aug 31 at 9:38
• @Arthur I've edited my post to reflect that $R_7M$ wouldn't work and I've modified the probabilities of the tuples in $RM$. I was looking the sum of all of the probability values in the first tuple to be equal to one, which I wasn't accomplishing in my first implementation but I think I've fixed with this edit. Aug 31 at 19:52
• @nicola Mixed distributions seems to be what I'm looking for! The resources I've found so far seem to be how to calculate mixed distribution variance with continuous distributions, but I think I'm looking for discrete distributions? Unsure if I'm also still missing a concept as I'm thinking that $R$ and $M$ aren't purely discrete uniform distributions - they're all equally likely, but their values aren't uniform. Aug 31 at 19:54
• @KylePollard The equations in the wikipedia link are general, since they depend only on the properties and definitions of mean and variance. They work for both discrete and continuous, uniform or not uniform distributions. Sep 1 at 6:15

## 1 Answer

This is a mixture distribution, which in my case is a combination of two distributions.

From the Wikipedia article's section on calculating moments of a mixture distribution, the mean and variance of a mixture distribution is:

$$\mu = \sum^n_{i=1}w_i\mu_i \\ \sigma^2 = \sum^n_{i=1}w_i(\sigma^2_i + \mu^2_i) - \mu$$

We can find the variance of the mixture distribution representing the combined distribution of rares and mythics from my question, represented by $$R\cap M$$. ​First, we calculate the overall mean of our mixture distribution using $$w_R$$, $$\mu_R$$, $$w_M$$, and $$\mu_M$$:

$$w_R = \frac{7}{8}\\ w_M = 1 - w_R = \frac{1}{8}\\$$

$$\mu_{R\cap M} =w_R\mu_R+w_M\mu_M \\ = \frac{7}{8}\times1.46 + \frac{1}{8}\times5.0333 \\ = 1.9066 \\$$

Then, we'll calculate the variance of the combined distributions using the variance and mean of both distributions as well as the mixture's mean:

$$\sigma_{R\cap M} = w_R(\sigma_R^2+\mu_R^2) + w_M(\sigma_M^2 + \mu_M^2) - \mu_{R\cap M} \\ = \frac{7}{8}\times(2.1784+1.46^2) + \frac{1}{8}\times (16.3356 + 5.0333..^2) - 1.9066^2 \\ = 5.3448$$

• I had some trouble with alignment of equations here - using the \$ syntax wasn't working for me. Would someone be able to help me with the MathJax syntax on aligning my equations? Sep 1 at 7:14