Ring Train

You find yourself in a train made up of some unknown number of connected train cars that join to form a circle. It’s the ouroboros of transportation. Don’t think too hard about its practical uses. From the car you’re in, you can walk to a car on either side — and because the train is a circle, if you walk far enough eventually you’ll wind up back where you started. Each car has a single light that you can turn on and off. Each light in the train is initially set on or off at random. What is the most efficient method for figuring out how many cars are in the train? (Assume that you can’t mark or otherwise deface a train car, and that each car’s light is only visible from within that car. The doors automatically close behind you, too. There are only two actions you can take: turning on or off a light and walking between cars.) [Solution]

Perfect HORSE

Two players have taken to the basketball court for a friendly game of HORSE. The game is played according to its typical playground rules, but here’s how it works, if you’ve never had the pleasure: Alice goes first, taking a shot from wherever she’d like. If the shot goes in, Bob is obligated to try to make the exact same shot. If he misses, he gets the letter H and it’s Alice’s turn to shoot again from wherever she’d like. If he makes the first shot, he doesn’t get a letter but it’s again Alice’s turn to shoot from wherever she’d like. If Alice misses her first shot, she doesn’t get a letter but Bob gets to select any shot he’d like, in an effort to obligate Alice. Every missed obligated shot earns the player another letter in the sequence H-O-R-S-E, and the first player to spell HORSE loses. Now, Alice and Bob are equally good shooters, and they are both perfectly aware of their skills. That is, they can each select fine-tuned shots such that they have any specific chance they’d like of going in. They could choose to take a 99 percent layup, for example, or a 50 percent midrange jumper, or a 2 percent half-court bomb. If Alice and Bob are both perfect strategists, what type of shot should Alice take to begin the game? What types of shots should each player take at each state of the game — a given set of letters and a given player’s turn? [Solution]

All Heads

There is a square table with a quarter on each corner. The table is behind a curtain and thus out of your view. Your goal is to get all of the quarters to be heads up — if at any time all of the quarters are heads up, you will immediately be told and win. The only way you can affect the quarters is to tell the person behind the curtain to flip over as many quarters as you would like and in the corners you specify. (For example, “Flip over the top left quarter and bottom right quarter,” or, “Flip over all of the quarters.”) Flipping over a quarter will always change it from heads to tails or tails to heads. However, after each command, the table is spun randomly to a new orientation (that you don’t know), and you must give another instruction before it is spun again. Can you find a series of steps that guarantees you will have all of the quarters heads up in a finite number of moves? [Solution]

Four Hats

You and three friends are contestants on the newest edition of “Guess Your Hat.” As in previous editions of the show, you will each have a hat placed on your head. But now the hats can be one of four colors: red, yellow, blue or green. Some (or even all) of you may have the same color hat. You can see everyone else’s hat but not your own, and your goal is to guess the color of your own hat. Everyone who guesses right wins, and everyone who guesses wrong loses. The guesses are made in private. You can’t communicate with your friends in any way during the game, but you can communicate with them beforehand to decide on a strategy. However, the showrunners will be listening in, so they will know whatever strategy you decide on. They will then choose your hats in the worst possible way (for you), trying to make as many people as possible lose. Given the behavior of the nefarious showrunners, you probably can’t pick a strategy that will let everybody win. But can you design a strategy that guarantees at least one of you will win? How about guaranteeing at least two winners? [Solution]

Nine Cards

You and I are playing a game. It’s a simple one: Spread out on a table in front of us, face up, are nine index cards with the numbers 1 through 9 on them. We take turns picking up cards and putting them in our hands. There is no discarding. The game ends in one of two ways. If we run out of cards to pick up, the game is a draw. But if one player has a set of three cards in his or her hand that add up to exactly 15 before we run out of cards, that player wins. (For example, if you had 2, 4, 6 and 7, you would win with the 2, 6 and 7. However, if you had 1, 2, 3, 7 and 8, you haven’t won because no set of three cards adds up to 15.) Let’s say you go first. With perfect play, who wins and why? [Solution]