[Math] Lottery on four-digit number

binomial-coefficientscombinatoricslotteriesprobability

In a lottery a four-digit number is chosen at random from the range 0000 − 9999. A lottery ticket costs 2. You win 50 if your ticket matches the last two digits but not the last three, 500 if your ticket matches the last three digits but not all four, and 5,000 if your ticket matches all four digits.
What is the expected payoff on a lottery ticket?

I know that we have $10^4$ possible cases but I am going crazy to understand why, for example:

$\mathbb{P}(X=0)=\frac{1\cdot 9\cdot 10\cdot 10+9\cdot 10\cdot 10\cdot 10}{10^4}$

Let $n$ be the available numbers (from $0$ to $9\Rightarrow 10$ numbers) with $k\in {[0;1]}$ that counts if I wrong the number ($1$) or not ($0$). Let $V$ and $F$ be the events that respectively I wrong and I guess a number. Given that $\mathbb{P}(VVVV)=\frac{\binom{10}{0}\binom{10}{0}\binom{10}{0}\binom{10}{0}}{10^4}$, I win zero dollars if I wrong three numbers or two numbers when the two numbers I guess are not located at the right end of the row.

Thus:

$VFFF\cup FVFF\cup FFVF\cup FFFV\Rightarrow$ for the three numbers I wrong $\binom{10}{1}\binom{10}{1}\binom{10}{1}=10\cdot 10\cdot 10$ but why $\binom{9}{1}=9$?

$VVFF\cup VFFV\cup FVFV\cup VFVF\cup FVVF\Rightarrow$ for the two numbers I wrong $\binom{10}{1}\binom{10}{1}=10\cdot 10$, for the number I guess $\binom{10}{0}=1$, but why $\binom{9}{1}=9$?

I'm sure that has to do with the position of the numbers that I guess, but why does $n$ decrease? I don't really understand. Could you please help me?

Thanks in advance.

Best Answer

Let's attack the problem from scratch. Without loss of generality, assume $0000$ is the winning number. There are $90$ ways to match the last two digits without matching further: nine choices for the third-last digit on your ticket and ten for the first (it's unconstrained). Then there are $9$ ways to match the last three without matching it all and $1$ jackpot. So the expected payoff is $$\frac{90\cdot50+9\cdot500+1\cdot5000}{10000}-2=-0.6$$ where, of course, the $-2$ represents the ticket price.

Related Question