# How can I find the expected value of these dependent values?

Okay so there's a game, where you have 1 percent chance of winning an alpha pack and if you fail you your chance goes up by 3 percent. How would you calculate the expected value? I've only taken an AP stats class so the first thought would be do find the expected value from each percentage and average them

Define: $N$ as the number of plays until you win. Let the probability of winning on the $n$th play be $p_n$. Then $p_1 = 0.01$ and $p_n = p_{n-1} + 0.03,\; n \ge 2$. Notice $p_{34} = 1$.

Objective: Find $E[N]$

• Your initial probability of winning is 1% (0.01) and if your fail, you can replay with your winning chances increased by 3%? Are you trying to find the expected number of plays until you win? Also, suppose you fail on your initial play. On your next play, if your win probability 0.04 or 0.0103? What does that "increased by 3%" really mean? If you could please clarify, that would help a lot. This is sounding like a geometric series approach might work but I can't be sure at this point. – SecretAgentMan Aug 23 '18 at 3:58
• I am trying to find the expected number of plays until I win. If you lose at 1 percent you can play again at 4 percent. So .01->.04 – Nicholas Mulieri Aug 23 '18 at 4:11
• I am not skilled at phrasing, is this good? If not please suggest an edit. – Nicholas Mulieri Aug 23 '18 at 4:15
• I've suggested some edits to the question. FYI, I coded this up real quick and obtained $E[N] \approx 7.5641$. Will try and type up the analytical approach soon. – SecretAgentMan Aug 23 '18 at 4:41

This answer uses the fundamental matrix approach with an absorbing Discrete Time Markov Chain (DTMC).

Define $X_n$ as the number of plays until a win. $\{X_n,n=1,2,\ldots\}$ is a DTMC.

Let the transition probability matrix $\mathbf{P}$ be a $35\times 35$ square matrix. $P_{ij}$ is the probability you transition from state $i$ to state $j$. State 35 is a dummy state that indicates you've won.

$$\mathbf{P}_{35\times 35}= \left[ {\begin{array}{c c c c c c} 0 & 1-p_1 & 0 & 0 & \cdots & p_1\\ 0 & 0 & 1-p_2 & 0 & \cdots & p_2\\ 0 & 0 & 0 & 1-p_3 & \cdots & p_3\\ \vdots & \vdots & \vdots & & \ddots & \vdots\\ 0 & 0 & 0 & 0 & \cdots & p_{34}\\ 0 & 0 & 0 & 0 & \cdots & 1\\ \end{array} } \right]$$

There is one absorbing state (35) and 34 transient states. The matrix $\mathbf{P}$ can be written in canonical form

$$\mathbf{P} = \left[ {\begin{array}{c c c c c c} \mathbf{Q} & \mathbf{R} \\ \mathbf{0} & \mathbf{I} \\ \end{array} }\right]$$

where $\mathbf{Q}$ is a $34\times 34$ square matrix, $\mathbf{R}$ is a $34\times 1$ column vector, and $\mathbf{I}=\left[ 1 \right]$ is a trivial $1\times 1$ matrix.

The fundamental matrix $$\mathbf{S}=\left(\mathbf{I}_{34\times 34}-\mathbf{Q}\right)^{-1}$$

has the interpretation that $S_{ij}$ is the expected number of times the process is in transient state $j$ given that it started in transient state $i$.

Summing across the rows of $\mathbf{S}$ gives the total number of plays until absorption (winning) given you started in state $i$. Since we always start the game at the beginning, the quantity of interest is

$$E[N] = \sum_j^{34} S_{1j}=7.5632$$