You are here

Flipping coins to heads or tails logic puzzle

Flipping coins to heads or tails logic puzzle

The heads or tails coin logic puzzle

You are in a room blindfolded. On a table in the room, lots of 1 rupee coins are in a pile. You are told that the pile of coins has 18 coins heads up and the rest tails up. The number of coins in the pile is much greater than 18.

Make two piles of coins with same number of heads up coins in each. You may flip as many coins as you want. But by feeling with your fingers you won't be able to tell which side is face up.

Recommended time to solve the puzzle: 10 minutes.

Baffling, isn't it?

Let us reason our way out of the mystery.

Solution to Flipping coins to heads or tails logic puzzle

What do we know for sure here?

  • Every coin has two faces—head and tail.
  • You can pick up a coin and put it into a second pile after flipping it or without flipping it. On flipping a coin, its top side is reversed.
  • You can do this many times, but always blindfolded, so that no way can you identify the nature of the top face of a coin.
  • Number of coins in the starting pile with heads up top face is 18. Your job is to create a second pile of coins from the first so that the number of heads up coins in the two piles is same.
  • Total number of coins in the starting pile is very large and much more than 18.

Being a pragmatic person you rationalize: What fruitful action can be taken at the start? The action must be very simple.

What if a random coin is chosen, flipped and added as the first coin in the second pile!

This is the least that can sure be done. This is the highly effective What If Analysis.

Now your reasoning brain becomes active and you list out the further possibilities opened up by the simple action.

Scenario 1: Originally the chosen coin was heads up and now in the second pile it is tails up after flipping. The number of heads up coins in the starting pile reduces by 1 to 17. The number of heads up coins in the second pile remains 0.

Scenario 2: Originally chosen coin was tails up. After flipping, it is heads up in the second pile. Number of heads up coins in the first pile remains unchanged to 18. And in the second pile, the number increases by 1 to 1.

It's a surprise: the total number of heads up coins has increased from 18 to 19!

Finding no better alternative, you decide to continue same way.

But it cannot be done indefinitely. So take the second simple decision of choosing a coin at random and adding it to the second pile just 5 times.

How will the two scenarios be affected now?

Scenario 1 after 5 times flip and add to second pile

Assume: Coin chosen each time is heads up.

Number of heads up coins in first pile reduces by 5 to 18 - 5 = 13 and number of heads up coins in the second pile remains fixed at 0. Total number of heads up coins in two piles combined also reduces to 13.

Now you can see light at the end of the tunnel and take just one more thinking step forward—you decide to repeat this step 18 times and reach a solution promptly! Number of heads up coins in both piles now is same and equals to just 0. You know it is a special case, but surely it is a possible special case.

You also realize,

Fact: For solving the riddle, you must choose, flip and add a coin to the second pile exactly 18 times, not more or fewer times.

Okay, what about the second scenario?

Scenario 2 after 5 times flip and add to second pile

Assumed: Coin chosen each time is tails up.

Number of heads up coins in the first pile remains fixed at 18, but the number of heads up coins in the second pile increases to 5.

Continue in the same way 13 more times. Assumption in this special case scenario: when you chose a random coin, it is tails up.

End result is the second special-case solution. Number of heads up coins in both piles is 18.

You have the solution at least for two special cases.

These are two EXTREME CASES. Improbable, but possible.

What do we learn from the trial of extreme cases?

The biggest gain from the experiment is the nearly certain knowledge that by choosing 18 random coins, flipping and adding to second pile we should get the solution for ALL CASES.

We will now find the result for a Random Scenario of say, 7 of the 18 chosen coins with starting face as heads up.

Scenario 3 of choosing a random coin, flipping and adding it to the second pile 18 times

Assumption: 7 of the 18 chosen coins have starting face heads up. Instead of 7 it may be any number less than or equal to 18.

After 18th flip and add, as 7 heads up coins are taken out from original pile, the number of heads up coins in the first pile reduces to 18 - 7 = 11. Number of heads up coins in the second pile becomes 0 + 11 = 11. These are the 11 tails up coins in the chosen bunch of 18 reversing side after flipping.

The number 7 of heads up coins in the chosen bunch of 18 is arbitrary. It can be any number from 0 to 18. 

We get equal number of heads up coins in both piles after 18 repeated random coin choice, flip and add to second pile in each case. Whatever be the number of heads up coins in the chosen set of 18 coins.

Still, your questioning self is not satisfied. You ask yourself—what happens if coins are added to second pile without flipping!

