Wednesday, August 24, 2016

Alien Encounter

The starship Indefensible was in orbit around the planet Noncomposmentis, and Captain Quirk and Mr Crock had beamed down to the surface.
‘According to the Good Galaxy Guide, there are two species of intelligent aliens on this planet,’ said Quirk.
‘Correct, Captain – Veracitors and Gibberish. They all speak Galaxic, and they can be distinguished by how they answer questions. The Veracitors always reply truthfully, and the Gibberish always lie.’
‘But physically—’
‘—they are indistinguishable, Captain.’
Quirk heard a sound, and turned to find three aliens creeping up on them. They looked identical.
‘Welcome to Noncomposmentis,’ said one of the aliens.
‘I thank you. My name is Quirk. Now, you are . . . ’ Quirk paused. ‘No point in asking their names,’ he muttered. ‘For all we know, they’ll be wrong.’
‘That is logical, Captain,’ said Crock.
‘Because we are poor speakers of Galaxic,’ Quirk improvised, ‘I hope you will not mind if I call you Alfy, Betty and Gemma.’ As he spoke, he pointed to each of them in turn. Then he turned to Crock and whispered, ‘Not that we know what sex they are, either.’
‘They are all hermandrofemigynes,’ said Crock.
‘Whatever. Now, Alfy: to which species does Betty belong?’
‘Gibberish.’
‘Ah. Betty: do Alfy and Gemma belong to different species?’
‘No.’
‘Right . . . Talkative lot, aren’t they? Um . . . Gemma: to
which species does Betty belong?’
‘Veracitor.’
Quirk nodded knowledgeably. ‘Right, that’s settled it, then!’
‘Settled what, Captain?’
‘Which species each belongs to.’ ‘I see. And those species are—?’
‘Haven’t the foggiest idea, Crock. You’re the one who’s supposed to be logical!’
(Source: Professor Stewart's Cabinet of Mathematical Curiosities, Ian Stewart)

This is essentially a "Knights and Knaves"-style puzzle with a thin Star Trek parody veneer. Some type of constraint programming could solve these but they are fun to work out in your head. Possibly there are other ways to do it but I like to start by assuming that the first individual is of the honest "Knight" variety and seeing if the results follow.

So let's say Alfy is honest. If so, then Betty is dishonest and it is accordingly the case that Alfy and Gemma are in fact of the same species, which means that Gemma is also honest. But Gemma says that Betty is honest, which contradicts Alfy's claim that Betty is dishonest. Because these sorts of puzzles require consistency, the initial assumption that Alfy is honest must be false. Alfy is dishonest; Betty is honest and because ... [whatever pronoun for Betty is appropriate] is honest Alfy and Gemma are of the same species, making Gemma another big fat liar.

Turnip for the Books

‘It’s been a good year for turnips,’ farmer Hogswill remarked to his neighbour, Farmer Suticle.
‘Yup, that it has,’ the other replied. ‘How many did you grow?’
‘Well . . . I don’t exactly recall, but I do remember that when I took the turnips to market, I sold six-sevenths of them, plus one-seventh of a turnip, in the first hour.’
‘Must’ve been tricky cuttin’ ’em up.’
‘No, it was a whole number that I sold. I never cuts ’em.’
‘If’n you say so, Hogswill. Then what?’
‘I sold six-sevenths of what was left, plus one-seventh of a turnip, in the second hour. Then I sold six-sevenths of what was left, plus one-seventh of a turnip, in the third hour. And finally I sold six-sevenths of what was left, plus one-seventh of a turnip, in the fourth hour. Then I went home.’
‘Why?’
‘’Cos I’d sold the lot.’

How many turnips did Hogswill take to market?
(Source: Professor Stewart's Cabinet of Mathematical Curiosities, Ian Stewart)

Initially I was going to attempt to do this with a really horrible-looking single equation but there'd be no way I have enough of an attention span to hold it all together and solve it without errors. The solution I eventually realized was the right way to go, and the one the answers section suggests, is doing things recurrently, starting from the last, fourth hour. Let's state what Farmer Hogswill did in that hour algebraically:

\[\frac{6}{7}x_4 + \frac{1}{7} = x_4 \]

This states that he sold all of what remained, $x_4$, the subscript standing for the fourth hour, and that the sale was partitioned into six-sevenths of this unknown quantity and one-seventh of a turnip. The answer is one. The trick then is to take things back to the third hour. That is done accordingly:

\[ \frac{6}{7}x_3 + \frac{1}{7} + x_4 = x_3 \]

This states that the quantity of turnips Farmer Hogswill had at the beginning of the third hour was equal to six-sevenths of that quantity, plus one-seventh of a turnip as before, in addition to whatever is left behind for the next and last hour. Solving this equation, $x_3$ is equal to eight. Solving the remaining two equations:

\[ \frac{6}{7}x_2 + \frac{1}{7} + x_3 = x_2 \]

and:

\[ \frac{6}{7}x_1 + \frac{1}{7} + x_2 = x_1 \]

...it can be known that the final answer is 400.