# A fair six sided die is rolled $5$ times. What is the probability that a perfect square will appear exactly twice?

I know that these rolls are independent events and order does not matter so this is a combination problem. I know that on a six sided die there are $2$ perfect squares $(1,4)$. Do I just do $5 \choose 2$ (Five times, two perfect squares) or is there another way to do this problem. Thanks in advance.

That's almost it. You multiply the probabilities of getting it 2 times and not getting it 3 times in a specific order, by the count of permutations of that order. It's a binomial distribution.

$p=\frac 2 6, n=5, k=2 \implies$

$${n\choose k}p^k(1-p)^{(n-k)} = \frac{^5C_2 2^2 4^3}{6^5} \\ = \frac{80}{243}$$

For "exactly" questions, you need to calculate the probability of one specific result, then multiply by the different ways to arrange it. So, for example, calculate the probability of two perfect squares appearing in the first two slots:

Perfect square, perfect square, not perfect square, not perfect square, not perfect square

Then multiply by the number of ways to rearrange this ordering (which is $_5C_2$ as you say above).

If you want to go for a counting argument you must be abit careful. There are precisely $3$ ways to choose the two perfect squares namely $\{1,1\}$, $\{4,4\}$ and $\{1,4\}$. Then you need to think about how many ways can two items be placed in a string of 5 outcomes, remember that in the first two cases the numbers are the same and so order of placement is irrelevant. If we have a repeated square there are $5C2$ placements for each leaving us with $2\times 5C2$ placements in total. Similarly if we have distinct squares appearing there are also $2\times 5C2$ placements (once we pick the two slots to place the squares in there are two ways to do it). The remaining squares must be filled with only the numbers from the set $\{2,3,5,6\}$ and as repetition is allowed we get a total of $4 \times 5C2 \times 4^{3}$. Finally there are $6^{5}$ possible outcomes.