Think about the consequences of such a course of action.

As soon as you choose to drop the flip action once, you lose control of the situation and will never reach a conclusion with confidence.

Reason says, by not flipping a coin added, overall uncertainty of the outcome will increase with no control.

The steps to solve the puzzle are based on What If Analysis and reasoning, though the real support of our action of flipping Is mathematical.

Set theory is basis of solution of the logic puzzle

Let us show you the set theoretic graphical representation of the third scenario.

In the figure for initial state, A is the starting pile of coins and B is the number of heads up coins in A. C is the set of coins chosen at random from A to create the second pile. An arbitrary number of coins are heads up in the chosen set of coins C.

Number of coins in C is same as in B. The subset of coins D is the number of coins overlapping between B and C. These are the coins to be taken away from B (and A) when new pile is created.

flipping coins to heads or tails puzzle initial state

In the second pile, the D number of coins heads up in chosen set C flip over to tails up state and the rest (C - D) = (B - D) number of coins flip over to heads up state. In the first pile, B number of heads up coins reduces by D number of heads up coins taken away and becomes (B - D).

In the figure, final state is shown.

flipping coins to heads or tails puzzle final situation

By choosing randomly B (in this case 18) number of coins (which is the number of heads up coins in the starting pile), flipping and adding to the second pile creates the second pile of coins with the same number of heads up coins as the first as a mathematical certainty.

Details: How set theory concepts used for solving flipping coins to heads or tails logic puzzle

Following is a repetition of the above in a more elaborate language. You may decide to skip it.

A is the set of all coins at the start. B is the set of 18 coins that are heads up. Every member of B is also a member of set A and that is why we say B is a subset of set A.

To define a collection of objects (or things) as a set is the abstract way of dropping details of each member of the set except a common property. The members belong to the set as a collection because of their common property. In set A, the common property is—the members of A are all coins. The common property of members of set B is—all members are coins and these are heads up.

You won't know the location of a coin in a pile from the figures. This detail of location of a coin in a pile is superfluous. 

Only property that is important for members of set B is—they are heads up.

Let us understand the meaning of the figure for the third scenario. A coin is chosen in a random manner 18 times, flipped and added to the second pile. 7 arbitrary number of coins out of 18 chosen were originally heads up.

In the first figure, the subset C of set A is the 18 random coins chosen with 7 of them heads up.

The small overlap between subset B and subset C is the subset D of 7 heads up coins chosen out of total 18 heads up.

When the subset C number of coins are taken out from pile A and added to an altogether new pile of coins N, number of coins in A is reduced by 18 as well as number of heads up coins reduces in pile A by 7 to 11.

In the new second pile, the earlier heads up 7 coins are flipped to become tails up. The rest 11 earlier tails up coins are also flipped to change state to heads up and equals the number of heads up coins in set A ultimately. The number 7 may be any number from 0 to 18.

To summarize,

Taking out 18 coins from set A reduces heads up coins by the number of heads up coins in the 18 coins chosen. Simultaneously, because of state reversal of 18 - 7 =11 coins from tails up state in first pile, these also become heads up to equal the number of heads up coins in first pile A.

This is how the solution steps form a mathematical certainty.

More thoughts on the puzzle

With everything else remaining same, solve the puzzle with 19 numbers of heads up coins in the starting pile of coins. Or, change the number to 30 heads up coins in first pile.


Do you want to know how to solve difficult problems easily without wasting time on random attempts?

Our new ebook on puzzle solutions by innovative methods will show you just that.

Puzzles for Adults eBook

Puzzles for Adults: 50 Brain Teasers with Step-by-Step Solutions: Boost Your Power of Problem Solving

(Universal link for Apple books, Barnes & Noble, Rokuten Kobo, Vivlio, Angus & Robertson, Tolino, PayHip and others)

You will enjoy solving its 50 challenging brain teasers and at the same time boost your power of problem solving from the innovative step by step solutions rich with new ideas.

The general problem solving techniques are collected first time in a separate chapter.

It's not just solving puzzles. It is also learning innovative problem solving techniques that will change the way you try to solve ANY problem.

You may buy the eBook at Amazon or at Google Play.


Puzzles you may enjoy

Easy to hard brain teasers with systematic solutions

Challenging brain teasers with solutions: Long list.

This will always be the most up-to-date full list with the brain teasers classified into categories that can be browsed separately.

You may also click on the category term link below to enjoy the brain teasers that are classified in the present category.

For example, if the category term link shown below is "Riddle", click on it to go through all the Riddles.