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. TWCP OTD - 2nd of March, 2017

TWCP OTD - 2nd of March, 2017

Scheduled Pinned Locked Moved The Lounge
helpquestion
34 Posts 8 Posters 1 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.
  • J Jon McKee

    Could also just feel around for the 14 tails, flip them over, and you're done. No matter what you decide is a "pile" it will have the same number of tails up - zero. EDIT: Or even better. Pick two coins. If they're both heads you're done. If either is tails flip it over. Done. It never says you have to use all the coins.

    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu Peter
    wrote on last edited by
    #7

    But to find all the 14 tails you have to 'feel' all the coins - there is a much more easy way...

    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

    J 1 Reply Last reply
    0
    • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

      But to find all the 14 tails you have to 'feel' all the coins - there is a much more easy way...

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      J Offline
      J Offline
      Jon McKee
      wrote on last edited by
      #8

      Did you see my edit? Do we have to use all the coins? Or can you simply pick two coins, if both heads you're done (two piles of 0 tails up each), both tails you're done (two piles of 1 tails up each), and in the case of 1 heads 1 tails simply flip one of them and you're done?

      Kornfeld Eliyahu PeterK 1 Reply Last reply
      0
      • J Jon McKee

        Did you see my edit? Do we have to use all the coins? Or can you simply pick two coins, if both heads you're done (two piles of 0 tails up each), both tails you're done (two piles of 1 tails up each), and in the case of 1 heads 1 tails simply flip one of them and you're done?

        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu Peter
        wrote on last edited by
        #9

        The two piles - together - should contains all the coins in the room...

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

        J 1 Reply Last reply
        0
        • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

          ALL ABOUT COUNTING RIGHT In a dark room (so you can't actually recognize the coins, but feel and mover them only) there are 284 coins scattered on the floor. It is known that only 14 hast their tail upward. Create two piles of coins - using all the coins in the room - with the same number of coins with their tails up...

          Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

          V Offline
          V Offline
          virang_21
          wrote on last edited by
          #10

          Gather 14 coins at a time. Feel them if found any tails keep them separate. Repeat until you find all 14 tails and then gather rest of them ( All heads ) and make two piles with same number of coins from head and tail pile. Best case you find all 14 in first go. Worst case you have to feel all 284 coins.

          Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.

          Kornfeld Eliyahu PeterK 1 Reply Last reply
          0
          • V virang_21

            Gather 14 coins at a time. Feel them if found any tails keep them separate. Repeat until you find all 14 tails and then gather rest of them ( All heads ) and make two piles with same number of coins from head and tail pile. Best case you find all 14 in first go. Worst case you have to feel all 284 coins.

            Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #11

            I can live with the best case, the worst case bothers me however... There is much simpler way to do it ;)

            Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            V 1 Reply Last reply
            0
            • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

              I can live with the best case, the worst case bothers me however... There is much simpler way to do it ;)

              Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

              V Offline
              V Offline
              virang_21
              wrote on last edited by
              #12

              Turn the lights on ? :-D

              Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.

              Kornfeld Eliyahu PeterK 1 Reply Last reply
              0
              • V virang_21

                Turn the lights on ? :-D

                Zen and the art of software maintenance : rm -rf * Maths is like love : a simple idea but it can get complicated.

                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu Peter
                wrote on last edited by
                #13

                I'm not sure there is a switch inside the room, but can 'feel' for it...

                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                1 Reply Last reply
                0
                • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                  Yeah! Good luck with that :laugh:

                  Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                  I Offline
                  I Offline
                  Ian Shlasko
                  wrote on last edited by
                  #14

                  Ok, then alternate solutions... 1) Turn on the lights. 2) Bring a flashlight. Seriously, this is 2017. Everyone has a flashlight on their cell phone. 3) Pick up the coins and move them to a room that isn't dark. You said the coins could be felt and MOVED, so move them out of the dark. 4) Split them into two piles and just assume it's fine. After all, it's dark... No one can tell if you're right or not. 5) Cut each coin in half without flipping any, and put half in each of the two piles. By definition, they now all have the same number of tails facing upward.

                  Proud to have finally moved to the A-Ark. Which one are you in?
                  Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                  Kornfeld Eliyahu PeterK 1 Reply Last reply
                  0
                  • I Ian Shlasko

                    Ok, then alternate solutions... 1) Turn on the lights. 2) Bring a flashlight. Seriously, this is 2017. Everyone has a flashlight on their cell phone. 3) Pick up the coins and move them to a room that isn't dark. You said the coins could be felt and MOVED, so move them out of the dark. 4) Split them into two piles and just assume it's fine. After all, it's dark... No one can tell if you're right or not. 5) Cut each coin in half without flipping any, and put half in each of the two piles. By definition, they now all have the same number of tails facing upward.

                    Proud to have finally moved to the A-Ark. Which one are you in?
                    Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                    Kornfeld Eliyahu PeterK Offline
                    Kornfeld Eliyahu PeterK Offline
                    Kornfeld Eliyahu Peter
                    wrote on last edited by
                    #15

                    You came up 5 alternative options, all complicated (except the light, but you have to find it first), while there is a very simple and easy one out there - 15 seconds, most...

                    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                    I 1 Reply Last reply
                    0
                    • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                      ALL ABOUT COUNTING RIGHT In a dark room (so you can't actually recognize the coins, but feel and mover them only) there are 284 coins scattered on the floor. It is known that only 14 hast their tail upward. Create two piles of coins - using all the coins in the room - with the same number of coins with their tails up...

                      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                      N Offline
                      N Offline
                      Nagy Vilmos
                      wrote on last edited by
                      #16

                      Turn 14 coins over in one pile and all the others go into the second pile. Whichever 14 you turn over, there will be the same number of tails on both piles.

                      veni bibi saltavi

                      Kornfeld Eliyahu PeterK I M 3 Replies Last reply
                      0
                      • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                        You came up 5 alternative options, all complicated (except the light, but you have to find it first), while there is a very simple and easy one out there - 15 seconds, most...

                        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                        I Offline
                        I Offline
                        Ian Shlasko
                        wrote on last edited by
                        #17

                        How is turning on the flashlight in my cell phone complicated? I can do that in about five seconds :-D Or are you suggesting just opening the door? Because you never said it was light OUTSIDE the room.

                        Proud to have finally moved to the A-Ark. Which one are you in?
                        Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                        Kornfeld Eliyahu PeterK 1 Reply Last reply
                        0
                        • N Nagy Vilmos

                          Turn 14 coins over in one pile and all the others go into the second pile. Whichever 14 you turn over, there will be the same number of tails on both piles.

                          veni bibi saltavi

                          Kornfeld Eliyahu PeterK Offline
                          Kornfeld Eliyahu PeterK Offline
                          Kornfeld Eliyahu Peter
                          wrote on last edited by
                          #18

                          :thumbsup: Nice and clean!

                          Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                          "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                          1 Reply Last reply
                          0
                          • I Ian Shlasko

                            How is turning on the flashlight in my cell phone complicated? I can do that in about five seconds :-D Or are you suggesting just opening the door? Because you never said it was light OUTSIDE the room.

                            Proud to have finally moved to the A-Ark. Which one are you in?
                            Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                            Kornfeld Eliyahu PeterK Offline
                            Kornfeld Eliyahu PeterK Offline
                            Kornfeld Eliyahu Peter
                            wrote on last edited by
                            #19

                            After you turned on the flashlight, you still have to scan all the coins, that will take some time... See the comment from Nagy (he may had an extra gin) below...

                            Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                            I 1 Reply Last reply
                            0
                            • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                              After you turned on the flashlight, you still have to scan all the coins, that will take some time... See the comment from Nagy (he may had an extra gin) below...

                              Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                              I Offline
                              I Offline
                              Ian Shlasko
                              wrote on last edited by
                              #20

                              Damn, and I was only one step away from suggesting burning down the room so all the coins would be so scorched that none of them would be showing heads OR tails. And he had to go and post an actual answer... How's a guy supposed to troll in this kind of environment? :laugh:

                              Proud to have finally moved to the A-Ark. Which one are you in?
                              Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                              Kornfeld Eliyahu PeterK 1 Reply Last reply
                              0
                              • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                                The two piles - together - should contains all the coins in the room...

                                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                J Offline
                                J Offline
                                Jon McKee
                                wrote on last edited by
                                #21

                                I think I figured it out. My last guess (though it didn't account for all the coins) was on the right track. Take a simple example of TTTHHHHHHH (7 heads, 3 tails). If you take three coins you'll get either {TTT}, {TTH}, {THH}, or {HHH} leaving {HHHHHHH}, {THHHHHH}, {TTHHHHH}, or {TTTHHHH} respectively. Those don't match up, but if you notice, flipping what was taken yields equal tails (example: {TTH} -> {HHT}, {THHHHHHH} = 1T each). This flipping works by removing coins equal to the number of tails. By subsequently flipping the coins, this set now contains a number of a heads equal to the number of tails removed from the original set and a number of tails equal to the number of heads removed from the original set. This naturally balances out the number of tails in each set. An example: 10 tails {TTTTTTTTTT}. Let's remove 6 tails {TTTT}. Those 6 tails are now in the taken set {TTTTTT}. We need 10 total coins though, so we must have taken 4 heads as well {TTTTTTHHHH}. Because we removed the same number of total coins as the number of total tails, whatever amount left in the original set in tails must be represented as heads in the taken set. Thus after the flip we now have {HHHHHHTTTT} which has 4 Ts just like the original set {TTTT}. So for your question: Pick 14 coins, any coins, and flip them. Done.

                                Kornfeld Eliyahu PeterK 1 Reply Last reply
                                0
                                • J Jon McKee

                                  I think I figured it out. My last guess (though it didn't account for all the coins) was on the right track. Take a simple example of TTTHHHHHHH (7 heads, 3 tails). If you take three coins you'll get either {TTT}, {TTH}, {THH}, or {HHH} leaving {HHHHHHH}, {THHHHHH}, {TTHHHHH}, or {TTTHHHH} respectively. Those don't match up, but if you notice, flipping what was taken yields equal tails (example: {TTH} -> {HHT}, {THHHHHHH} = 1T each). This flipping works by removing coins equal to the number of tails. By subsequently flipping the coins, this set now contains a number of a heads equal to the number of tails removed from the original set and a number of tails equal to the number of heads removed from the original set. This naturally balances out the number of tails in each set. An example: 10 tails {TTTTTTTTTT}. Let's remove 6 tails {TTTT}. Those 6 tails are now in the taken set {TTTTTT}. We need 10 total coins though, so we must have taken 4 heads as well {TTTTTTHHHH}. Because we removed the same number of total coins as the number of total tails, whatever amount left in the original set in tails must be represented as heads in the taken set. Thus after the flip we now have {HHHHHHTTTT} which has 4 Ts just like the original set {TTTT}. So for your question: Pick 14 coins, any coins, and flip them. Done.

                                  Kornfeld Eliyahu PeterK Offline
                                  Kornfeld Eliyahu PeterK Offline
                                  Kornfeld Eliyahu Peter
                                  wrote on last edited by
                                  #22

                                  Right answer. Over-complicated explanation... :-D

                                  Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                  "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                                  J 1 Reply Last reply
                                  0
                                  • N Nagy Vilmos

                                    Turn 14 coins over in one pile and all the others go into the second pile. Whichever 14 you turn over, there will be the same number of tails on both piles.

                                    veni bibi saltavi

                                    I Offline
                                    I Offline
                                    Ian Shlasko
                                    wrote on last edited by
                                    #23

                                    That works, but my answers were more entertaining ;P

                                    Proud to have finally moved to the A-Ark. Which one are you in?
                                    Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                                    1 Reply Last reply
                                    0
                                    • I Ian Shlasko

                                      Damn, and I was only one step away from suggesting burning down the room so all the coins would be so scorched that none of them would be showing heads OR tails. And he had to go and post an actual answer... How's a guy supposed to troll in this kind of environment? :laugh:

                                      Proud to have finally moved to the A-Ark. Which one are you in?
                                      Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                                      Kornfeld Eliyahu PeterK Offline
                                      Kornfeld Eliyahu PeterK Offline
                                      Kornfeld Eliyahu Peter
                                      wrote on last edited by
                                      #24

                                      That's the gin. No cure for it!

                                      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                                      1 Reply Last reply
                                      0
                                      • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                                        Right answer. Over-complicated explanation... :-D

                                        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                        J Offline
                                        J Offline
                                        Jon McKee
                                        wrote on last edited by
                                        #25

                                        But the only answer that explains why it works :cool:

                                        Kornfeld Eliyahu PeterK 1 Reply Last reply
                                        0
                                        • J Jon McKee

                                          But the only answer that explains why it works :cool:

                                          Kornfeld Eliyahu PeterK Offline
                                          Kornfeld Eliyahu PeterK Offline
                                          Kornfeld Eliyahu Peter
                                          wrote on last edited by
                                          #26

                                          Let see... After you separate 14 coins from the rest there is exactly n coins with tails in that pile... In the other pile there is 14 - n... Now flip the coins in the pile of 14, now it has 14 - n coins with tails, just as in the other pile...

                                          Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                                          "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                                          J 2 Replies 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