Here are solutions for some very special cases. Assume, without loss of generality, that $\ p> q\ $.
If $\ p+q \le 1\ $, and $\ \delta\le \frac{1-q}{2-p-q}\ $, you can keep my expected winnings to at most $\ \frac{100\,(1-q)}{2-p-q}\ $ dollars by choosing coin $1$ with probability $ \frac{1-q}{2-p-q}\ $ and coin $2$ with probability $ \frac{1-p}{2-p-q}\ $. I can ensure that my expected winnings are at least $\ \frac{100\,(1-q)}{2-p-q}\ $ dollars by guessing coin $1$ if the result of the first toss is heads, or coin $1$ with probability $ \frac{1-p-q}{2-p-q}\ $ and coin $2$ with probability $ \frac{1}{2-p-q}\ $ if the result of the first toss is tails. Because I can't win more than $\ 100\,\delta \le \frac{100\,(1-q)}{2-p-q}\ $ dollars by waiting until the next toss, I have nothing to gain by doing so.
If $\ p+q = 1\ $ (and therefore $\ p>\frac{1}{2}\ $, given the above assumption that $\ p>q\ $), and $\ \delta\le p $, you can keep my expected winnings to at most $\ 100\,p\ $ by choosing either coin $1$ or $2$ with probability $\ \frac{1}{2}\ $ each. I can ensure my expected winnings are at least $\ 100\,p\ $ by guessing coin $1$ if the result of the first toss is heads, or coin $2$ if the result of the first toss is tails. Again I can do no better by waiting for the second toss.
If $\ p+q > 1\ $, and $\ \delta\le \frac{p}{p+q}\ $, you can keep my expected winnings to at most $\ \frac{100\,p}{p+q}\ $ by choosing coin $1$ with probability $\ \frac{q}{p+q}\ $ and coin $2$ with probability $\ \frac{p}{p+q}\ $. I can ensure my expected winnings are at least $\ \frac{100\,p}{p+q}\ $ by guessing coin $2$ if the result of the first toss is tails, or coin $1$ with probability $\ \frac{1}{p+q}\ $ and coin $2$ with probability $\ \frac{p+q-1}{p+q}\ $ if the result of the first toss is heads.Once again, I can't do better by waiting for the second toss.
Yes, your construction is optimal! Suppose there are $N$ flips (e.g. $N=100$).
I have two proofs:
- A simple logical proof that gives a sufficient condition for optimality.
- A more involved mathematical proof that gives necessary and sufficient conditions.
Both of them involve the same setup.
Setup
Denote a guessing strategy $G = (G_{yes}, G_{no})$ where $G_{yes}, G_{no} \in \{ H, T \}^{N}$ characterizes your guess when the answer is "yes" or "no" (irrespective of the question asked). Denote the question $Q$ as a subset of the power set of $\{ H, T \}^{N}$ and the expected payoff by $S(G,Q)$.
Fix any $G$, the optimal question $Q_{G}$ is whether $G_{yes}$ leads to a strictly higher payoff than $G_{no}$? Any other question can only lead to a lower expected payoff by sometimes resulting in the worse guess. (The optimal question is unique up to how ties between the payoff of $G_{yes}$ and $G_{no}$ are included in the question. Here, $Q_{G}$ is constructed so that all ties are answered "no.")
Denote the expected payoff when the optimal question is asked by $S^{*}(G)=S(G,Q_{G})$. Notice it is much easier to choose two sequences of flips ($G$) than to choose any subset of all such flips ($Q$)!
Lemma: $S^{*}(G)$ only depends on the number of flips ($N$) and the number of flips for which $G_{yes}$ and $G_{no}$ differ ($n$).
Proof: Suppose $G_{yes}$ and $G_{no}$ differ for exactly $n$ flips, then any other guess $\hat{G}_{yes}$ and $\hat{G}_{no}$ that differs for exactly $n$ flips can be generated from $G$ by relabelling the sides of each coin flip.
Sufficient Condition
Result: Increasing the number of flips for which $G_{yes}$ and $G_{no}$ differ weakly increases the expected payoff.
Proof: If $G_{yes}$ and $G_{no}$ are the same for flip $k$, then flip $k$ is independent of the answer to question $Q_{G}$ since it doesn't change the relative payoffs. Let $\hat{G} = (\hat{G}_{yes},G_{no})$ where $\hat{G}_{yes}$ is the same as $G_{yes}$ but for flip $k$, then $\hat{G}$ gives the same expected payoff as $G$ when question $Q_{G}$ is asked, therefore:
$$S^{*}(G) = S(G,Q_{G}) = S(\hat{G},Q_{G}) \leq S(\hat{G},Q_{\hat{G}}) = S^{*}(\hat{G})$$
(Note that our specific construction of $Q_{G}$ was needed to say flip $k$ is independent of the answer to question $Q_{G}$.) Therefore, a sufficient condition is that the guesses differ on every flip. This may not be necessary because increasing the number of flips for which $G_{yes}$ and $G_{no}$ differ only weakly increases the expected payoff.
Sufficient Condition: $S^{*}(G)$ is maximized if $G_{yes}$ and $G_{no}$ are different for every flip.
Necessary and Sufficient Condition
Lemma: Let $n$ denote number of coin flips for which $G_{yes}$ and $G_{no}$ differ, then:
$$S^{*}(G) = N/2 + \mathbb{E}|X_{n}-n/2|$$
Where $X_{n} \sim \text{Binomial}(n,1/2)$.
Proof: The probability of correctly guessing any coin flip where $G_{yes}$ and $G_{no}$ agree is $1/2$. Consider the $n$ coin flips where $G_{yes}$ and $G_{no}$ are different, if $X_{n}$ of these flips agree with $G_{yes}$ then $n-X_{n}$ flips agree with $G_{no}$, thus:
$$
\begin{align}
S^{*}(G) &= (N-n)/2 + \mathbb{E}\left[\max(X_{n}, n-X_{n})\right] \\
&=N/2 + \mathbb{E}|X_{n}-n/2|
\end{align}$$
This expression strictly increases when $n$ increases by one from even to odd but is constant when $n$ increases by one from odd to even. (Source: "A Derivation of the Mean Absolute Distance in One-Dimensional Random Walk" by Hižak and Logożar, Tehnički glasnik 2011.) This relationship between $S^{*}$ and $n$ implies the following result:
***Result: If $N$ is odd, $S^{*}(G)$ is maximized if and only if $G_{yes}$ and $G_{no}$ differ for every flip. If $N$ is even, $S^{*}(G)$ is maximized if and only if $G_{yes}$ and $G_{no}$ are the same for at most one flip.
If $N=100$
Your $G_{yes}$ is all heads and $G_{no}$ all tails, so it satisfies this property, and your question is optimal: does $G_{yes}$ give strictly higher payoff than $G_{no}$? In other words, are there strictly more than $50$ heads?
Because $N$ is even, any other pair of guesses that are the same for at most one flip would also correspond to an optimal strategy.
Best Answer
Not quite a closed form but here is a simplification.
Let $X$ be a random variable denoting the number of rounds that the game lasts. First we use the fact that $$\mathbb{E}[X] = \sum_{n=0}^{\infty} \mathbb{P}(X > n) = 1 + \sum_{n=1}^{\infty} \mathbb{P}(X > n).$$
$X>n$ if and only if rounds $1,2,\ldots, n$ are won. The probability we win round $n$ is $1/2$ if $n$ is odd and $\frac{1}{2} \left( 1 - \frac{ \binom{n}{n/2} }{2^n} \right)$ if $n$ is even. Therefore we have
$$ \mathbb{E}[X] = 1 + \sum_{n=1}^{\infty} \frac{1}{2^n} \prod_{m=2,4,6,\ldots}^n \left(1 - \frac{ \binom{m}{m/2} }{2^m} \right)$$
Using the first $150$ terms of this series gives the value to $50$ correct decimal places:
$$\mathbb{E}[X] \approx 1.7229609314217239880589009988703907210042264264132$$
Here is the Python code I used to generate the value. It runs in about 0.6 milliseconds on my machine.