# Calculate the probability of rolling a 6 from a randomly selected die

I have a box of dice that contains a 4-sided die, a 6-sided die, an 8-sided die, a 12-sided die, and a 20-sided die. If you have ever played Dungeons & Dragons, you know what I am talking about.

Suppose I select a die from the box at random, roll it, and get a 6. What is the probability that I rolled each die?

• What have you tried? The probability you rolled the four sided die is zero. The title does not match the question in the body. – Ross Millikan May 7 '17 at 20:58
• You have tagged the question as bayes-theorem, so you clearly think that it's relevant. Have you tried using it? If not, do so and report back to us. If you have, tell us in details what didn't work out. – Arthur May 7 '17 at 21:12

$$P(\text{rolled a k-sided die } | \text{ rolled a 6}) = \dfrac{P(\text{rolled a 6 } | \text{ rolled a k-sided die}) \cdot P(\text{rolled a k-sided die})}{P(\text{rolled a 6})}$$
And $P(\text{rolled a 6}) = \dfrac{1}{5}\left(0 +\dfrac{1}{6} +\dfrac{1}{8} +\dfrac{1}{12} +\dfrac{1}{20} \right) = \dfrac{17}{200}$, meaning:
$$P(\text{rolled a k-sided die } | \text{ rolled a 6}) = \dfrac{\left(\dfrac{1}{k} \cdot [k \geq 6]\right) \cdot \dfrac{1}{5}}{\dfrac{17}{200}} = \dfrac{40}{17k} \cdot [k \geq 6]$$
Where $[x]$ is the Iverson bracket, which evaluates to $1$ if $x$ is true, and $0$ if $x$ is false.