I take that your question is to compute the expected larger outcome from two throws of a 20 sided die.
Let's make things simpler and use a die with 4 sides instead. For 2 rolls the first method yields $3.5$, the second yields $3$. Now we count all cases directly.
The equally possible outcomes are
$(1,1), (1,2), (1,3), (1,4), (2,1), (2,2), (2,3), (2,4), (3,1), (3,2), (3,3), (3,4), (4,1), (4,2), (4,3), (4,4)$
their corresponding largest values are
$1, 2, 3, 4, 2, 2, 3, 4, 3, 3, 3, 4, 4, 4, 4, 4$
with average $\frac{25}{8}$, which indicates that both answers above are wrong.
You may check the above distribution to see why the first one is wrong. The second one is wrong because we are working with discrete variables instead of continuous variables in the other post.
The correct method is to sum through all the pairs carefully, let's say we have $X_1,X_2$ drawn uniform and independently from integers on $[a,b]$, the first sum is for $X_1\neq X_2$, the $2$ factor takes care about that each one could be larger. The second sum is for cases that $X_1=X_2$.
$E(Max(X_1,X_2))=\frac{1}{(b-a+1)^2}[2\sum_{i=a+1}^{b}\sum_{j=a}^{i-1}i+\sum_{i=a}^{b}i]$
$=\frac{1}{(b-a+1)^2}[2\sum_{i=a+1}^{b}(i-a)i+\frac{(b-a+1)(a+b)}{2}]$
$=\frac{1}{(b-a+1)^2}[2\sum_{i=1}^{b-a}(i^2+ai)+\frac{(b-a+1)(a+b)}{2}]$
$=\frac{1}{(b-a+1)^2}[2(\frac{(b-a)(b-a+1)(2b-2a+1)}{6}+a\frac{(b-a)(b-a+1))}{2})+\frac{(b-a+1)(a+b)}{2}]$
$=\frac{1}{(b-a+1)}[2(\frac{(b-a)(2b-2a+1)}{6}+a\frac{(b-a)}{2})+\frac{(a+b)}{2}]$
substituting $a=1,b=20$ gives the answer $\frac{553}{40}=13.825$.
Best Answer
To summarize the discussion in the comments:
In any given trial, the answer must be $k\in \{4,5,6\}$. Any other tosses are irrelevant. Let $p_k$ be the probability that the result is $k$.
$p_4=\frac 13$ since you see $4,5$ or $6$ first with equal probability.
$p_6=\frac 12$ since you see $6$ before $4$ with probability $\frac 12$.
$p_5=\frac 16$ since the only sequence which results in $k=5$ is $5,4,6$. That is to say, the only way to get $k=5$ is to see $5$ before either $4$ or $6$ and then to see a $4$ before a $6$.
Thus the answer is $$E=4\times \frac 13+5\times \frac 16 +6\times \frac 12=\frac {31}6=5.1\overline 6$$