This question is based on another MSE question I saw earlier.
A biased dice can easily model a fair coin by tossing the die twice. Say that "heads" occurs if the first dice toss results in an outcome between $1$ and $3$ inclusive and the second dice toss results in $4$ to $6$ inclusive. Say that "tails" occurs if our first dice toss results in $4$ to $6$ and the second outcome is between $1$ and $3$. These occur with equal probabilities.
Suppose one repeatedly tosses the dice until they get either heads or tails (a person can get neither, for example, by getting a $1$ and then a $1$ again. If this happens, we need to toss the dice two more times). What's the expected number of times they'll need to throw the biased dice, in terms of $p_{1}, \ldots p_{6}$ where $p_{i}$ denotes the probability of seeing Face $i$ on the dice, where $i = 1, 2, \ldots 6$? ($p_{i} > 0$ for all $i = 1, \ldots 6$ and $\sum_{i = 1}^{6} p_{i} = 1$).
My try (wrong):
The individual will need to retoss the dice two more times if they obtain a number between $1-3$ twice or if they obtain a number between $4-6$ twice. The likelihood of this happening is $(\sum_{i = 1}^{3} p_{i})^{2} + (\sum_{i = 4}^{6} p_{i})^{2}$. So, the expected number of tosses is given by
\begin{align} \dfrac{\sum_{n = 0}^{\infty} n \cdot \left((p_{1} + p_{2} + p_{3})^{2} + (p_{4} + p_{5} + p_{6})^{2}\right)^{n} }{\sum_{n = 0}^{\infty} \left((p_{1} + p_{2} + p_{3})^{2} + (p_{4} + p_{5} + p_{6})^{2}\right)^{n}}. \end{align}
I simplify the sum here: Maximizing and minimizing a function of $6$ variables subject to a constraint
But, I'd like to have a function of $p_{1} \ldots p_{6}$, which I don't get. Also, I believe the answer in the above post is wrong because I think that the minimum of the expected value function should occur when $p_{i} = 1/6$ for $i = 1, \ldots 6$, and I think the expectation should be $2$ or $4$ when the $p_{i}'s$ are set to $1/6$. Where did I go wrong?
We have an experiment (toss a biased coin twice) with
We repeat the experiment (tossing twice is one step for me here) so many times, till we obtain the successful state. We need the expectation of the number of steps till success. This is: $$ \begin{aligned} E &= p + 2qp+3q^2p+4q^3p+\dots\\ &=p\cdot\left(1+2x+3x^2+\dots\right)_{\text{computed in }x=q}\\ &=p\cdot\left(1+x+x^2+x^3+\dots\right)'_{\text{computed in }x=q}\\ &=p\cdot\left(\frac 1{1-x}\right)'_{\text{computed in }x=q}\\ &=p\cdot\left(\frac 1{(1-x)^2}\right)_{\text{computed in }x=q}\\ &=p\cdot\frac 1{(1-q)^2}=\frac p{p^2}=\frac 1p\ . \end{aligned} $$ We have to take it twice, if we count the coin tosses, not the experiment steps.
The following sage code considers the fair dice, and counts the number of tosses...
And i've got this time: