Pictures in the sand to satisfy a guard

A party is being held at a local mansion. The host is very rich and his success is because of one thing - his famous recipe for spaghetti. He has pushed your tiny spaghetti startup to the side, and sabotaging him is your only hope of achieving dominance in the spaghetti marketplace.

The only guests that may attend are people who correctly reply to the guard at the door.

You hope to get in without invitation, and dye the spaghetti neon pink so that the rich host's reputation is ruined. You watch as guests come to the door. The guard asks them a question, and they draw a picture in the sand:

• The guard says "Three". The guest draws this picture and is admitted:

• The guard says "Nine". The guest draws this picture and is admitted:

• The guard says "Forty". The guest draws this picture and is admitted:

• The guard says "Ninety-nine". The guest draws this picture and is admitted:

• The guard says "Eight". The guest draws this picture and is forced to work in a spaghetti factory for the rest of his life:

You approach the door. The guard says "Twelve". What picture should you draw in the sand to be admitted?

Hints:

- The puzzle becomes somewhat harder without the whitespace on the drawings. See the revision history for (giant) versions of the drawings including whitespace.

- Each number corresponds to exactly one drawing, each drawing may correspond to multiple numbers.

• y u no antialias? – bjb568 Jan 20 '15 at 19:19
• @bjb568 It's very coarse sand. – Bill the Lizard Jan 20 '15 at 19:25
• So… like… gravel? – bjb568 Jan 20 '15 at 19:41
• @bjb568 No. There are actually definitions for different types of soil, including the difference between "coarse sand" and "fine gravel". Sand has a grain diameter between 0.0625mm and 2mm, while gravel is larger. – KSmarts Jan 20 '15 at 20:12
• You hastily fumble through your wallet, extract two 5s and two 1s, stuff the bills into the guard's hands, and clumsily push past him and into the house. You are almost immediately tackled by additional guards and end up in jail for trespass. – Compass Jan 20 '15 at 21:29

Each picture represents:

a number typed on a standard QWERTY keyboard, where the lines join the positions of two consecutive letters in the English spelling of the number.

Also,

The number drawn is a different number than the challenge. Three maps to "five", nine maps to "six", forty maps to "ten", and ninety-nine maps to "twelve". Eight does not map to "eight", which is what the last guest drew.

Why?

Consider the number on a 7-segment display. 3 is displayed with 5 segments, 9 with 6, 40 with 10, and 99 with 12. 8, however, is displayed with 7 segments, not 8.

Thus,

12 is displayed with 7 segments, so the correct picture is a mapping of 'seven' onto a QWERTY keyboard.

The solution:

• Nice. Now try it with number of black pixels at 12pt Arial on an iPhone 6 as a more modern take! – Tom Jan 21 '15 at 0:38
• i dont get it. anyone? help? – user2705620 Jan 21 '15 at 2:08
• @User6675636b20796f7521 is there something specific you don't understand? – Volatility Jan 21 '15 at 2:26
• I don't understand why the numbers map to different numbers. Specifically, what is meant by "consider the numbers on a 7-segment display." – EFrog Jan 21 '15 at 9:43
• @EFrog If you look at the numbers displayed on a 7-segment display, and count the number of segments which are lit up, the result is the number the original one maps to. For example, 3 is displayed using all three horizontal segments, and the two segments on the right. There are 5 segments lit up on total, so 3 maps to 5. – Volatility Jan 21 '15 at 10:22

The rule is that the line must cross itself an even number of times. The number is a red herring. I draw a line segment.

• Great idea! That's not the pattern I had in mind, though. There's an actual relationship between the line and the challenge given by the guard. – Undo Jan 20 '15 at 21:41
• @Undo Does each number correspond to only one possible drawing? Does each drawing correspond to only one number? – xnor Jan 20 '15 at 21:42
• Each number corresponds to exactly one drawing, each drawing may correspond to multiple numbers. Adding that to the question. – Undo Jan 20 '15 at 21:43

Is it based on the English spelling on different keyboard layouts? I know the eight is, but I'm not entirely sure of the allowed answers. Is it a different keyboard layout?

• Yes, it's not foreign (trying to tailor this comment such that it doesn't spoil the fun for someone that hasn't gotten this far yet). There's another step or two in there before you hit a solution, though. – Undo Jan 21 '15 at 0:12
• To clarify, standard, not special layout. – Undo Jan 21 '15 at 0:17
• Three is five but I'm not sure why. Hope I'm not giving too much away – Tom Jan 21 '15 at 0:20
• Nine is four, forty is ten. – Tom Jan 21 '15 at 0:24
• 99 is twelve. Still not quite sure why but it's coming... – Tom Jan 21 '15 at 0:25