We have a game where your payout is $2^k$ where $k$ is the number of times you flipped a coin to land on heads (if your first flip is a head, then $k=1$). Then the expected payout is: $$E = \frac{1}{2}(2) + \frac{1}{4}(4) + \frac{1}{8}(8)+…$$
$$E=1+1+1+…$$
$$E=\infty$$How much should I pay to play this game?
Well we know from the geometric distribution the expected number of coins I’ll flip until getting a head is:
$$\frac{1}{P(HEAD)} = \frac{1}{.5}=2$$
So I will pay anything less than $2^k$ with $k=2$:
i.e. < 4 dollars
https://en.wikipedia.org/wiki/St._Petersburg_paradox for reference
Answer

Let $K$ be some random variable.
 In your problem, $K$ is number of times you flip before getting heads.

Let $f(k)$ be some payoff function.
 In your problem $f(k) = 2^k$.

Let $f(K)$ be the payoff
You’re saying that a reasonable valuation of the gamble $f(K)$ is given by $f(\mathrm{E[}K])$. This is an entirely adhoc, rather unprincipled heuristic. Perhaps fine in some situations (eg. where $K$ is small and $f$ near linear), but it’s easy to construct an example where it suggests something nonsensical.
Example where your system makes absolutely no sense
Let $K$ be a draw from the normal distribution $\mathcal{N}(0,10000000000000)$ and let the payoff function be $f(K) = K^2$. Your system says I shouldn’t pay more than $0$ for this gamble because $f(\mathrm{E}[K]) = 0^2 = 0$. But shouldn’t you assign some positive value to this gamble?! There is a 100% probability the payoff is greater than zero!
A more classic resolution of the St. Petersburg Paradox
One approach is to add riskaversion. If you’re sufficiently risk averse, what you’re willing to pay to play this infinite expectation gamble will be finite. If you accept the Von NeumannMorgernstern axioms, then the certainty equivalent of playing the game is given by $z$ where:
$$u(w + z) = \mathrm{E}[ u(w + f(K)) ] $$
and where $w$ is your wealth and $u$ is a concave function (in jargon, a Bernoulli utility function) which captures your level of risk aversion. If $u$ is sufficiently concave, the valuation of $2^K$ will be finite.
A Bernoulli utility function with some nice properties turns out to be $u(x) = \log(x)$. Maximizing expected utility where the Bernoulli utility function is the log of your wealth is equivalent to maximizing the expected growth rate of your wealth. For simple binary bets, this gives you Kelly Criterion betting.
An important other point is that the risk aversion approach leads to different certainty equivalents depending on what side of the gamble you are on.
Attribution
Source : Link , Question Author : colorlace , Answer Author : Matthew Gunn