Data & Statistics

The First to Reach 10

Amy and Becky are playing a coin-tossing game. Amy gets a point for heads, and Becky gets a point for tails. The first to reach ten points receives a $100 prize. If the game had to be stopped when Amy was leading at 8-7, how would they have split the prize?

Let’s evaluate Amy’s probability of winning the game when the score was 9-9. At 9-9, she has a 50% chance of winning.

If Amy is leading at 9-8, there is a 50% chance she wins, and 50% she reaches 9-9 (at 9-9, we know her probability of winning, i.e., 0.5). The final winning probability for 9-8 is 0.5 x 1 + 0.5 x 0.5 = 0.75.

At 9-7, Amy has a 50% chance to win and a 50% chance to reach 9-8 (at 9-8, Amy has a 0.75 chance to win). Her chance of winning from 9-7 is
0.5 x 1 + 0.5 x 0.75 = 0.875

At 8-8, Amy has a 50% chance to reach 9-8 win and a 50% chance to reach 8-9. Her chance of winning is
0.5 x 0.75 + 0.5 x 0.25 = 0.5

At 8-7, Amy has a 50% chance to reach 9-7 and a 50% chance to reach 8-8. Her chance of winning is
0.5 x 0.875 + 0.5 x 0.5 = 0.6875

So they split the prize, with Amy taking $68.75 and Becky $31.25.

The First to Reach 10 Read More »

The Principle of Proportional Ink

Bergstrom and West, in this book, Calling Bullshit, introduce the “Principle of Proportional Ink”, as a modification of the concept that Edward Tufte developed of data visualisation,

When a shaded region is used to represent a numerical value, the area of that shaded region should be directly proportional to the corresponding value.

Here is a comparison between two entities, A and B, with values 2 and 4, respectively. In the left plot, both width and height are doubled to represent B, which is twice that of A. This magnifies the area of B to four times that of A. On the other hand, the comparison on the right has the size of B double that of A.

As per the principle of proportional ink, the right plot better represents the relative magnitudes to the reader.

The Principle of Proportional Ink Read More »

The Rendezvous Problem

The Rendezvous Problem is a logical dilemma originally formulated by  Steve Alpern in 1976. Two people are lost in a location with n rooms. How should they move around to find each other in minimum time?  

Obviously, they have no cell phone to communicate (it’s 1976). The n rooms are identical and unlabelled, and the travelling time between any two rooms is the same.  

If both stay still, they will never meet. If both move randomly, they may take longer to meet (the expected meeting time = n). If one of them stays and the other moves, the meeting time reduces to n/2, but there is no way to decide who to move and who remains still.  

Anderson and Weber proposed a probabilistic solution in which each person, after each step, either stays at her current location with probability p or moves randomly with probability 1-p until the two meet. They estimated p = 1/2 for n = 2 and p = 1/3 for n = 3. When n is large, p becomes 0.2475; the expected meeting time is ca. 0.8289n steps. 

Rendezvous problem: Wiki
The rendezvous problem on discrete locations: Anderson and Weber

The Rendezvous Problem Read More »

Muddy Children Puzzle

Amy and Bob are back from playing, and their mother notices mud on their foreheads. She says, “At least one of you has a muddy forehead. Do you know whether you have muddy foreheads?” What is the expected answer from each? What happens if she repeats the question? 

This is a puzzle in which each child can see the forehead of the other but not themselves. They must also answer simultaneously. 

Amy sees mud on Bob’s forehead, so she can’t conclude anything about herself. Had she seen no mud on Bob, she could deduce that she got muddy (as there is at least one). The same is true with Bob, who can’t decide. So they both say NO.  

When the mother asked again, the first NO became known to both children. Amy knows that Bob knows that Amy’s forehead has mud and vice versa. So both say YES this time.     

Induction Puzzles: Wiki

Muddy Children Puzzle Read More »

The First to Reach 15

Amy and Becky are playing a game. There are nine cards, numbered 1 to 9. The players take turns and pick up one card. The first player to pick up a set of three cards that add up to 15 wins the game. What is the strategy? 

The game’s objective is to create possible sets of 3 numbers that add up to 15. This can be achieved by building a 3 x 3 matrix as follows. 

So, Amy starts the game by picking one of the numbers, say 5. Let’s mark it by X. 

Becky then wants to complete a row or a diagonal, preventing Amy from doing so. She picks 6, denoted by O.

In other words, this game has become a tic-tac-toe, where a draw is also possible.

Game Theory Puzzle: The Race To 15: MindYourDecisions

The First to Reach 15 Read More »

Strictly and Weakly Dominant Strategies

After a brief break, we are back to the game theory topic. We know what a dominant strategy is. In a game, it is a player’s go-to strategy, regardless of what the other players do. The most famous example is the Prisoner’s dilemma, where Prisoner 1 has a dominant strategy – to betray—regardless of what Prisoner 2 does. There are two types of dominance. 

