The probability that you choose correctly one digit is 1/10 = 0.1, then the probability that you choose correctly all 4 digits is (1/10)^4 = 1/10000 = 0.0001. The probability that you lose is 1 - 0.0001 = 0.9999.

The expected value of the game is 5000 * 0.0001 + (-1) * 0.9999 = 0.5 - 0.9999 = -0.4999.