Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 10:46:47 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
    • Muto/Hurd🌽
    • Inditoot :devious_horns_ms:

    Some people asked me to share a lvery difficult yet simple logic puzzle that has stumped my friends. It is also my favorite interview question.

    First off some background. The problem is not a trick question, as much as it may seem like one. There is no play on words, no hidden exception. Everything in this problem is exactly how it is presented and the answer doesn't rely on any slight of hand. Take this puzzle at face value.

    Also **ALL ANSWERS NEED CONTENT WARNINGS** I do not want you spoiling it for others. This goes for questions and hints too.

    Now on to the puzzle:

    There is a room with 100 jars with lids on them all in a row. There is also a stack of papers, 100 papers each labeled 1 to 100. The papers are shuffled and one paper placed into each pot randomly.

    You and your assistant are in an a joining room. Your assistant is allowed to enter the room, look in all 100 pots, and if they wish they can pick any 2 pots and switch the paper in them. They can only do this one time, they do not have to do this they can choose to also do nothing. At this point they leave the room, without talking to you.

    Next, someone tells you a random number from 1 to 100. Your goal is to enter the room and open a pot tht has that number in it. You are allowed to open, at most, 50 of the pots.

    Whatever process you use to open those pots must **guarantee** that by the time you open the 50th pot that the number you were given will be found. Obviously your assistant didn't know what the number is at any point.

    What rules do you give your assistant, and what rules do you follow, to ensure you are successful?

    @MutoShack @inditoot #puzzle #riddle #riddles #puzzles #math #mathematics #maths

    In conversation Saturday, 24-Aug-2019 10:46:47 UTC from qoto.org permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 and 🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 11:28:36 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • Muto/Hurd🌽
      • Inditoot :devious_horns_ms:

      @inditoot
      There is no math or probabilities needed. Any solution works 100% of the time.

      @MutoShack

      In conversation Saturday, 24-Aug-2019 11:28:36 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 11:28:58 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • matrix07012 :thotpatrol: :cunnyEmpire:

      @matrix A merge sort would require more than a single swap, so no.

      In conversation Saturday, 24-Aug-2019 11:28:58 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 11:37:35 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • Muto/Hurd🌽
      • Inditoot :devious_horns_ms:

      @inditoot

      You wont need a single math equation on this one. :)

      @MutoShack

      In conversation Saturday, 24-Aug-2019 11:37:35 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 12:51:03 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • Muto/Hurd🌽
      • Inditoot :devious_horns_ms:
      • Wetrix

      @Wetrix

      He doesnt know what number you need when he goes in.

      @MutoShack @inditoot

      In conversation Saturday, 24-Aug-2019 12:51:03 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 12:51:42 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • Muto/Hurd🌽
      • Inditoot :devious_horns_ms:
      • Wetrix

      @Wetrix

      He doesnt know what number you need when he goes in. Also id say this is a trick. The answer is nothing tricky like that.

      @MutoShack @inditoot

      In conversation Saturday, 24-Aug-2019 12:51:42 UTC permalink
    • timorl (timorl@qoto.org)'s status on Saturday, 24-Aug-2019 13:46:57 UTC timorl timorl
      in reply to

      @freemo

      The jars with papers inside represent a permutation, every piece of paper points to the next jar in the permutation, say we number the jars from left to right. As all permutation, this one can be represented as a collection of cycles. Two key insights about these cycles:
      1. Every cycle containing the jar numbered $k$ neccessarily contains the piece of paper with $k$ written on it, otherwise it wouldn't be a cycle.
      2. At most one cycle has length greater than $50$.
      With these insights the solution is simple. Your assistant looks at the whole permutation, and if any of the cycles has length greater than $50$ they switch the pieces of paper to break the cycle in half. They do nothing if there are no big cycles. Now you get told the number you are looking for and go for the jar numbered with it. Afterwards just trust the pieces of paper to lead you to the correct jar.

      Thanks for this puzzle, solving it gave me a very needed confidence boost. *smugness incoming* Especially since I didn't even need to use paper.

      In conversation Saturday, 24-Aug-2019 13:46:57 UTC permalink
      🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 14:31:06 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • timorl

      @timorl Correct, I'm very impressed :)

      In conversation Saturday, 24-Aug-2019 14:31:06 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 14:32:42 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • timorl

      @timorl Rule number one to solving any problem: use graphs (as in Graph Theory)

      In conversation Saturday, 24-Aug-2019 14:32:42 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 14:33:26 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      in reply to
      • timorl

      @timorl Correct, I'm very impressed :)

      Rule number one to solving any problem: use graphs (as in Graph Theory)

      In conversation Saturday, 24-Aug-2019 14:33:26 UTC permalink
      🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Saturday, 24-Aug-2019 17:13:46 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • Muto/Hurd🌽

      @MutoShack Those assumptions are correct :)

      In conversation Saturday, 24-Aug-2019 17:13:46 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Tuesday, 10-Sep-2019 05:27:32 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • 👁️‍🗨️πㄕㄨㆤㄉㄜ

      @pschwede He can only switch the jars once, you only have one assistant, there is no tricks in terms of wording or setup. This riddle is exactly as it appears at first glance.

      In conversation Tuesday, 10-Sep-2019 05:27:32 UTC permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Tuesday, 10-Sep-2019 05:37:35 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • 👁️‍🗨️πㄕㄨㆤㄉㄜ

      @pschwede only one piece of paper, randomly and uniformly distributed.

      In conversation Tuesday, 10-Sep-2019 05:37:35 UTC permalink
    • MasterOfTheTiger (masterofthetiger@theres.life)'s status on Tuesday, 10-Sep-2019 10:47:15 UTC MasterOfTheTiger MasterOfTheTiger
      in reply to
      • Muto/Hurd🌽
      • Inditoot :devious_horns_ms:

      @freemo
      That is very difficult, and I had a bit hard time fully wrapping my head around it even after you explained it. It seems so simple, yet so complicated.

      @MutoShack @inditoot

      In conversation Tuesday, 10-Sep-2019 10:47:15 UTC permalink
      🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.
    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Tuesday, 10-Sep-2019 10:52:31 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      in reply to

      Answer:

      https://qoto.org/@freemo/102766450134868659

      In conversation Tuesday, 10-Sep-2019 10:52:31 UTC permalink

      Attachments


    • 🎓 Dr. Freemo :jpf: 🇳🇱 (freemo@qoto.org)'s status on Tuesday, 10-Sep-2019 13:57:15 UTC 🎓 Dr. Freemo :jpf: 🇳🇱 🎓 Dr. Freemo :jpf: 🇳🇱
      • La Fée Verte

      @Absinthe Yes, true, you and your assistant do need an agreed upon ordering scheme. In the future I will number the pots.

      In conversation Tuesday, 10-Sep-2019 13:57:15 UTC permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.