Bitwise Evolution

Musings of a Portland-area hacker bent on improving digital lifestyles.

Recovered Puzzles

I used to collect puzzles–back when I had a wiki to post them to–but that content was lost to me a few years ago when the system hosting my personal content had a slew of hard drive issues. I was lamenting that loss last week when a coworker suggested that I could possibly find the content on the way-back machine at archive.org, and indeed, I did!

Without further ado, here’s a short list of brainteasers (none are of my creation, and I do not have citations–if you know who to credit for any of these, please let me know and I will add proper attribution info.)

Calendar Cubes

A man has two cubes on his desk. Each face of each cube has a single-digit number wirtten on it. With these two cubes, the man is able to enumerate all the days in any month, and each morning he arranges the cubes so that the number of the current day is on top, always using both cubes. How are the numbers distributed on the cubes?

Pennies 1

You are blindfolded in a room with 100 pennies. 30 of the pennies are heads-up, the remainder are tails-up. You can interact with the pennies in any way, but your fingers are not dexterous enough to feel the contours of the coins (so you can’t feel one to see which side is heads, or tails). Since you are blindfolded, you can’t see them either. Your task is to manipulate the coins such that there are two sets and each set has an equal number of coins that are heads-up. (The sets must be disjoint, non-empty, and all pennies must be in one of the two sets.)

Pennies 2

Given N pennies, one of which is counterfiet (and therefore is of different weight from the remainder) and a balance, how can you find the counterfeit coin in less three weighings on the balance.

Eggs

You are in a 100-floor building on a planet with oddly low gravity and/or surprisingly durable eggs. You happen to have two of these eggs (unfertilized, I assure you). Your task is to find the highest floor from which you can drop an egg and have it remain intact.

Numbers

Given 99 unique integers between 1 and 100, provide an optimal algorithm to find the remaining integer in that range that is not in the set.

Hint: Bcgvzny gnxrf yvarne gvzr naq pbafgnag fcnpr.

Prisoners

50 people are inprisioned, and during their imprisonment the captor will invite people randomly in to visit with her. All visits are one-on-one, and each prisoner has a unique tunnel from their cell to the captor’s office (so you can’t look out your cell and see who is going in). In the captor’s room is a bowl that the prisoners can optionally turn over, or turn right-side up during their visit(s). The initial state of the bowl is known to everyone.

The imprisonment may last for an infinite period of time, during which each prisoner will be invited into the captor’s office many, many times (essentially infinite, but it needs not be infinite, it could just be a reasonably small number in the optimal case). The imprisonment ends when one prisoner says: “Everyone has been in to see the captor at least once.” If a prisoner says this and they are wrong, all prisoners are killed immediately. Because the captor may decide not to visit anyone for a while, it is as if the prisoners have no concept of time, so they can’t bound the number of people seen based on the passage of time.

To give the prisoners a chance, they are allowed to convene briefly before their imprisonment, during which time they can plan a strategy. How do they do it?

Sequences What is the next line in this sequence?

1
1 1
2 1
1 1 1 2
3 1 1 2
2 1 1 2 1 3