Calculating the Payout of an Unusual Digital Slot Machine Say you have a digital slot machine. Rather than using virtual reels, this slot machine generates results using predetermined probabilities for a given symbol appearing in any position.
Given:


*

*Five 'reels' (positions for a symbol to appear)

*Wild symbols exist (and have their own probability of appearing)

*Matches must be left-aligned


How does one calculate the probability of each possible number of matches, 0-5, for a given symbol?
(A 'match' of 1 would mean a symbol appears in the left-most position, but is not followed by itself or a Wild.)
Please include in your response a formula which is readable by a layman (I'm no mathemetician).

What follows is a description of my attempts to solve this problem.
As an example: the Cherries symbol pays 4x the bet for 3 matches. In any given position, Cherries has a 20% chance of appearing, and Wild has a 2% chance of appearing.
My first attempt at calculating this probability was $0.2 * (0.2 + 0.02)^2 = 0.00968$. At least one Cherries, plus two more symbols which are either Cherries or Wild. $4 * 0.00968 = 3.872%$ pay for 3 Cherries.
It then occurred to me that this probability would seem to also include the probability of getting a match of 4 Cherries and would need to exclude the chance of the next symbol being Cherries or Wild. Thus, I updated the calculation to be $0.2 * (0.2 + 0.02)^2 - (0.2 * (0.2 + 0.02)^3) = .0075504$, giving a payout of ~3.020%. (This step is skipped if we are testing for 5 matches, since 6 matches is impossible.) Is this correct?
 A: There are two different quantities we can calculate: the probability of a match with some number of symbols, and the expected payout of a match with some number of symbols.
Let us do probability first. Say you have the Cherries symbol, which appears with a probability $p_c$, and the Wild symbol, which appears with a probability $p_w$. In your case, this would be $p_c = 0.2$ and $p_w = 0.02$. If we want to get exactly $n \geq 3$ matching symbols then the probability is
$$n \cdot p_c \cdot (p_c + p_w)^2 \cdot (p_c + p_w)^{n-3} \cdot (1 - (p_c + p_w))$$
(For $n = 5$, as you said, the last term does not need to be taken into account because there is no sixth symbol.) If we want exactly $2$ matching symbols, then the probability is
$$2 \cdot p_c \cdot (p_c + p_w) \cdot (1 - (p_c + p_w))$$
Exactly $1$ matching symbol:
$$p_c \cdot (1 - (p_c + p_w))$$
$0$:
$$1 - (p_c + p_w)$$
This is similar to what you did, except that you subtracted the probability of getting a matching symbol; you should instead multiply by the probability of not getting a matching symbol, which is $1 = 100\%$ minus whatever the probability is.
When doing probabilities, you should always remember that 'and' is translated as 'multiply', while 'or' is translated as 'add'. You want a Cherry before and no Cherries afterwards, so you multiply. Subtraction of probabilities does not have any meaning here.
The expected payoff is slightly trickier. We assume that 3 Cherries give a payoff of 4x, 4 Cherries give a payoff of 15x, and 5 Cherries, 50x. 0, 1, or 2 Cherries are worthless, in that you actually lose the money you bet. If you bet 1 monetary unit, then your expected payoff from Cherries is
$$
\begin{align}
e =\ &(1 - (p_c + p_w)) \cdot (-1) + p_c \cdot (1 - (p_c + p_w)) \cdot (-1) + \\
&2 \cdot p_c \cdot (p_c + p_w) \cdot (1 - (p_c + p_w)) \cdot (-1) + 3 \cdot p_c \cdot (p_c + p_w)^2 \cdot (1 - (p_c + p_w)) \cdot 4 + \\
&4 \cdot p_c \cdot (p_c + p_w)^3 \cdot (1 - (p_c + p_w)) \cdot 15 + 5 \cdot p_c \cdot (p_c + p_w)^4 \cdot 50
\end{align}
$$
Here, we are adding the products of probabilities and the corresponding payoffs, where for the first two terms, the payoff is $-1$ because you lose money. Note that this is the expected payoff from Cherries only; we are not including the possibility that you get 0 Cherries but instead get 4 Apples, which gives you a lot of money. To do that, we have to calculate the payoffs from each type of symbol separately and add them together.
Using the example probabilities you have given, we can write
$$
\begin{align}
e =\ &(1 - 0.22) \cdot (-1) + 0.2 \cdot (1 - 0.22) \cdot (-1) + \\
&2 \cdot 0.2 \cdot 0.22 \cdot (1 - 0.22) \cdot (-1) + 3 \cdot 0.2 \cdot 0.22^2 \cdot (1 - 0.22) \cdot 4 + \\
&4 \cdot 0.2 \cdot 0.22^3 \cdot (1 - 0.22) \cdot 15 + 5 \cdot 0.2 \cdot 0.22^4 \cdot 50 \\
\approx\ &-0.697
\end{align}
$$
So an average, you will lose $0.697$ monetary units, which is an average payout of $30.3\%$ when you play this game for Cherries (we are not counting other symbols). The expected payoffs for other symbols are also likely to be negative; in short, don't gamble! :)
Feel free to ask for clarification in the comments.
Edit: From your comments, I gather that the probabilities of $0.2$ and $0.02$ are just one part of the total probabilities of these symbols appearing. You can plug the actual figures into the formula above and get the correct average payout.
A: For $m$ matches we consider symbol sequences with C=cherry, W=wild, X=neither cherry nor wild with probabilities $p_c=0.2, p_w=0.02, p_x=1-p_c-p_w=0.78$.
Probability of $m=0$ is $p_w^5+p_w^4p_x+p_w^3p_x+p_w^2p_x+p_wp_x+p_x=0.795918$
which are sequences all-5 W (I'm not considering this a match)
or of 4 to 0 W's followed by X.
Probability of $m=1$ is one X at 2nd and one C at first: $p_cp_x=0.156$.
Note that W at first and X at second is not considered a match.
Probability of $m=2$ is one X at 3rd, 1 to 2 C's and the other W's in any order
at 1st and 2nd:
$\sum_{i=1}^2 \binom{2}{i} p_c^i p_w^{2-i}p_x =  0.03744$.
Probability of $m=3$ is one X at 4th, 1 to 3 C's and the other W's in any order
at 1st to 3rd:
$\sum_{i=1}^3 \binom{3}{i} p_c^i p_w^{3-i}p_x =  0.0082992$.
Probability of $m=4$ is one X at 5th, 1 to 4 C's and the other W's in any order
at 1st to 4th:
$\sum_{i=1}^4 \binom{4}{i} p_c^i p_w^{4-i}p_x =  0.001827072$.
Probability of $m=5$ is no X, 1 to 5 C's and the other W's in any order:
$\sum_{i=1}^5 \binom{5}{i} p_c^i p_w^{5-i} =  0.00051536$.
