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.
  • 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

      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
      #20

      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
      • 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
        #21

        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
        • 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
          #22

          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
          • 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
            #23

            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
            • 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
                  • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                    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.

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

                    Your explanation doesn't account for why taking an amount of coins equal to the number of tails is necessary ;P But yes, the rest of the explanation could be simplified by math instead of words :)

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

                      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.

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

                      Your explanation doesn't account for why taking an amount of coins equal to the number of tails is necessary ;-P But yes, the rest of the explanation could be simplified by math instead of words :)

                      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.

                        D Offline
                        D Offline
                        dan sh
                        wrote on last edited by
                        #29

                        Tell them where the couch is. They will all go and hide. No coins, no problems.

                        "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

                        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.

                          M Offline
                          M Offline
                          Mark_Wallace
                          wrote on last edited by
                          #30

                          Easy. Just say "Thank God we don't live in Medieaval times", and turn the light on.

                          I wanna be a eunuchs developer! Pass me a bread knife!

                          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

                            M Offline
                            M Offline
                            Mark_Wallace
                            wrote on last edited by
                            #31

                            Well spotted.

                            I wanna be a eunuchs developer! Pass me a bread knife!

                            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.

                              U Offline
                              U Offline
                              User 12221786
                              wrote on last edited by
                              #32

                              Make a pile of all the coins. Take 14 from there to make the second pile. Turn all the coins in the second pile upside down. the pile: H:270 T:14 two piles: H:270-t T:t; H:t T:14-t (t is whatever number of tails in the big pile) upside down the small pile: H:270-t T:t; H:14-t T:t (Done). Ooh, ooh. (Anyone notice the error in my answer to the ant on the rope? - should have been exp(100)-1 seconds. I had stopped the ant at the starting point of the other post rather than where it had moved to. - So I now agree with the other responder except I think he used 364 days in a year??)

                              M 1 Reply Last reply
                              0
                              • M Mark_Wallace

                                Easy. Just say "Thank God we don't live in Medieaval times", and turn the light on.

                                I wanna be a eunuchs developer! Pass me a bread knife!

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

                                If we do not live in medieval times, why should we thank God? And al-Khwārizmī - who lived even before - was able to solve it without electricity...

                                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
                                • U User 12221786

                                  Make a pile of all the coins. Take 14 from there to make the second pile. Turn all the coins in the second pile upside down. the pile: H:270 T:14 two piles: H:270-t T:t; H:t T:14-t (t is whatever number of tails in the big pile) upside down the small pile: H:270-t T:t; H:14-t T:t (Done). Ooh, ooh. (Anyone notice the error in my answer to the ant on the rope? - should have been exp(100)-1 seconds. I had stopped the ant at the starting point of the other post rather than where it had moved to. - So I now agree with the other responder except I think he used 364 days in a year??)

                                  M Offline
                                  M Offline
                                  Mark_Wallace
                                  wrote on last edited by
                                  #34

                                  Member 12255252 wrote:

                                  Anyone notice the error in my answer to the ant on the rope?

                                  Yes, we all noticed. That's why we don't believe anything you say, any more.

                                  I wanna be a eunuchs developer! Pass me a bread knife!

                                  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