Probability for a row in this Slotmachine.

50 Views Asked by At

I've thought of the following puzzle. What's the probability in the following $3 \times 3$ Slotmachine for at least one horizontal or diagonal row with the same letter to appear, given that in each column the letters $A, B, C$ are randomely placed. This means exactly $1\times A, 1\times B, 1\times C$, and $3!$ ways to fill one column. Thus for example.

$$\begin{bmatrix} A & A & A \\ B & C & C\\ C & B & B \end{bmatrix}$$

I found that in this particular case $$P(succes) =\frac{diagonal+3rows+1row}{total} = \frac{2\cdot 3\cdot (2!)^3+3!+3^2((2!)^3-2)}{(3!)^3} = 0.5$$

I found this quite surprising, and I want to play this game now with an $n \times n$ machine with $n$ different letters in each column, with the same rules. A few important observations:

  1. A distinction must be made between even $n$, and odd $n$, since with even $n$ we can have 2 diagonals at the same time, while with odd $n$ there can only be one diagonal at the same time.

  2. $P(Succes)= P(Diagonal)+P(Horizontal)$ since we can never have both horizontal and diagonal lines to appear at he same time.

For odd $n$ $$P(Diagonal) = \frac{2\cdot n\cdot (n-1)!^n}{(n!)^n} = 2n^{1-n} $$ For even $n$ $$P(Diagonal) = \frac{2n(n-1)!^n - n(n-1)(n-2)!^n}{(n!)^n} = 2n^{1-n}- (n\cdot(n-1))^{1-n}$$

Counting horizontal lines is somewhat more complicated, and i was hoping someone knew of a clever way to do this. Do we need an inclusion exclusion principle? Counting positions with at least one row, without counting double is a bigger challenge then I initially thought.