Library

Logic

16 items in the Thuztra Learn library carry the topic logic: 4 reference articles, 2 puzzles and 10 brainteasers. They are gathered here so one idea can be met in every form it takes, which is usually the difference between recognising a term and being able to use it.

10 of them have pages of their own, linked below. Everything else is listed with the summary its author wrote. The 12 problems on this topic are set out under their own headings, and the longest are quoted in full.

Problems in full

Quoted exactly as the library sets them, so the topic is something you can try rather than something you have read about.

Two jugs, no markings, and an exact amount to hit

You have a three litre jug and a five litre jug, neither with any markings on it, and an unlimited supply of water from a tap. The only moves available are: fill a jug completely, empty a jug completely, or pour from one jug into the other until either the source jug is empty or the destination jug is full.

Get exactly four litres of water into one of the two jugs.

The judge's sentence that seems to defeat itself

A judge tells a prisoner: "You will be hanged at noon on one weekday next week, Monday through Friday. Which day it happens will come as a complete surprise to you. You will not know it is the day until the executioner knocks that morning."

The prisoner, alone in the cell, reasons as follows. It cannot be Friday, because if noon passed on Thursday with no hanging, then Friday would be the only day left, and the prisoner would know for certain, the moment Thursday ended, that it must happen the next day. That would not be a surprise, so Friday is ruled out.

But once Friday is ruled out, the same logic applies to Thursday: it is now the last day remaining, so if Wednesday passes with no hanging, the prisoner would know for certain it must be Thursday, again no surprise, so Thursday is ruled out too.

Continuing this reasoning backward through Wednesday, Tuesday, and Monday, the prisoner concludes that no day at all can host a surprise hanging, and so the judge's sentence can never be carried out as described.

The executioner then knocks on Wednesday morning. The prisoner is, in fact, completely surprised.

Where does the prisoner's reasoning go wrong?

Reference articles

Working backwards from the end, and what everyone knows that everyone knows

Solve some puzzles from the last move back, and others by asking what everyone knows that everyone knows. One small worked example of each.

Something that never changes, and odd versus even

A quantity that no allowed move can alter proves some goals impossible without trying them. Odd and even is the simplest such quantity, and surprisingly often the right one.

States, moves, and finding the shortest route

Many puzzles are really a map: each situation a place, each allowed move a road. Breadth-first search finds the shortest route, worked on a number puzzle.

Designing a plan for the worst case

When bad luck or an adversary picks the input after seeing your plan, choose the plan whose worst case is least bad. Worked on a guessing game.

Puzzles

Twelve coins, one counterfeit, three weighings

One coin in a pile is the wrong weight, and nobody says which way. Find it and name the direction on a balance scale, inside a fixed weighing budget.

Two eggs and a tall building

Two identical eggs, a tall building, and a threshold floor to locate. Minimise the worst case, not the average, and the search strategy stops being binary.

Brainteasers

The island where a stranger's obvious remark changes everything

Everyone on the island already sees who has blue eyes. A visitor states a fact every islander already knew, and it still changes what happens next. Work out why the statement does anything at all.

Two ropes that burn unevenly, and a clock made of fire

Two ropes, each guaranteed to take an hour to burn end to end but at no guaranteed steady rate along the way, plus a lighter. No clock. Find a way to mark a shorter interval anyway.

Meera tells two friends her birthday, separately and incompletely

Meera tells Arjun only the month of her birthday and Priya only the day. The two of them trade short statements about what they do and do not know. Work out the date from the exchange alone.

The prisoners and the switch in the empty room

One switch, no other communication, a warden calling prisoners into a room one at a time forever. Design a protocol proving everyone has visited, with certainty rather than confidence.

Three jars, three wrong labels, and one piece of fruit

Three jars hold apples, oranges, and a mix of both, but every label is guaranteed wrong. Fix all three labels after drawing just one piece of fruit from just one jar.

A line of prisoners, hats they cannot see, and one sacrifice

Each prisoner in a line sees every hat ahead but none behind, and must guess their own colour aloud in turn. Maximise how many are guaranteed correct, not just how many probably will be.

Two jugs, no markings, and an exact amount to hit

A tap, a three litre jug, a five litre jug, neither one marked. Get exactly four litres of water into one of them, using nothing but filling, emptying, and pouring one into the other.

Two guards, two doors, and exactly one question

One door leads to freedom, the other does not. One guard always tells the truth, the other always lies, and you cannot tell which is which. Find a single question that always works.

The judge's sentence that seems to defeat itself

A judge promises an execution next week that will come as a total surprise. A tight chain of logic seems to prove that promise cannot be kept. Work out exactly where the chain of logic breaks.

The farmer, the wolf, the goat, and the cabbage

One boat, room for the farmer and only one companion at a time, and two pairs that cannot be left alone together on either bank. Get everyone across without anything getting eaten.

Related topics

The ideas this one is most often carried alongside, ranked by how much of each collection the two share.

Also in the library