A strictly dominant strategy: Always provide the player with a greater (never equal to) payoff.

A weakly dominant strategy: Provide at least as good as the other strategies. At least one payoff is strictly greater.

In this game, from Player 1’s perspective, if Player 2 makes move 1, Player 1 gains a better payoff by making move 2 (7 > 5). On the other hand, if Player 2 makes move 2, Player 1 has no strictly better payoff (between move 1 and move 2). So, player 1 is good to make the move 2; however, it is a weakly dominant strategy.  

Strictly and Weakly Dominant Strategies Read More »

The 17 Coins Game

Another game Played between two players. In this case, 17 coins are placed in a circle. A player can take one or two coins in her turn. In the case of the two, they must be next to each other, i.e., there must be no gap between them. Whoever takes the last coin wins. Like before, the game offers an advantage to one person. Who is it, and what is her winning strategy?

Well, the advantage is with the second person. Here is the strategy: 

Case 1: the first person takes one coin

The second person must take two coins from the opposite side, breaking down the arc into two – with seven coins each. 

From now on, the game is simple: copy what the first person does on one of the arcs to the opposite arc. Since your turn is second, you will be the one who ends the game. 

Case 2: the first person takes two coins

The second person must also create two arcs with seven coins each by removing one from the diametrically opposite end. The rest is the same as before.  

Can You Take the Final Coin? A Game Theory Puzzle: William Spaniel

The 17 Coins Game Read More »

The 21 Flags Game

Here is a game played between two parties, each taking turns. There are 21 flags. The first person, in her turn, must pick up one, two or three flags—the game shifts to the second one to do the same. The game continues. The person who picks up the last flag is the winner. In theory, the game offers an advantage to one person. Who is it, and what is her winning strategy?

As with many games, this can also be solved by thinking backwards. Imagine only one flag remaining; the person whose turn comes up wins. The same is true for two and three flags, as she can take one, two, or three in her turn. Let’s denote that person – the first in line – 1.

1 wins 1, 2, 3

There are now four flags. Person 1 can remove one, two, or three, but the last chance is for person 2. 

1 lose: 4

If there are five flags, 1 can choose one flag, and 2 is left with a four-flag situation, i.e. 2 loses. The same is true for six and seven.

1 wins 1, 2, 3, 5, 6, 7

In the case of Eight Flags, if 1 takes one, two or three, 2 gets one of the winning numbers (8-1 = 7, 8-2 = 6 or 8-3 = 5).

1 lose: 4, 8

Continuing this pattern, person 1 can win when the flags in her turn are 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, and 21 and will lose when the flags are 4, 8, 12, 16, 20.

Since 21 is on person 1’s list, she can win this game by always picking the flags, leaving a multiple of four to the opponent. So, at the beginning of the game, the starter picks up one flag, leaving the opponent to choose next. Person 2 can leave 19, 18, or 17 for person 1. Person 1 will then pick such that person 2 gets 16. The game goes on, and 1 eventually wins.

Can You Solve The 21 Flags Game From Survivor?: MindYourDecisions

The 21 Flags Game Read More »

Optical Character Recognition and ‘tesseract’

Optical Character Recognition (OCR) converts a text image into machine-readable text.  In R, the package ‘tesseract’ does that in one step using the ‘ocr’ function. 

Here is the text image (‘OCR02.png’).

The R program reads the image and gives the results.

library(tesseract)
text <- ocr('D://Program/OCR02.png')
print(text)
"Suppose one person, call him Sender, wishes to persuade another, call her\nReceiver, to change her action. If Receiver is a rational Bayesian, can Sender per-\nsuade her to take an action he would prefer over the action she was originally going\nto take? If Receiver understands that Sender chose what information to convey with\nthe intent of manipulating her action for his own benefit, can Sender still gain from\npersuasion? If so, what is the optimal way to persuade?\n"

Optical Character Recognition and ‘tesseract’ Read More »

The Confidence Equation

The third in David Sumpter’s list is the confidence equation. We know what it is. Suppose you get ‘h’ as the average outcome after n events (trials), and the confidence at which you can think about the validity of h becomes.   

h.n \pm 1.96 . \sigma . \sqrt{n}

Where sigma is the standard deviation. You can divide it by n to get the confidence interval per average trial. 

h \pm 1.96 . \frac{\sigma} {\sqrt{n}}

You can divide it by n to get the confidence interval per average trial. We know the origins of 1.96 in the equation have come from the normal distribution. Sumpter uses the terms (initially coined by Nate Silver) ‘signal’ to describe the average and ‘noise’ for the standard deviation. 

Recall the betting ‘edge’ developed in the earlier post. Now, how many bets does one need to make before one can confidently say that the edge is 3%?  

Reference

The Ten Equations that Rule the World: David Sumpter

The Confidence Equation Read More »