## fun sums

Posted in Books, Kids, Statistics with tags , , , , , , on May 26, 2021 by xi'an

Some sums and limits found from a [vacation] riddle by The Riddler:

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

$\lim_{k\to\infty}\prod_{i=2}^k\left(1-\dfrac{1}{i}\right) = \lim_{k\to\infty} \dfrac{1}{k} = 0$

For the second method, Friend 1 takes ½² of the cake, Friend 2 takes ⅓² of what remains, and so on. After infinitely many friends take their respective pieces, you get whatever is left.

$\lim_{k\to\infty}\prod_{i=2}^k\left(1-\dfrac{1}{i^2}\right) = \lim_{k\to\infty}\dfrac{k+1}{2k} = \dfrac{1}{2}$

For the third method, Friend 1 takes ½² of the cake, Friend 2 takes ¼² of what remains, Friend 3 takes ⅙² of what remains after Friend 2, and so on. After your infinitely many friends take their respective pieces, you get whatever is left.

$\lim_{k\to\infty}\prod_{i=2}^k\left(1-\dfrac{1}{4i^2}\right) = \lim_{k\to\infty}\dfrac{4(2k+1)}{3\pi k} = \dfrac{2}{\pi}$

## you said that I said that you said that…

Posted in Books, Kids, pictures, Statistics with tags , , , on May 25, 2021 by xi'an

A riddle from The Riddler on limited information decision making, which I tought I failed to understand:

Two players, Martina and Olivia, are each secretly given realisations, m and u. Starting with Martina, they must state to the other player whom they think probably has the greater number until they agree. They are playing as a team, hoping to maximize the chances they correctly predict who has the greater number. For a given round, what is the probability that the person they agree on really does have the bigger number?

A logical strategy is as follows: If m>.5, P(U>m)<.5, hence Martina should state her number is probably bigger, which conveys to Olivia that M>.5. If u<.5, Olivia can agree for certain, else, if u>.75, P(M>u)<.5 and she can state a probably larger number, while if 0.5<u<.75, Olivia can state (truthfully) that her number us probably smaller, although there is a ½ probability she is wrong. As detailed in the solution, the probability of finishing on a false statement is ¼²+¼³+…, equal to 1/12.

## Georgia on my mind

Posted in Books, Kids, Statistics, Travel with tags , , , , , , , , on May 12, 2021 by xi'an

The riddle of this week was inspired by the latest presidential elections when one State after another flipped the winner from Trump to Biden. Incl. Georgia.

On election night, the results of the 80 percent who voted on Election Day are reported out. Over the next several days, the remaining 20 percent of the votes are then tallied. What is the probability that the candidate who had fewer votes tallied on election night ultimately wins the race?

Assuming many votes, perfect balance between both candidates (p=½), and homogeneity between early and late ballots, the question boils down to the probability of a sum of two normals, X+Y, ending up being of the opposite sign from X, when the variances of X and Y are α and 1-α. Which writes as the expectation

$2 \mathbb{E}_\alpha[\Phi(-X/\sqrt{1-\alpha})]$

equal to

$\frac{2}{2\pi}\left(\frac{\pi}{2} + \arctan\{\sqrt{\alpha/(1-\alpha)|}\}\right)$

which returns a probability of about 0.14 when α=0.8. When looking at the actual data for Georgia, out of 5 million voters, at some point 235,000 ballots remained to be counted with Trump on the lead. This means an α about 0.05 and implies a probability of 7% (not accounting for the fact that the remaining mail-in-ballots were more favourable to Biden.)

## Take thrice thy money, bid me tear the bond

Posted in Books, Kids with tags , , , , , on April 21, 2021 by xi'an

A rather fun riddle for which the pen&paper approach proved easier than coding in R, for once. It goes as follows: starting with one Euro, one sequentially predicts a sequence of four random bits, betting an arbitrary fraction of one’s money at each round. When winning, the bet is doubled, otherwise, it is lost. Under the information that the same bit cannot occur thrice in a row, what is the optimal minimax gain?

Three simplifications: (i) each bet is a fraction ε of the current fortune of the player, which appears as a product of (1±ε) the previous bets (ii) when the outcome is 0 or 1, this fraction ε can thus be chosen in (-1,1), (iii) while the optimal choice is ε=1 when the outcome is known, i.e., when both previous are identical. The final fortune of the player is thus of the form

(1±ε)(1±ε’)(1±ε”)(1±ε”’)

if the outcome is alternating (e.g., 0101 or 0100), while it is of the form

2(1±ε)(1±ε’)(1±ε”)

if there are two identical successive bits in the first three results (e.g., 1101 or 0110). When choosing each of the fractions ε, the minimum final gain must be maximised. This implies that ε=0 for the bet on the final bit  when the outcome is uncertain (and ε=1 otherwise). In case of an alternating début, like 01, the minimal gain is

min{(1±ε)(1±ε’)(1+ε”),2(1±ε)(1±ε’)(1-ε”)}

which is maximised by ε”=1/3, taking the objective value 4(1±ε)(1±ε’)/3. Leading to the gain after the first bit being

min{4(1±ε)(1+ε’)/3,2(1±ε)(1-ε’)}

which is maximised by ε’=1/5, for the objective value 8(1±ε)/5. By symmetry, the optimal choice is ε=0. Which ends up with a minimax gain of 3/5. [The quote is from Shakespeare, in the Merchant of Venice.]

Posted in Statistics with tags , , , , on April 9, 2021 by xi'an

First, an express riddle from the Riddler of last week:

An infant naps peacefully for two hours at a time and then wakes up, crying, due to hunger. After eating quickly, the infant plays alone for another hour, and then cries due to tiredness. This cycle repeats over the course of a 12-hour day. (The baby sleeps peacefully 12 hours through the night.) At a random time during the day, you spend 30 minutes with your baby and then the baby cries. What’s the probability that your baby is hungry?

The probabilistic setting is somewhat unclear, in particular because the last daytime nap is followed immediately with a 12 hour night sleep. Or the 12 hour night sleep is immediately followed by a one or two hour nap. Assuming a random starting time over the 12 hour period, denoting X as the time to the next crisis and Y as the nature of the cries (H versus T), it is straightforward to show that P(Y=H|X=30′) is ½. While it would be 1 for any duration larger than one hour.

Followed by an extra one this week:

Starting at a random time, 30 minutes go by with no cries. What is the probability that the next time your baby cries she will be hungry?

Which means computing P(Y=H|X>30′). Equal to ¾ in this case.