Serving the Quantitative Finance Community

 
User avatar
beero1000
Topic Author
Posts: 0
Joined: February 28th, 2007, 4:41 am

wizards

February 9th, 2009, 8:15 pm

Last night I sat behind two wizards on a bus, and overheard the following:— A: “I have a positive integral number of children, whose ages are positive integers, the sum of which is the number of this bus, while the product is my own age.”— B: “How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?”— A: “No.”— B: “Aha! AT LAST I know how old you are!”Now what was the number of the bus?
 
User avatar
alphaquantum
Posts: 0
Joined: January 9th, 2008, 11:24 pm

wizards

February 9th, 2009, 8:45 pm

A: No
 
User avatar
timeds
Posts: 0
Joined: October 6th, 2005, 10:50 am

wizards

February 10th, 2009, 2:45 pm

Mathematically I don't think there is a unique solution.Consider case A number on bus = 16, case B number on bus = 12Case A: feasible situation is 2 kids aged 8 and 8 respectively (fits criteria)Case B: feasible situation is 2 kids aged 8 and 4 respectively (fits criteria)However on the basis that they were wizards on a bus ... they might have been travelling from the Crystal Palace to the Marble Arch, so the number on the bus could be the 137 and it would be at night so it's the N137.
 
User avatar
beero1000
Topic Author
Posts: 0
Joined: February 28th, 2007, 4:41 am

wizards

February 10th, 2009, 3:14 pm

but in both of your cases given the wizard's age and the number of children, we can figure out their individual ages.there is a unique solution.
 
User avatar
timeds
Posts: 0
Joined: October 6th, 2005, 10:50 am

wizards

February 10th, 2009, 3:34 pm

Am I being dumb? E.g. case A if you know the wizard is 64 with 2 kids they could be 8 and 8, or 4 and 16?
Last edited by timeds on February 9th, 2009, 11:00 pm, edited 1 time in total.
 
User avatar
beero1000
Topic Author
Posts: 0
Joined: February 28th, 2007, 4:41 am

wizards

February 10th, 2009, 3:51 pm

but we also know the bus number.
 
User avatar
wileysw
Posts: 7
Joined: December 9th, 2006, 6:13 pm

wizards

February 10th, 2009, 5:07 pm

i did a quick search using mathematica, only considering a solution with 3 children (if only 2 children, then knowing the sum and product uniquely determine their ages) and their ages are all below 10 (including grandchildren?).age 36, bus # 13: (1,6,6) and (2,2,9)age 40, bus # 14: (1,5,8) and (2,2,10)age 72, bus # 14: (2,6,6) and (3,3,8)age 90, bus # 16: (2,5,9) and (3,3,10)...seems the plausible answer is 14?----- ----- ----- ----- -----on second thought, i'm now confused: for any solution, if we add any number of children with age 1 (which changes the bus # but not wizard's age), is not that a solution too? e.g., consider (1,1,6,6) and (1,2,2,9).
Last edited by wileysw on February 9th, 2009, 11:00 pm, edited 1 time in total.
 
User avatar
alphaquantum
Posts: 0
Joined: January 9th, 2008, 11:24 pm

wizards

February 10th, 2009, 5:57 pm

QuoteOriginally posted by: wileyswon second thought, i'm now confused: for any solution, if we add any number of children with age 1 (which changes the bus # but not wizard's age), is not that a solution too? e.g., consider (1,1,6,6) and (1,2,2,9).Exactly
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

wizards

February 10th, 2009, 8:21 pm

QuoteOriginally posted by: beero1000— B: “Aha! AT LAST I know how old you are!”Does it mean that A is older than B ? If B was older than A, he would know his age.
 
User avatar
beero1000
Topic Author
Posts: 0
Joined: February 28th, 2007, 4:41 am

wizards

February 10th, 2009, 8:25 pm

the issue that's being missed here is that B could figure out A's age using only the bus number and the fact that he wouldn't be able to determine the children's individuals age if he knew the number of children, the age and the bus number.for exampleage 40, bus # 14: (1,5,8) and (2,2,10)age 72, bus # 14: (2,6,6) and (3,3,8)here we know that the bus number can't be 14 because if it was then B wouldn't be able to say "Aha! AT LAST I know how old you are!” as there are multiple possible ages.and yes, if n can't be the bus number, by adding children of age 1 we know that no number n or higher can be the bus number.This puzzle is by John Conway, if you're curious. (it has a unique solution)
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

wizards

February 10th, 2009, 9:08 pm

Bus = 12Age = 48# of children = 4Possible ages = {4, 4, 3, 1} or {6, 2, 2, 2}In Mathematica:<< Combinatorica`tabela = Sort[Map[{{Apply[Plus, #], Apply[Times, #], Length[#]}, #} &, Flatten[Table[Partitions[j], {j, 1, 15}], 1]]];Select[Tally[First[Transpose[tabela]]], (Last[#] > 1) &]{{{12, 48, 4}, 2}, {{13, 36, 3}, 2}, {{13, 48, 5}, 2}, {{14, 36, 4}, 2}, {{14, 40, 3}, 2}, {{14, 48, 6}, 2}, {{14, 72, 3}, 2}, {{14, 96, 5}, 2}, {{15, 36, 5}, 2}, {{15, 40, 4}, 2}, {{15, 48, 7}, 2}, {{15, 72, 4}, 3}, {{15, 96, 4}, 2}, {{15, 96, 6}, 2}, {{15, 144, 5}, 2}}12 has only one possibility.
 
User avatar
wileysw
Posts: 7
Joined: December 9th, 2006, 6:13 pm

wizards

February 11th, 2009, 7:15 pm

MCarreira, could you help me to work out a generalization of the problem:hxxp://blog.tanyakhovanova.com/?p=36my quick search yields an upper bound of 30 for the bus #:(2,6,7,15) and (3,3,10,14)(2,5,5,6,12) and (3,3,4,10,10)hence all numbers >=30 are ruled out as you can add children of age 1 to the above solutions.
 
User avatar
MCarreira
Posts: 64
Joined: January 1st, 1970, 12:00 am

wizards

February 11th, 2009, 8:05 pm

tabela2 = Sort[Map[{{Apply[Plus, #], Apply[Times, #], Length[#], #.#}, #} &, Flatten[Table[Partitions[j], {j, 1, 30}], 1]]];Select[Tally[First[Transpose[tabela2]]], (Last[#] > 1) &]{{{26, 3456, 7, 124}, 2}, {{27, 2560, 6, 165}, 2}, {{27, 3456, 8, 125}, 2}, {{28, 2560, 7, 166}, 2}, {{28, 3456, 9, 126}, 2}, {{28, 6912, 8, 128}, 2}, {{29, 2560, 8, 167}, 2}, {{29, 3456, 10, 127}, 2}, {{29, 5120, 7, 169}, 2}, {{29, 6912, 9, 129}, 2}, {{29, 10368, 8, 133}, 2}, {{30, 1260, 4, 314}, 2}, {{30, 2560, 9, 168}, 2}, {{30, 3456, 11, 128}, 2}, {{30, 3600, 5, 234}, 2}, {{30, 5120, 8, 170}, 2}, {{30, 6912, 10, 130}, 2}, {{30, 7680, 7, 174}, 2}, {{30, 10368, 9, 134}, 2}, {{30, 13824, 8, 140}, 2}, {{30, 13824, 9, 132}, 2}}Select[tabela2, (First[#] == {26, 3456, 7, 124}) &]{{{26, 3456, 7, 124}, {6, 6, 6, 2, 2, 2, 2}}, {{26, 3456, 7, 124}, {8, 4, 4, 3, 3, 3, 1}}}So bus = 26, age = 3456 (within the parameters of the generalized problem: "In this generalized puzzle, you should assume that wizards can live thousands of years, and keep their libido that whole time. Wizards might spend so much of their youth thinking, that they postpone starting their families for a long time. The wizards’ wives are also generalized. They can produce children in great quantities and deliver multiple children at the same time in numbers exceeding the current world record."), 7 children, 124 dinossaurs.
 
User avatar
beero1000
Topic Author
Posts: 0
Joined: February 28th, 2007, 4:41 am

wizards

February 11th, 2009, 8:33 pm

I got the answer using the same method (essentially guess and check). Does anyone know of a nice mathematical solution?I think it might be solvable using properties of the elementary symmetric polynomials, but I don't know enough of the mathematics to do anything about it.
 
User avatar
CommodityQuant
Posts: 57
Joined: July 5th, 2007, 6:16 am

wizards

February 19th, 2009, 6:29 pm

Why do you think it's solvable in terms of the elementary symmetric polynomials? Conway is somewhat atypical for a world-class mathematician in that he is interested in recreational maths which sometimes has low theoretical content. For example, he has memorised pi to 1000 decimal places and worked on calendar algorithms which can be applied mentally.