Sunday, May 30, 2021

Dakota Jones and the Crystal Pyramidal Key

Dakota Jones needs a crystal key to gain access to a hidden temple deep in the Riddlerian Jungle. She already knows the crystal is a polyhedron, and according to an ancient text, it has exactly six edges, five of which are 1 inch long. Cryptically, the text does not specify the length of the sixth edge. Instead, it says that the key is the largest such polyhedron (i.e., with six edges, five of which have length 1) by volume.

Once again, Dakota Jones needs your help. What is the volume of the crystal key?

So firstly, Dakota surmises that with only six edges, she must be looking for a polyhedron with $V=4$ vertices, since there would then be $E = \binom{V}{2} = 6$ edges. Furthermore, she can reduce the problem by assuming that at least one face of the polyhedron must be a triangular prism, where at least one face must be an equilateral triangle (since $5$ out of the $6$ edges are unit length).

So without loss of generality, Dakota will assume that the equilateral triangle is situated along the $xy$-plane with vertices as $(0,0,0),$ $(1,0,0)$ and $(1/2, \sqrt{3}/2,0).$ Let $v = (x,y,h)$ be the remaining vertex. Without loss of generality, we would have that the distance from $(0,0,0)$ to $v$ is $1$ and the distance from $(1,0,0)$ to $v$ is 1, that is, $$x^2 + y^2 + h^2 = 1 \,\,\,\text{and}\,\,\, (x-1)^2 + y^2 + h^2 = 1.$$ Furthermore, the volume of such a triangular pyramid would be $$V(h) = \frac{1}{3} B h = \frac{\sqrt{3}}{12} h.$$

By symmetry, for any $y$ and $h,$ if $(x,y,h)$ solves both equations then we must have $(x-1)^2 = x^2,$ or $x = \frac{1}{2}.$ Therefore, we must have $v = (1/2,y,h)$ and we can solve for $h$ in terms of the variable $y$ (without loss of generality choosing the positive solution) to get $$h(y) = \frac{\sqrt{3-4y^2}}{2},$$ so for any $|y| \leq \sqrt{3}/2$ the vertex $v_y = (1/2, y, \frac{\sqrt{3-4y^2}}{2})$ is the remaining vertex of a possible $6$-edged polyhedron with $5$ sides of length $1.$ Since we are looking for the polyhedron with largest volume, we have see that $$\tilde{V}(y) = V(h(y)) = \frac{\sqrt{3 (3 - 4y^2)}}{24},$$ which has maximal value when $y = 0.$ In this case, the optimal vertex is located at $(1/2, 0, \sqrt{3}/2)$ and the volume of the cyrstal key is $$V_\max = \tilde{V}(0) = \frac{1}{8}.$$

Mariners have their work cut out for them

In 2009, the leaguewide on-base percentage was $0.333$. That figure has fallen over the past decade, and this year, it’s all the way down to $0.313$, which helps explain the surge in no-hitters.

Assume that all batters have the same chances of reaching base, that at-bats are independent from each other, that there are 30 MLB teams, and each club plays 162 games, and that no games go into extra innings.How low would a batter’s chances of reaching base have to be for you to expect one perfect game per season?

Let's assume that the leaguewide on-base percentage (OBP) is $a$ with all of the other simplifying assumptions above, then the expected probability of a perfect game is $(1-a)^{27}$ with an expected number of perfect games being $P(a) = 4860(1-a)^{27}$. So solving for $P(a)=1$ gives a league-average OBP of $$a = 1 - 4860^{-1/27} = 0.26977295.$$

Having obscurely avoided a perfect game against the Orioles earlier this year based on Sam Hagerty reaching first base on a dropped third strike, my Seattle Mariners are leading the charge towards this abysmal on-base percentage with only $0.281$ so far this year (through Sunday, May 30). That level of futility would blow past the previous Wild Card Era (since 1995) full 162-game record held by the 2014 Padres and (ugh, . . . of course) 2011 Mariners of $0.292,$ and even eke under the Pirates' COVID shortened 2020 mini-season low of $0.284$. (The soon-to-be-known-as Cleveland Baseball Team is also in the hunt for new Wild Card Era lows in OBP this season sitting at $0.290$.)

Los Marineros are simultaneously chasing the record for most no hitters thrown against them, just one behind the 1906 Brooklyn Superbas record of 3 no hitters against. (Here, again, the M's will need to shake off some competition as both the Cleveland Baseball Team and the Texas Rangers are also vying for most no hitters against record this year.)

All this to say, at least they are no where near the $0.171$ OBP that any individual team would have to average a perfect game against per year. Sometimes, you have to just throw out the glass and claim that you weren't ever interested in how much water there may or may not have been in there in the first place. Wait, what were we talking about?

P.S. Go M's!

Monday, May 24, 2021

It ain't easy, cutting cheesy!

The Riddler Cheese Company is producing what are called “craft triples” — triangular slices of cheese whose side lengths are Pythagorean triples, when measured in inches.

However, the company’s slicing machine recently malfunctioned and produced a stock of square slices with side lengths of 5 inches. To salvage this situation, what is the greatest number of whole Pythagorean slices that can be made from each 5-inch square? (Note: You can only cut pieces out of the square. No melting or gluing pieces together!)

Since every other Pythagorean triple would be too large for a $5 \times 5$ square, we have to figure out how many $3-4-5$ triangles can fit into it. Since the hypotenuse of a $3-4-5$ triangle is, well, $5$ inches long, we can fit four triangles in with the hypotenuse along each side of the square.

Extra credit: What is the smallest square of cheese such that 100 percent of the square can be partitioned into craft triples?

The smallest Pythagorean triple is $3-4-5$, which has an area of $6$ square inches. We would need to have an $N \times N$ square where $6 \mid N^2$ in order to be able to completely tile it with $3-4-5$ triangles. If we have $N = 12$, then we can tile the $12 \times 12$ square with $4$ rows of three $3 \times 4$ rectangles each. These rectangles can then be broken down into two $3-4-5$ triangles apiece. The only other possible smaller value of $N$ would be $6,$ in which case there would need to be six $3-4-5$ triangles. However, since $3 + 4 > 6$ there is no way to jam more than two triangles next to one another in both dimensions of the $6 \times 6$ square, thus we cannot completely fill up the square.

Note that by the time you get to the $12 \times 12$ triangle, you don't have to rely on $3-4-5$ triangles, as you can also throw in some of the next largest $5-12-13$ Pythagorean triples.

Sunday, May 16, 2021

Cake or countably infinite friends?

You and your infinitely many friends are sharing a cake, and you come up with two rather bizarre ways of splitting it.

For the first method, Friend 1 takes half of the cake, Friend 2 takes a third of what remains, Friend 3 takes a quarter of what remains after Friend 2, Friend 4 takes a fifth of what remains after Friend 3, and so on. After your infinitely many friends take their respective pieces, you get whatever is left.

For the second method, your friends decide to save you a little more of the take. This time around, Friend 1 takes $1/2^2$ (or one-quarter) of the cake, Friend 2 takes $1/3^2$ (or one-ninth) of what remains, Friend 3 takes $1/4^2$ of what remains after Friend 3, and so on. Again, after your infinitely many friends take their respective pieces, you get whatever is left.

How much of the cake do you get using the first method? How much of the cake do you get using the second method?

When you've invited over infinitely many friends, I suppose the unstated alternative of just getting more cake becomes less feasible, so let's figure out how much of the original cake you would be left with. Your countably infinite friends are given your explicit ranking of them, from which they know how much cake to cut using the various methods, and you know what they seem surpringingly cool with the entire setup. Let's say that the amount remaining after the $n$th friend takes her slice is $C_n^i$ when using method $i$.

Under method $1$, the $(n+1)$th friend takes a piece measuring $\frac{1}{n+2}C_n^1$ leaving the recurrence equation of $$C_{n+1}^1 = \left(1- \frac{1}{n+2}\right) C_n^1.$$ We can iterate backward to find that \begin{align*}C_{n+1}^1 &= \prod_{i=1}^{n+1} \left( 1 - \frac{1}{i+1} \right) = \prod_{i=1}^{n+1} \frac{i}{i+1} \\ &= \frac{n!}{(n+1)!} = \frac{1}{n}.\end{align*} Since you are a good friend you are at the end of the line and would receive $$C^1_\infty = \lim_{n \to \infty} C^1_n = \lim_{n \to \infty} \frac{1}{n} = 0$$ under method $1,$ which is not so great. Maybe method $2$ will yield some non-zero cake amounts left for you.

Under method $2$, the $(n+1)$th friend takes a piece measuring $\frac{1}{(n+2)^2} C^2_n$ leaving the recurrence equation of $$C_{n+1}^2 = \left(1 - \frac{1}{(n+2)^2}\right) C_n^2.$$ We can iterate backward to find that \begin{align*}C^2_{n+1} &= \prod_{i=1}^{n+1} \left(1 - \frac{1}{i+1}^2 \right) = \prod_{i=1}^{n+1} \frac{(i+1)^2 - 1}{(i+1)^2} \\ &= \prod_{i=1}^{n+1} \frac{(i+2) i}{(i+1)^2} = \frac{\frac{(n+4)!}{2} (n+2)!}{((n+3)!)^2} \\ &= \frac{n+4}{2(n+3)}.\end{align*} In this case, you receive $$C^2_\infty = \lim_{n\to \infty} C^2_n = \lim_{n\to\infty} \frac{n+3}{2(n+2)} = \frac{1}{2},$$ which is altogether not too shabby! In effect, method $2$ leaves you with twice the amount of anyone else and just as much as anyone would get under method $1.$


Your friends are feeling rather guilty for not saving enough of the cake for you, so they try one more method. (Though to be fair, these are some extremely nice friends to be upset that you took half of the cake under method $2.$ Though, maybe it took you a long time to source this infinitely divisible cake, or you figured out how to effectively distribution food to infinitely many people, so OK I guess some gratitude is deserved.) This time, they only take the fractions with even denominators from the second method. So Friend 1 takes $1/2^2$ of the cake, Friend 2 takes $1/4^2$ of what remains, Friend 3 takes $1/6^2$ of what remains after Friend 2, and so on. After your infinitely many friends take their respective pieces, how much of the cake do you get?

Under this bonus $3$rd method, the $(n+1)$the friend takes a piece measuring $\frac{1}{4(n+1)^2} C_n^3$ leaving the recurrence equation of $$C_{n+1}^3 = \left(1 - \frac{1}{4(n+1)^2}\right) C_n^3$$ We can iterate backward to find that \begin{align*}C^3_{n+1} &= \prod_{i=1}^{n+1} \left(1 - \frac{1}{4i^2} \right) = \prod_{i=1}^{n+1} \frac{(4i^2 - 1)}{4i^2} \\ &=\prod_{i=1}^{n+1} \frac{(2i+1)(2i-1)}{4i^2} = \frac{(2n+3)!! (2n+1)!!}{4^{n+1} ((n+1)!)^2},\end{align*} where $n!!$ is the double-factorial and in particular the following identity holds $$(2n-1)!! = (2n+1)(2n-1) \cdots 5 \cdot 3 \cdot 1 = \frac{(2n)!}{2^n n!}.$$ So we have $$C_n^3 = \frac{(2n+1)!! (2n-1)!!}{4^n (n!)^2} = \frac{ \frac{(2n+2)!}{2^{n+1}(n+1)!} \frac{(2n)!}{2^{n} n!}}{4^n(n!)^2} = \frac{(2n+2)! (2n)!}{2^{4n+1} (n+1)! (n!)^3}.$$ Using Stirling's approximation of $n! \sim \sqrt{2\pi n} (n/e)^n$ we get \begin{align*} C^3_n &\sim \frac{ \sqrt{2\pi (2n+2)} ((2n+2)/e)^{2n+2} \sqrt{4\pi n} (2n/e)^{2n}}{2^{4n+1} \sqrt{2\pi(n+1)} ((n+1)/e)^{n+1} \left(\sqrt{2\pi n} (n/e)^n\right)^3}\\ & =\frac{(2\pi) \, \sqrt{(n+1)n} \, 2^{4n+3} \, (n+1)^{2n+2} \, n^{2n} \, e^{-(4n+2)}}{(2\pi)^2 \, \sqrt{(n+1)n} \, 2^{4n+1} \, (n+1)^{n+1} \, n^{3n+1} \, e^{-(4n+1)}}\\ &=\frac{2}{\pi e} \left(1 + \frac{1}{n}\right)^{n+1}\end{align*} Since $\ln (1 + 1/x) = \frac{1}{x} - \frac{1}{2x^2} +O(x^{-3})$ as $x \to \infty,$ we have $$\left(1 + \frac{1}{n}\right)^{n+1} = \exp \left( (n+1) \ln \left(1 + \frac{1}{n}\right) \right) = \exp\left(1 + \frac{1}{2n} + O(n^{-2})\right) \to e.$$ Thus, under method $3$ you are left with a whopping $$C^3_\infty = \lim_{n\to\infty} C^3_n = \lim_{n\to \infty} \frac{2}{\pi e} \left(1 + \frac{1}{n}\right)^{n+1} = \frac{2}{\pi} \approx 63.66\%.$$

Monday, May 10, 2021

A numerical game of Mine's Bigger

Martina and Olivia each secretly generate their own random real number, selected uniformly between 0 and 1. Starting with Martina, they take turns declaring (so the other can hear) who they think probably has the greater number until the first moment they agree. Throughout this process, their respective numbers do not change.

They are playing as a team, hoping to maximize the chances they correctly predict who has the greater number. For any given round with randomly generated numbers, what is the probability that the person they agree on really does have the bigger number?

Extra credit: Martina and Olivia change the rules so that they stop when Olivia first says that she agrees with Martina. That is, if Martina says on her turn that she agrees with Olivia, that is not a condition for stopping. Again, if they play to maximizing their chances, what is the probability that the person they agree on really does have the bigger number?

Martina and Olivia are excellent Bayesian statisticians and after each response they update the current bounds for the other's random value. In particular, after $k$ responses from Olivia, there are estimates $O_\text{lo}^k, O_\text{hi}^k$ and $M_\text{lo}^k, M_\text{hi}^k$ such that Martina believes that Olivia's number is distributed as $U(O_\text{lo}^k, O_\text{hi}^k)$ and Olivia believes that Martina's number is distributed as $U(M_\text{lo}^k, M_\text{hi}^k).$ Given this assumption and that Martina knows the realization of her own random process $m$, she will respond for her $k$th response that she believes her own value is bigger whenever $$\mathbb{P} \{ O \leq m \mid O \sim U(O_\text{lo}^k, O_\text{hi}^k) \} \geq 0.5$$ and that Olivia's number is larger otherwise. Similarly, since Olivia knows ther realization of her own random process $o,$ Olivia's $k$th response will similarly be that she believes her own value is bigger whenever $$\mathbb{P} \{M \leq o \mid M \sim U(M_\text{lo}^k, M_\text{hi}^k) \} \geq 0.5.$$

Based on the faithful behavior of the players to estimate which of them have the larger number based on all of the available inforation, the updating procedure for $O_\text{lo}^k, O_\text{hi}^k, M_\text{lo}^k$ and $M_\text{hi}^k$ are interrelated, with \begin{align*} M_\text{lo}^k &= \begin{cases} \frac{1}{2}(O^{k-1}_\text{lo} + O^{k-1}_\text{hi}), &\text{if Martina says her number is bigger}\\ M^{k-1}_\text{lo}, &\text{if Martina says Olivia's number is bigger}\end{cases}\\ M_\text{hi}^k &= \begin{cases} M^{k-1}_\text{hi}, &\text{if Martina says her number is bigger}\\ \frac{1}{2}(O_\text{lo}^{k-1} + O_\text{hi}^{k-1}), &\text{if Martina says Olivia's number is bigger}\end{cases}\\ O_\text{lo}^k &= \begin{cases} O^{k-1}_\text{lo}, &\text{if Olivia says Martina's number is bigger}\\ \frac{1}{2}(M^{k-1}_\text{lo} + M^{k-1}_\text{hi}), &\text{if Olivia says her number is bigger}\end{cases}\\ O_\text{hi}^k &= \begin{cases} \frac{1}{2}(M^{k-1}_\text{lo} + M^{k-1}_\text{hi}), &\text{if Olivia says Martina's number is bigger}\\ O_\text{hi}^{k-1}, &\text{if Olivia says her number is bigger}\end{cases}\end{align*}

For any $(m,o) \in [0,1] \times [0,1],$ the gameplay can be characterized by a finite string in the alphabet $\{M,O\}$ corresponding the concatenating Martina's and Olivia's responses until there is either an instance of $MM$ or $OO.$ We can carve up the unit square $[0,1] \times [0,1]$ into response regions where each $(m,o)$ in that region would lead to the same response history from Martina and Olivia in their game. So, for instance the $MM$ region is $[0.5,1] \times [0,0.75],$ and the subregion within $MM$ where the identified player does not have the largest number is a right isoceles triangle with side length $0.75 - 0.5 = 0.25.$ On the flip side the $OO$ region is $[0,0.5] \times [0.25,1]$ and also has a misidentified region that is right isoceles triangle with side length $0.25.$ So if the gameplay string has $2$ characters, the mischaracterization region has area (1/4)^2.$

Moving further, we see that the regions $MOO$ given by $[0.5,0.875] \times [0.75,1]$ and $OOM$ given by $[0.125,0.5] \times [0,0.25]$ are congruent and each has a misidentification region shaped like a right isoceles with side length $0.125.$ If the gameplay string has $3$ characters, then the misidentification region has area $(1/8)^2.$ Moving further on, we see that if the gameplay string has $k$ characters, then the misidentification region has area $(1/2^k)^2 = 4^{-k}$. Therefore, the entire misclassification region has area given by $$\sum_{k=2}^\infty \frac{1}{4^k} = \frac{1}{1-\frac{1}{4}} - 1 - \frac{1}{4} = \frac{4}{3} - \frac{5}{4} = \frac{1}{12}$$ and thus the probability of correctly identifying the player with the larger number is $\frac{11}{15}.$

If Martina and Olivia modified the game to end only if Olivia agrees with Martina, then this limits the response strings to only those with even lengths. In this case, the misidentified region now has area $$\sum_{k=1}^\infty \frac{1}{4^{2k}} = \sum_{k=1}^\infty \frac{1}{16^k} = \frac{1}{1-\frac{1}{16}} - 1 = \frac{1}{15},$$ and so the modification allows the pair gets better at identifying the player with probability $\frac{15}{16}.$

Saturday, May 8, 2021

Squaring (around) the circle

Can you find three distinct numbers such that the second is the square of the first, the third is the square of the second, and the first is the square of the third? Sure, probably. Jeez, that was easy ... Assuming you can, what are three such numbers? Ohhhhh, OK, fine, I will actually find them .... you know me so well.

On the face of it, something seems a bit odd here. Let's say the numbers are $a,$ $b$ and $c.$ Then the condition is $b = a^2,$ $c=b^2$ and $a = c^2,$ so combining these conditions we get $$a = c^2 = b^4 = a^8 \,\, \text{or equivalently} \,\, a^8 - a = a(a^7 -1) = 0.$$ In the real numbers, we would get either $a = 0 (=b=c)$ or $a = 1 (=b=c),$ but since we want unique numbers $a,$ $b,$ $c$ none of these will do.

However, in the complex numbers, squaring a number involves both rotating the plane and squaring the magnitude. If we focus only on unit magnitude (which will remain fixed under squaring), the cyclotomic equation $a^7 - 1 = 0$ has $7$ different solutions $$a_k = e^{i 2\pi k / 7}, k = 0, 1, \dots, 6.$$ Since $a_0 = 1$ has already been ruled out, we have six possible, distinct solutions \begin{align*}a_k &= e^{i 2\pi k / 7} = \cos (2\pi k/7) + i \sin (2\pi k/7),\\ b_k &= e^{i 4\pi k / 7} = \cos (4\pi k/7) + i \sin (4\pi k/7),\\ c_k &= e^{i 8\pi k / 7} = \cos (8\pi k/7) + i \sin (8\pi k/7),\end{align*} for $k = 1, \dots, 6.$

Monday, May 3, 2021

Channel your inner Cornholio

You’re playing a game of cornhole with your friends, and it’s your turn to toss the four bean bags. For every bean bag you toss onto your opponents’ board, you get $1$ point. For every bag that goes through the hole on their board, you get $3$ points. And for any bags that don’t land on the board or through the hole, you get $0$ points.

Your opponents had a terrible round, missing the board with all their throws. Meanwhile, your team currently has $18$ points — just $3$ points away from victory at $21.$ You’re also playing with a special house rule: To win, you must score exactly $21$ points, without going over.

Based on your history, you know there are three kinds of throws you can make: (1) An aggressive throw, which has a $40$ percent chance of going in the hole, a $30$ percent chance of landing on the board and a $30$ percent chance of missing the board and hole; (2) a conservative throw, which has a $10$ percent chance of going in the hole, an $80$ percent chance of landing on the board and a $10$ percent chance of missing the board and hole; or (3) a wasted throw, which has a $100$ percent chance of missing the board and hole.

For each bean bag, you can choose any of these three throws. Your goal is to maximize your chances of scoring exactly 3 points with your four tosses. What is the probability that your team will finish the round with exactly 21 points and declare victory?

Let's denote the three types of throw strategies as $A$ for aggressive, $C$ for conservative and $W$ for wasted. Let $S_k$ be the score after the $k$th throw of this turn (with $S_0=18$). Based on the strategy, the score will evolve probabilistically according to probability laws $\mathbb{P}_A,$ $\mathbb{P}_C$ or $\mathbb{P}_W,$ respectively, as described above. We only care about ending up with $S_4 = 21$ and should set $V(S) = \delta(S-21) = \begin{cases} 1, &\text{if $S=21$;}\\ 0, &\text{if $S \ne 21.$}\end{cases}$$ We can also think of the score in terms of five states $\mathcal{S} = \{18, 19, 20, 21, \gt 21\}$ to make the problem more manageable.

If we start with the final utility $V_4 = V$ as above, then working backwards, we get $$V_{k-1}(s) = \max_u \sum_{\sigma \in \mathcal{S}} \mathbb{P}_u \{S_k=\sigma \mid S_{k-1} = s\} V_k(\sigma),$$ for each $s \in \mathcal{S}.$ Ultimately, we are looking for the value of $V_0(18),$ which we will use backwards induction to infer.

Intuitively, the optimal values should be $\hat{u}(21) = \hat{u}(\gt 21) = W,$ as in either case there is no additional benefit to scoring any more points (either you have already lost or would lose if any more points are scored). Then we will always have $V_k(21) = 1$ and $V_k(\gt 21)=0$ for all $k = 1, 2, 3, 4.$

Moving to $s=20,$ we get \begin{align*}V_{k-1}(20) &= \max \{ 0.3 V_k(20) + 0.3 V_k(21) + 0.4 V_k(\gt 21), 0.1 V_k(20) + 0.8 V_k(21) + 0.1 V_k(\gt 21), V_k(20) \}\\ &= \max\{ 0.3 V_k(20) + 0.3, 0.1 V_k(20) + 0.8, V_k(20) \},\end{align*} with final condition $V_4(20) = 0.$ Therefore, we have $V_3(20) = 0.8,$ $V_2(20) = 0.88,$ and $V_1(20) = 0.888.$ Note that for $s=20,$ the optimal choice is always $\hat{u}(20)=C.$

Dropping down to $s=19,$ we get \begin{align*}V_{k-1}(19) &= \max \{0.3 V_k(19) + 0.3 V_k(20) + 0.4 V_k(\gt 21), 0.1 V_k(19) + 0.8 V_k(20) + 0.1 V_k(\gt 21), V_k(19)\} \\ &= \max \{0.3 V_k(19) + 0.3 V_k(20), 0.1 V_k(19) + 0.8 V_k(20), V_k(20) \},\end{align*} with final condition $V_4(19) = 0.$ Therefore, we have $V_3(19) = 0,$ $V_2(19) = 0.64$, and $V_1(19) = 0.768.$ For $s=19,$ the optimal choice (except for $\hat{u}_4$ where all options are equally worthless) is $\hat{u}(19) = C.$

Moving to $s=18,$ we have \begin{align*}V_{k-1}(18) &= \max \{0.3 V_k(18) + 0.3 V_k(19) + 0.4 V_k(21), 0.1 V_k(18) + 0.8 V_k(19) + 0.1 V_k(21), V_k(18) \}\\ &= \max \{ 0.3 V_k(18) + 0.3 V_k(19) + 0.4, 0.1 V_k(18) + 0.8 V_k(19) + 0.1, V_k(18) \},\end{align*} with final condition $V_4(18) = 0.$ Therefore we have $V_3(18) = 0.4$, $V_2(18) = 0.52$ and $V_1(18) = 0.748$ and $V_0(18) = 0.8548.$ Note again here that we also have $\hat{u}(18) = A$ regardless of the number of bean bags already tossed during your turn. So with a uniform strategy of agressive toss if you are currently at $S=18;$ a conservative toss if you are currently at $S \in \{19, 20\};$ and wasted toss if your score is $S \geq 21,$ we get the probability of winning during your next turn as $V_0(18) = 85.48\%$.