Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. How old are my kids? (math puzzle)

How old are my kids? (math puzzle)

Scheduled Pinned Locked Moved The Lounge
questioncomhelp
16 Posts 12 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Vikram A Punathambekar

    A man walks into a bar, orders a drink and starts chatting with the bartender. He learns that the bartender has three children. "How old are your children?" he asks. "The product of their ages is 72" the bartender replies. "That's not enough info" the man says. The bartender says "If you go outside and see the building number, you'll see the sum of their ages". The man goes out and comes back after a moment, declaring "still not enough". The bartender smiles and says "My youngest loves strawberry and ice cream". How old are the children? Actually the answer I gave convinced my friend who asked me this question, but it failed to convince *me*. :rolleyes: I can't understand the following points: Why isn't the door number mentioned in the problem? Also, how does it matter if the youngest loves or hates strawberry and ice cream? The answer according to her is 6,6,2. But how? :confused:
    Vikram.


    My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

    T Offline
    T Offline
    Tim Smith
    wrote on last edited by
    #3

    The last clue is there to tell you the two youngest children have two different ages. Tim Smith I'm going to patent thought. I have yet to see any prior art.

    1 Reply Last reply
    0
    • V Vikram A Punathambekar

      A man walks into a bar, orders a drink and starts chatting with the bartender. He learns that the bartender has three children. "How old are your children?" he asks. "The product of their ages is 72" the bartender replies. "That's not enough info" the man says. The bartender says "If you go outside and see the building number, you'll see the sum of their ages". The man goes out and comes back after a moment, declaring "still not enough". The bartender smiles and says "My youngest loves strawberry and ice cream". How old are the children? Actually the answer I gave convinced my friend who asked me this question, but it failed to convince *me*. :rolleyes: I can't understand the following points: Why isn't the door number mentioned in the problem? Also, how does it matter if the youngest loves or hates strawberry and ice cream? The answer according to her is 6,6,2. But how? :confused:
      Vikram.


      My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

      G Offline
      G Offline
      Gary Kirkham
      wrote on last edited by
      #4

      Find all of the combinations of three numbers whose product is 72. Then you look at the sums of the three numbers, since there is not enough info that means that there is more than one sum that produces the same value. In this case two (8 3 3 and 6 6 2). Since there is one youngest child then you can't have two -> 6 6 2 is the answer. Gary Kirkham A working Program is one that has only unobserved bugs I thought I wanted a career, turns out I just wanted paychecks

      1 Reply Last reply
      0
      • J jhaga

        I have seen this explanation: Solution: First, determine all the ways that three ages can multiply together to get 72: 72 1 1 (quite a feat for the bartender) 36 2 1 24 3 1 18 4 1 18 2 2 12 6 1 12 3 2 9 4 2 9 8 1 8 3 3 6 6 2 6 4 3 As the man says, that's not enough information; there are many possibilities. So the bartender tells him where to find the sum of the ages--the man now knows the sum even though we don't. Yet he still insists that there isn't enough info. This must mean that there are two permutations with the same sum; otherwise the man could have easily deduced the ages. The only pair of permutations with the same sum are 8 3 3 and 6 6 2, which both add up to 14 (the bar's address). Now the bartender mentions his "youngest"--telling us that there is one child who is younger than the other two. This is impossible with 8 3 3--there are two 3 year olds. Therefore the ages of the children are 6, 6, and 2. jhaga --------------------------------- I went to the woods because I wished to live deliberately, to front only the essential facts of life, and see if I could not learn what it had to teach, and not, when I came to die, discover that I had not lived. If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away. Henry David Thoreau, Walden, Conclusion, 1854

        B Offline
        B Offline
        brianwelsch
        wrote on last edited by
        #5

        :cool: BW "In a world full of people, only some want to fly,Isn't that crazy?" - Seal

        1 Reply Last reply
        0
        • J jhaga

          I have seen this explanation: Solution: First, determine all the ways that three ages can multiply together to get 72: 72 1 1 (quite a feat for the bartender) 36 2 1 24 3 1 18 4 1 18 2 2 12 6 1 12 3 2 9 4 2 9 8 1 8 3 3 6 6 2 6 4 3 As the man says, that's not enough information; there are many possibilities. So the bartender tells him where to find the sum of the ages--the man now knows the sum even though we don't. Yet he still insists that there isn't enough info. This must mean that there are two permutations with the same sum; otherwise the man could have easily deduced the ages. The only pair of permutations with the same sum are 8 3 3 and 6 6 2, which both add up to 14 (the bar's address). Now the bartender mentions his "youngest"--telling us that there is one child who is younger than the other two. This is impossible with 8 3 3--there are two 3 year olds. Therefore the ages of the children are 6, 6, and 2. jhaga --------------------------------- I went to the woods because I wished to live deliberately, to front only the essential facts of life, and see if I could not learn what it had to teach, and not, when I came to die, discover that I had not lived. If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away. Henry David Thoreau, Walden, Conclusion, 1854

          V Offline
          V Offline
          Vikram A Punathambekar
          wrote on last edited by
          #6

          [applause] Cool! Thanks, jhaga. You got my 5.
          Vikram.


          My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

          P 1 Reply Last reply
          0
          • V Vikram A Punathambekar

            A man walks into a bar, orders a drink and starts chatting with the bartender. He learns that the bartender has three children. "How old are your children?" he asks. "The product of their ages is 72" the bartender replies. "That's not enough info" the man says. The bartender says "If you go outside and see the building number, you'll see the sum of their ages". The man goes out and comes back after a moment, declaring "still not enough". The bartender smiles and says "My youngest loves strawberry and ice cream". How old are the children? Actually the answer I gave convinced my friend who asked me this question, but it failed to convince *me*. :rolleyes: I can't understand the following points: Why isn't the door number mentioned in the problem? Also, how does it matter if the youngest loves or hates strawberry and ice cream? The answer according to her is 6,6,2. But how? :confused:
            Vikram.


            My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

            R Offline
            R Offline
            Russell Morris
            wrote on last edited by
            #7

            This is a Microsoft-ish interview question (ie a brain teaser). You know that the product of the three childrens' ages is 72, so factor 72 into its primes, and then start multiplying them together to get sets of 3 numbers: 72 = 9 x 8 = 3 x 3 x 2 x 2 x 2 3-number combinations of prime factors: 3 x 3 x 8 9 x 4 x 2 18 x 2 x 2 3 x 12 x 2 3 x 4 x 6 6 x 6 x 2 etc... (that may be all of them, or I may have missed a few) You now have a set of 3-tuples, each of whose product is 72, and each could represent the ages of the man's three children. The thing to realize is that this information isn't enough for the man to identify which of the tuples is the correct one. The bartender then says that the building number represents the sum of their ages: 3 + 3 + 8 = 14 9 + 4 + 2 = 15 18 + 2 + 2 = 22 3 + 12 + 2 = 17 3 + 4 + 6 = 13 6 + 6 + 2 = 14 This info still isn't enough for the man to figure out which tuple represents the children's ages. This is because 2 of the tuples add up to the same number, 14 - (meaning that the building number was 14, BTW). Because of this, the man still needs more info. The bartender then mentions that he has a 'youngest', which means that one of the children is younger than the other two. Of the two tuples left: 3 3 8 6 6 2 only (6 6 2) has one 'youngest' - 2. (3 3 8) has two 'youngest', which goes against the bartender's use of the singular when referring to his youngest child. I got asked that teaser in a phone interview. I totally bombed it, as I was bombed the night before :) -- Russell Morris "Have you gone mad Frink? Put down that science pole!"

            1 Reply Last reply
            0
            • V Vikram A Punathambekar

              A man walks into a bar, orders a drink and starts chatting with the bartender. He learns that the bartender has three children. "How old are your children?" he asks. "The product of their ages is 72" the bartender replies. "That's not enough info" the man says. The bartender says "If you go outside and see the building number, you'll see the sum of their ages". The man goes out and comes back after a moment, declaring "still not enough". The bartender smiles and says "My youngest loves strawberry and ice cream". How old are the children? Actually the answer I gave convinced my friend who asked me this question, but it failed to convince *me*. :rolleyes: I can't understand the following points: Why isn't the door number mentioned in the problem? Also, how does it matter if the youngest loves or hates strawberry and ice cream? The answer according to her is 6,6,2. But how? :confused:
              Vikram.


              My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

              D Offline
              D Offline
              Davy Mitchell
              wrote on last edited by
              #8

              What kind of scumbag makes up these puzzles!??! :-D Davy
              My Personal Blog - Homepage.
              Scottish News - Angus Blog, Perth Blog and Dundee Blog

              R 1 Reply Last reply
              0
              • D Davy Mitchell

                What kind of scumbag makes up these puzzles!??! :-D Davy
                My Personal Blog - Homepage.
                Scottish News - Angus Blog, Perth Blog and Dundee Blog

                R Offline
                R Offline
                Ranjan Banerji
                wrote on last edited by
                #9

                Precisely. What kind of scumbag makes up these puzzles!??! :)

                C V 2 Replies Last reply
                0
                • R Ranjan Banerji

                  Precisely. What kind of scumbag makes up these puzzles!??! :)

                  C Offline
                  C Offline
                  code frog 0
                  wrote on last edited by
                  #10

                  Graduate students that want to impress their colleagues and piss of the regular student that has to figure out this (*)#@*$)(#@ thing as a "BONUS" problem on the math test they know they failed unless they get this bonus problem right.


                  "Back to school, back to school; to prove to dad I'm not a fool." - Billy Madison (Adam Sandler) Rex Winn

                  V 1 Reply Last reply
                  0
                  • V Vikram A Punathambekar

                    [applause] Cool! Thanks, jhaga. You got my 5.
                    Vikram.


                    My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

                    P Offline
                    P Offline
                    peterchen
                    wrote on last edited by
                    #11

                    for some clever googling? ;P


                    "Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
                    sighist | Agile Programming | doxygen

                    1 Reply Last reply
                    0
                    • J jhaga

                      I have seen this explanation: Solution: First, determine all the ways that three ages can multiply together to get 72: 72 1 1 (quite a feat for the bartender) 36 2 1 24 3 1 18 4 1 18 2 2 12 6 1 12 3 2 9 4 2 9 8 1 8 3 3 6 6 2 6 4 3 As the man says, that's not enough information; there are many possibilities. So the bartender tells him where to find the sum of the ages--the man now knows the sum even though we don't. Yet he still insists that there isn't enough info. This must mean that there are two permutations with the same sum; otherwise the man could have easily deduced the ages. The only pair of permutations with the same sum are 8 3 3 and 6 6 2, which both add up to 14 (the bar's address). Now the bartender mentions his "youngest"--telling us that there is one child who is younger than the other two. This is impossible with 8 3 3--there are two 3 year olds. Therefore the ages of the children are 6, 6, and 2. jhaga --------------------------------- I went to the woods because I wished to live deliberately, to front only the essential facts of life, and see if I could not learn what it had to teach, and not, when I came to die, discover that I had not lived. If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away. Henry David Thoreau, Walden, Conclusion, 1854

                      A Offline
                      A Offline
                      adrian cooper
                      wrote on last edited by
                      #12

                      very cool :cool::cool: waxie me; while(myKitchen.beerInFridge()) { me.watchTV(); me.consumeBeer(myKitchen.getBeerCan()); }

                      1 Reply Last reply
                      0
                      • C code frog 0

                        Graduate students that want to impress their colleagues and piss of the regular student that has to figure out this (*)#@*$)(#@ thing as a "BONUS" problem on the math test they know they failed unless they get this bonus problem right.


                        "Back to school, back to school; to prove to dad I'm not a fool." - Billy Madison (Adam Sandler) Rex Winn

                        V Offline
                        V Offline
                        Vikram A Punathambekar
                        wrote on last edited by
                        #13

                        :laugh: Actually, this is the type of questions we get during on-campus placement (recruitment). Hope Katie is doing well. You started college?
                        Vikram.


                        My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

                        C 1 Reply Last reply
                        0
                        • R Ranjan Banerji

                          Precisely. What kind of scumbag makes up these puzzles!??! :)

                          V Offline
                          V Offline
                          Vikram A Punathambekar
                          wrote on last edited by
                          #14

                          "What kind of scumbag makes up these puzzles!??!" The scumbags who don't want to restrict themselves to asking programming questions when recruiting students for programming jobs. :-D BTW, I read your post. Thanks! I'll get back to you later.
                          Vikram.


                          My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

                          1 Reply Last reply
                          0
                          • J jhaga

                            I have seen this explanation: Solution: First, determine all the ways that three ages can multiply together to get 72: 72 1 1 (quite a feat for the bartender) 36 2 1 24 3 1 18 4 1 18 2 2 12 6 1 12 3 2 9 4 2 9 8 1 8 3 3 6 6 2 6 4 3 As the man says, that's not enough information; there are many possibilities. So the bartender tells him where to find the sum of the ages--the man now knows the sum even though we don't. Yet he still insists that there isn't enough info. This must mean that there are two permutations with the same sum; otherwise the man could have easily deduced the ages. The only pair of permutations with the same sum are 8 3 3 and 6 6 2, which both add up to 14 (the bar's address). Now the bartender mentions his "youngest"--telling us that there is one child who is younger than the other two. This is impossible with 8 3 3--there are two 3 year olds. Therefore the ages of the children are 6, 6, and 2. jhaga --------------------------------- I went to the woods because I wished to live deliberately, to front only the essential facts of life, and see if I could not learn what it had to teach, and not, when I came to die, discover that I had not lived. If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away. Henry David Thoreau, Walden, Conclusion, 1854

                            B Offline
                            B Offline
                            Brit
                            wrote on last edited by
                            #15

                            jhaga wrote: Now the bartender mentions his "youngest"--telling us that there is one child who is younger than the other two. This is impossible with 8 3 3--there are two 3 year olds. I think this is a minor point, but even with twins, there is an older and younger one. Further, the term "irish twins" refers to siblings from different pregnancies who are born less than 12 months apart. Thus, it is possible to have two children who are 3 years old, but have more than a 9 months difference in ages. ------------------------------------------ "I had no interest in trying to actually drive [in Italy], that would have been suicide. It would have been comitting my body entirely to game with indistinct rules, playing with a nation of opponents who are professionals at the sport."

                            1 Reply Last reply
                            0
                            • V Vikram A Punathambekar

                              :laugh: Actually, this is the type of questions we get during on-campus placement (recruitment). Hope Katie is doing well. You started college?
                              Vikram.


                              My soon-to-be-updated site KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames. pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.

                              C Offline
                              C Offline
                              code frog 0
                              wrote on last edited by
                              #16

                              Katie is sort of doing well. She may have a new problem. Not sure, need to call her surgeon on Monday (my time, not India [GRIN]). Have not started school yet. Won't for another month. Cannot wait though, it will be totally fun!!!


                              "Back to school, back to school; to prove to dad I'm not a fool." - Billy Madison (Adam Sandler) Rex Winn

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups