# Petals around the rose

You roll 5 dice and I'll always be able to give a number uniquely-defined by the numbers on the dice. You have to figure out how it works, without looking it up. Here's a couple example rolls:

1,2,3,4,5 = 6

3,6,2,3,1 = 4

If you need any more rolls to determine the answer, comment them.

Please try not to look it up, and if you do, don't answer it, it'll ruin the fun for others. Only answer if YOU figured it out.

Also note that the name is especially important.

Hint:

The answer will always be even (0 is also even)

Guess who took A LONG TIME to figure this out?

Bill Gates, so if you figured this out fast, consider yourself lucky: http://www.borrett.id.au/computing/petals-bg.htm

• I'm not going to answer this one, as I know it... it's a classic riddle, even made it to MENSA magazine. Pretty clever game. – generalcrispy Oct 9 '14 at 19:58
• I added the tag myself. You might have to approve the edit, or feel free to reject and do it differently. Use ">!" in front of lines to add them to spoiler tags, which require hovering-over to see. – TheRubberDuck Oct 9 '14 at 20:02
• I am not impressed by your ability to always give a number. You've given us nothing to go on with this puzzle. You don't even state that the number is deterministically derived from the dice roll! – Gilles 'SO- stop being evil' Oct 13 '14 at 10:00
• 'Uniquely defined by your dice' implies to me that each answer is unique - i.e. that only one set of 5 dice has the answer 6. – Wossname Nov 3 '14 at 23:51
• I think this is a poor question without more examples to work with. The lowest unrolled number satisfies both examples. – Ross Millikan Nov 4 '14 at 1:02

Some further example rolls:

4, 1, 3, 5, 4: 6
4, 2, 4, 6, 1: 0
3, 2, 5, 3, 6: 8

A hint:

The name "Petals Around the Rose" is especially important.

The correct number is the number of "petals" (pips on the dice) that are around "roses" (pips in the center of the die). Even numbers have no center pip, therefore no petals. Odd numbers have pips in the center and thus have roses whose petals are counted. However, 1 has no non-rose pips. That leaves 3, with 2 other pips, and 5, with 4 other pips. In effect, each 3 rolled adds 2 to the count and each 5 adds 4 to the count.

• In before a bunch of people start creating accounts to yell at us because "YOU'RE NOT SUPPOSED TO REVEAL THE SOLUTION PEOPLE NEED TO FIGURE IT OUT BY THEMSELVES, GOD." – Joe Z. Nov 4 '14 at 16:31
• The Wikipedia article has suffered similar abuse. Almost like clockwork it gets edits by some person who believes that the solution should not be revealed, and then proceeds to remove the solution and leave a warning. – Joe Z. Nov 4 '14 at 16:33
• @JoeZ. Eh. We're not hurting anyone. Nobody better be starting a secret club where you can only get in if you've solved the puzzle! – TheRubberDuck Nov 4 '14 at 16:34
• It would be a stupid club anyway. – Joe Z. Nov 4 '14 at 16:35
• @JoeZ. It's not a very well-kept secret. You can see the solution in the source code on Lloyd Borrett's online version of the game. Check the btnGuess_OnClick() function. – Engineer Toast Apr 28 '15 at 15:55

The answer comes in the form of the matematical function:

$f(x)=\sum{ ( x_i \mod 2 ) · ( x_i - 1 )}$

Which is generalised for any number of rolls in a $n$-side dice.

The sum goes from 1 to the number of rolls, $x_i$ is the result of each roll and $x_i-1$ is the number of 'Petals around the rose' for each roll.

• Awesome! That's really cool! – warspyking Oct 12 '14 at 14:39
• "Which is generalised for any number of rolls in a n-side dice." That's a nice idea, but the puzzle sort of relies on the pip layout of a "standard" six-sided die. If you change the number, it's not clear how to arrange the pips for values larger than 6, and this brainteaser sort of falls apart. For example, Your equation assumes a rolled 8 yields no points, but if you arrange the pips like typical playing cards, you could argue that a rolled 8 is worth 6 petals. – TheRubberDuck Oct 15 '14 at 18:48
• Hmmm that's an interesting point which i didn't think about. Nice point out! – Ioannes Oct 15 '14 at 18:50