Logic
# Logic Warmups

Cornwallis, Geoffrey, and Markett are outside the Pearly Gates discussing theology. One of them is an angel who always tells the truth, one of them is a demon who always lies, and one of them is a spirit who can either tell the truth or tell a lie.

Cornwallis says: **"I am a spirit."**

Geoffrey says: **"Cornwallis is a demon."**

Markett says: **"Geoffrey is an angel."**

Who is the spirit?

A band of 5 pirates of different ages come across a treasure of 100 gold coins. Their captain, who is the oldest, suggests the following scheme of splitting the coins:

- The oldest pirate proposes how to share the coins (in non-negative integer values), and
**all**of the pirates (including the proposer) vote for or against the proposal. - If 50% or more of the pirates vote for it, then the coins will be shared according to the proposal.
- Otherwise, the pirate proposing the scheme will be tossed to the sharks, and the process is repeated with the remaining pirates.

As these pirates are bloodthirsty, if a pirate would get the same number of coins if he voted for or against a proposal, he will vote against so that the pirate who proposed the plan will be more likely tossed to the sharks.

Assuming that all 5 pirates are intelligent, rational, greedy, and do not wish to die, how many coins will the captain get?

A mad scientist lined up Andy, Bandy, Candy and Dandy in a row (in that order), such that each of them could see the others in front of them but not those who are behind. Andy is able to see everyone else while Dandy cannot see anyone. The mad scientist declares:

"There is a red hat, a blue hat, a white hat, and another hat that is either red, blue or white. I will place them on your heads, so that you can't see the color of your own hat. However, you can see the hat color of anyone in front of you."

Starting from the back (Andy first), he asked them each in turn what the color of their hats were. To his surprise, they all were able to correctly deduce the color of their hat based on the responses that they heard.

Which 2 people had the same color hats?

After pulling off a successful jewel heist, 5 burglars had to decide how to split the loot of 100 coins. The master-thief, who was the oldest and planned the burglary from the start, came up with the following democratic scheme:

Starting with the oldest burglar, he will propose how to share the jewels (in non-negative integer values), and the

remaining(not including the proposer) burglars will vote for or against the proposal.

Of the burglars that can vote, if 50% or more approve, then the coins will be shared according to the proposal.

Otherwise, the burglar proposing the scheme will be killed at the scene of the crime, and left as a scapegoat for the police. The process is then repeated.

As these burglars all want to escape, if a burglar would get the same number of coins regardless of his vote, then he will vote against to increase the likelihood that that the burglar who proposed the plan will become a scapegoat.

Assuming that all 5 burglars are intelligent, rational, greedy, and do not wish to die, what is the maximum number of coins that the master-thief can get?

In the Forgotten Realms, there are two types of elves. The high elves will always tell the truth, while the dark elves will always lie. Gygax the Great met three elves, and was trying to determine which of them would correctly guide him further.

"How many high elves are there amongst you?"

To which they gave the three replies:

"Two", "One", "Two"

How many high elves are there amongst the 3 elves?