/* Tallys' puzzle in Picat. From Tallys Yunes https://www.facebook.com/tallys?hc_ref=ARS06--p0uJfQun0BcHP52ElJXAbcRazIT8WEivaQiNibWkW-0hlWvfhG7Cgz8c1eLA (April 7, 2018) """ I ran into this puzzle yesterday, and the number of people getting the wrong answer was scary. Let's see how many of my friends who do NOT have STEM degrees can solve it. 3 * (A _square_ inside a _pentagon_ inside a _hexagon_) = 15 (Four _bananas_) + (Four _bananas_) + (A _square_ inside a _pentagon_ inside a _hexagon_) = 23 (Four _bananas_) + (Three o'_clock_) + (Three o'_clock_) = 10 (Two o'_clock_) + (Three _bananas_) + (Three bananas)*(A _pentagon_ inside a _hexagon_) = _??_ """ Where each _xxxx_ is a specific variable. And "Four", "Three", and "Two" are interpreted as 4, 3, and 2 respectively. What values is "??". (Normally we probably assume that it's a two digit number.) This is my interpretation of the puzzle, i.e. that the answer is 38 [x = 38,square = 4,pentagon = 5,hexagon = 6,bananas = 1,clock = 1] However, there are 92 possible solutions of this puzzle, with some specific and (perhaps inconsisten interpretations): [x = 11,square = 13,pentagon = 1,hexagon = 1,bananas = 1,clock = 1] [x = 14,square = 12,pentagon = 1,hexagon = 2,bananas = 1,clock = 1] [x = 14,square = 12,pentagon = 2,hexagon = 1,bananas = 1,clock = 1] [x = 17,square = 11,pentagon = 1,hexagon = 3,bananas = 1,clock = 1] [x = 17,square = 11,pentagon = 2,hexagon = 2,bananas = 1,clock = 1] [x = 17,square = 11,pentagon = 3,hexagon = 1,bananas = 1,clock = 1] [x = 20,square = 10,pentagon = 1,hexagon = 4,bananas = 1,clock = 1] [x = 20,square = 10,pentagon = 2,hexagon = 3,bananas = 1,clock = 1] [x = 20,square = 10,pentagon = 3,hexagon = 2,bananas = 1,clock = 1] [x = 20,square = 10,pentagon = 4,hexagon = 1,bananas = 1,clock = 1] [x = 23,square = 9,pentagon = 1,hexagon = 5,bananas = 1,clock = 1] [x = 23,square = 9,pentagon = 2,hexagon = 4,bananas = 1,clock = 1] [x = 23,square = 9,pentagon = 3,hexagon = 3,bananas = 1,clock = 1] [x = 23,square = 9,pentagon = 4,hexagon = 2,bananas = 1,clock = 1] [x = 23,square = 9,pentagon = 5,hexagon = 1,bananas = 1,clock = 1] [x = 26,square = 8,pentagon = 1,hexagon = 6,bananas = 1,clock = 1] [x = 26,square = 8,pentagon = 2,hexagon = 5,bananas = 1,clock = 1] [x = 26,square = 8,pentagon = 3,hexagon = 4,bananas = 1,clock = 1] [x = 26,square = 8,pentagon = 4,hexagon = 3,bananas = 1,clock = 1] [x = 26,square = 8,pentagon = 5,hexagon = 2,bananas = 1,clock = 1] [x = 26,square = 8,pentagon = 6,hexagon = 1,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 1,hexagon = 7,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 2,hexagon = 6,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 3,hexagon = 5,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 4,hexagon = 4,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 5,hexagon = 3,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 6,hexagon = 2,bananas = 1,clock = 1] [x = 29,square = 7,pentagon = 7,hexagon = 1,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 1,hexagon = 8,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 2,hexagon = 7,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 3,hexagon = 6,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 4,hexagon = 5,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 5,hexagon = 4,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 6,hexagon = 3,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 7,hexagon = 2,bananas = 1,clock = 1] [x = 32,square = 6,pentagon = 8,hexagon = 1,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 1,hexagon = 9,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 2,hexagon = 8,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 3,hexagon = 7,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 4,hexagon = 6,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 5,hexagon = 5,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 6,hexagon = 4,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 7,hexagon = 3,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 8,hexagon = 2,bananas = 1,clock = 1] [x = 35,square = 5,pentagon = 9,hexagon = 1,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 1,hexagon = 10,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 2,hexagon = 9,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 3,hexagon = 8,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 4,hexagon = 7,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 5,hexagon = 6,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 6,hexagon = 5,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 7,hexagon = 4,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 8,hexagon = 3,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 9,hexagon = 2,bananas = 1,clock = 1] [x = 38,square = 4,pentagon = 10,hexagon = 1,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 1,hexagon = 11,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 2,hexagon = 10,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 3,hexagon = 9,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 4,hexagon = 8,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 5,hexagon = 7,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 6,hexagon = 6,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 7,hexagon = 5,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 8,hexagon = 4,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 9,hexagon = 3,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 10,hexagon = 2,bananas = 1,clock = 1] [x = 41,square = 3,pentagon = 11,hexagon = 1,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 1,hexagon = 12,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 2,hexagon = 11,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 3,hexagon = 10,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 4,hexagon = 9,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 5,hexagon = 8,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 6,hexagon = 7,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 7,hexagon = 6,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 8,hexagon = 5,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 9,hexagon = 4,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 10,hexagon = 3,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 11,hexagon = 2,bananas = 1,clock = 1] [x = 44,square = 2,pentagon = 12,hexagon = 1,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 1,hexagon = 13,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 2,hexagon = 12,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 3,hexagon = 11,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 4,hexagon = 10,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 5,hexagon = 9,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 6,hexagon = 8,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 7,hexagon = 7,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 8,hexagon = 6,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 9,hexagon = 5,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 10,hexagon = 4,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 11,hexagon = 3,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 12,hexagon = 2,bananas = 1,clock = 1] [x = 47,square = 1,pentagon = 13,hexagon = 1,bananas = 1,clock = 1] count = 92 The possible solutions of "??" (i.e. answers) are then [11,14,17,20,23,26,29,32,35,38,41,44,47]. Note: The following is an aside. In the thread, there was a discussion about assumptions, where I noted the following: """ Hakan Kjellerstrand: Regarding assumptions, we can state the "Principle of Least Surprise" (or perhaps "Principle of Simplest Assumptions") in these type of puzzles such as: * we are dealing with positive integers, unless there is no hint otherwise. * we are in the realm of "modulo Infinite" instead of some arbitrary modulo (e.g. modulo 47), unless there is no hint otherwise * the result (right hand side) of the equations are the traditional "school" numbers , unless there is no hint otherwise * the meaning of the variables/symbols in the puzzle are the same throughout the puzzle. Unless there is no hint otherwise. * the arithmetic rules are the traditional school rules and are constant in the puzzle. E.g. The "+" in first equation means the same as the "+" in the last equation. Unless there is no hint otherwise. """ Somebody else commented (I don't know if it's OK to mention the name): """ : With respect, don't you find it somewhat surprising that the value of the clock changes by the position of its hands? I find that assumption particularly perplexing, given your own assertion of 'principle of simplest assumptions' and the value of the other items only varies when the 'whole item' is changed. For instance, the value of the banana changes when there are fewer bananas, why then, if I still have an entire clock does its value change? """ On this I commented: """ Hakan Kjellerstrand: Well, I don't find it that surprising. It would perhaps surprise me more if the 2 o'clock clock would have the same value as the 3 o'clock clock, as well as if four bananas has the same value as three bananas (according to the assumption that the values of the symbols/variables are constant). However, I can imagine another problem instance where both these clocks mean the value of 1 (but then the equation would be different). It's a part of these type of puzzles to abstract each clue (and parts of the clues/symbols) just enough to make it solvable. Regarding your previous comment, it is another thing that there might be other interpretations of the symbols/hints that give different - coherent and satisfiable - solutions than what the creator of the puzzle had in mind. I'm not sure if my answer is the correct one (i.e. the same as the creators), but I do believe that it is coherent and satisfiable. Perhaps these puzzles are meaningless, but they are fun. """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. go ?=> Map = get_global_map(), Map.put(count,1), Map.put(xs,[]), (Square+Pentagon+Hexagon) + (Square+Pentagon+Hexagon) + (Square+Pentagon+Hexagon) #= 45, 4*Bananas + 4*Bananas + (Square+Pentagon+Hexagon) #= 23, 4*Bananas + 3*Clock + 3*Clock #= 10, 2*Clock + 3*Bananas + ((3*Bananas)*(Pentagon+Hexagon)) #= X, Vars = [X,Square,Pentagon,Hexagon, Bananas, Clock], Vars :: 1..100, solve(Vars), println([x=X,square=Square,pentagon=Pentagon,hexagon=Hexagon,bananas=Bananas,clock=Clock]), Map.put(count,Map.get(count)+1), Map.put(xs,Map.get(xs)++[X]), fail, nl. go => Map = get_global_map(), println(count=Map.get(count)), println(numXs=Map.get(xs).sort_remove_dups()). % If we instead multiply the square, pentagon and hexagon, there are 10 solutions: % % [x = 8,square = 15,pentagon = 1,hexagon = 1,bananas = 1,clock = 1] % [x = 14,square = 5,pentagon = 1,hexagon = 3,bananas = 1,clock = 1] % [x = 14,square = 5,pentagon = 3,hexagon = 1,bananas = 1,clock = 1] % [x = 20,square = 3,pentagon = 1,hexagon = 5,bananas = 1,clock = 1] % [x = 20,square = 3,pentagon = 5,hexagon = 1,bananas = 1,clock = 1] % [x = 50,square = 1,pentagon = 1,hexagon = 15,bananas = 1,clock = 1] % [x = 50,square = 1,pentagon = 3,hexagon = 5,bananas = 1,clock = 1] % [x = 50,square = 1,pentagon = 5,hexagon = 3,bananas = 1,clock = 1] % [x = 50,square = 1,pentagon = 15,hexagon = 1,bananas = 1,clock = 1] % count = 10 % numXs = [8,14,20,50] % go2 ?=> Map = get_global_map(), Map.put(count,1), Map.put(xs,[]), (Square*Pentagon*Hexagon) + (Square*Pentagon*Hexagon) + (Square*Pentagon*Hexagon) #= 45, 4*Bananas + 4*Bananas + (Square*Pentagon*Hexagon) #= 23, 4*Bananas + 3*Clock + 3*Clock #= 10, 2*Clock + 3*Bananas + ((3*Bananas)*(Pentagon*Hexagon)) #= X, Vars = [X,Square,Pentagon,Hexagon, Bananas, Clock], Vars :: 1..100, solve(Vars), println([x=X,square=Square,pentagon=Pentagon,hexagon=Hexagon,bananas=Bananas,clock=Clock]), Map.put(count,Map.get(count)+1), Map.put(xs,Map.get(xs)++[X]), fail, nl. go2 => Map = get_global_map(), println(count=Map.get(count)), println(numXs=Map.get(xs).sort_remove_dups()).