Coins tossing

Coins tossing


A printable version of this document is available here: Coins tossing

I The game

I The game


Let's suppose we can toss a fair coin as many times as we want (i.e. a coin that gives heads and tails both with probability equal to 1/2).
The first player chooses a triplet (e.g. THH), afterwards the second player chooses another triplet (e.g. HTH). The coin is tossed until one of the chosen triplets appears. The player whose triplet appears first wins.
With the choices above, if the sequence of tosses is HTTTHTTHH, then the first player wins because the triplet HTH did not show up, while the triplet THH appears in the last three tosses. Instead, if the sequence of tosses is HTTHTH, the second player wins.
Keep in mind that when we start the game, we have no way of knowing how many tosses will be needed to end the game.

I-1 A single game

I-2 You choose first

I-3 The computer chooses first

I-4 Let's work on the strategy

Coins tossing → I The game

I-1 A single game

Try it yourself

A single game : here you can practice with the game rules.
Coins tossingI The game → I-1 A single game

I-2 You choose first


We will start playing 5 games. You choose a triplet, afterwards the computer chooses its triplet.

Try it yourself

You choose first (5 games) : Choose a triplet.

I-2-1 Some thoughts

I-2-2 How does it works?

Coins tossingI The game → I-2 You choose first

I-2-1 Some thoughts


Whatever triplet you choose, the computer will always be able to choose one with a higher probability of winning than yours.
Remember this is a random experiment: even if the computer have chosen a triplet with a higher probability than yours, still luck matters. The computer could actually turn out to be unlucky and lose the game.
Have a look at the long run: let's play 20 games.

Try it yourself

You choose first (20 games) : Let's play 20 games.
Coins tossingI The gameI-2 You choose first → I-2-1 Some thoughts

I-2-2 How does it works?


You can play many times trying to understand the strategy the computer uses to choose its triplets.
Also, you can try to find the triplets that can better challenge the computer's luck (and maybe you can even win).

Try it yourself

You choose first (20 games) : Let's play 20 games and afterwards let's have a look at all the outcomes.
Coins tossingI The gameI-2 You choose first → I-2-2 How does it works?

I-3 The computer chooses first


Now the computer will make the first choice. If you have understood which are the ``weakest'' triplets, in this way you can try to identify the triplet that best responds to the computer's choice.

Try it yourself

The computer chooses first (5 games) : The computer first chooses a triplet and you can respond by choosing yours. Try to find out which triplet can beat the one chosen by the computer.

Try it yourself

Have a look at the long run: let's play 20 games.
The computer chooses first: (20 games) : let's play 20 games.
Coins tossingI The game → I-3 The computer chooses first

I-4 Let's work on the strategy


Now we will try to figure out how to make educated guesses in playing the game. Let's recap a bit of facts about probability.
We will start with the easiest tasks and then we will work on more intriguing problems.

I-4-1 Probabilities

I-4-2 Some special cases

I-4-3 Further explicit computations

Coins tossingI The game → I-4 Let's work on the strategy

I-4-1 Probabilities


Let's start with the computation on the easier probabilities

Try it yourself


Probability of a triplet

Try it yourself

Comparing probabilities

I-4-2 Some special cases


Try it yourself

Stages in the game

Try it yourself

Triplet comparisons
Coins tossingI The gameI-4 Let's work on the strategy → I-4-2 Some special cases

I-4-3 Further explicit computations


Try it yourself

Four tosses
Coins tossingI The gameI-4 Let's work on the strategy → I-4-3 Further explicit computations

a coin tossing game.
: probability, interactive mathematics, interactive math, server side interactivity


This page is not in its usual appearance because WIMS is unable to recognize your web browser.
In order to access WIMS services, you need a browser supporting forms. In order to test the browser you are using, please type the word wims here: and press ``Enter''.

Please take note that WIMS pages are interactively generated; they are not ordinary HTML files. They must be used interactively ONLINE. It is useless for you to gather them through a robot program.