Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • 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

The New Coffee Room

  1. TNCR
  2. General Discussion
  3. Puzzle time, count the hydras

Puzzle time, count the hydras

Scheduled Pinned Locked Moved General Discussion
12 Posts 5 Posters 151 Views
  • 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.
  • HoraceH Offline
    HoraceH Offline
    Horace
    wrote on last edited by
    #1

    This one came up at work recently. AI will make short work of this sort of thing eventually, but as it stands, it fell to yours truly. I'm only asked if the on-site PhDs can't figure something out.

    A hydra is an animal with one or more heads, where each head must have a different color. For generality, let's give each color a number. So there is color 1, color 2, and so on.

    These hydras are immigrating into your country at a certain rate, with each type of hydra having its own rate. Hydras with a single head of color 1, call them 1-hydras, come in at an unknown average rate of x per hour. 2-hydras come in at some other rate of y per hour. 1,2-hydras, which are two-headed hydras with head colors 1 and 2, come in at their own rate of z per hour.

    You have a gate through which all hydras enter, but the information tracking at this gate is primitive. Every minute, the gate reports back whether it's seen at least one head of color 1, and whether it's seen at least one head of color 2, within the past minute. These heads could be attached to 1-hydras, 2-hydras, or 1,2-hydras. The gate doesn't tell you that.

    How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

    This has to do with the poisson distribution, which is unfair to assume anybody could figure out for themselves, so I'll just lay that part out: if you know the fraction of 'positive' minutes for a given head color, in other words the fraction of gate readings where that head color was seen at least once, then you also know the overall rate per minute, on average, of that head color passing through the gate. This remarkable formula is -ln(fractionOfNegatives).

    So if you see at least one color 1 head 25% of time, then color 1 heads are passing through the gates at a rate of -ln(.75) per minute, or .287 heads per minute.

    Then for extra credit, extend the solution to hydra species of any number of heads. Such as, imagine the gate now keeps track of three head colors, and that there are hydras of 1, 2, or 3 heads, and you want to count the species of each, coming through your gate.

    Well, writing it out, it's not quite as elegant and presentable as a puzzle as I'd hoped. Oh well.

    Education is extremely important.

    taiwan_girlT KlausK 2 Replies Last reply
    • HoraceH Horace

      This one came up at work recently. AI will make short work of this sort of thing eventually, but as it stands, it fell to yours truly. I'm only asked if the on-site PhDs can't figure something out.

      A hydra is an animal with one or more heads, where each head must have a different color. For generality, let's give each color a number. So there is color 1, color 2, and so on.

      These hydras are immigrating into your country at a certain rate, with each type of hydra having its own rate. Hydras with a single head of color 1, call them 1-hydras, come in at an unknown average rate of x per hour. 2-hydras come in at some other rate of y per hour. 1,2-hydras, which are two-headed hydras with head colors 1 and 2, come in at their own rate of z per hour.

      You have a gate through which all hydras enter, but the information tracking at this gate is primitive. Every minute, the gate reports back whether it's seen at least one head of color 1, and whether it's seen at least one head of color 2, within the past minute. These heads could be attached to 1-hydras, 2-hydras, or 1,2-hydras. The gate doesn't tell you that.

      How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

      This has to do with the poisson distribution, which is unfair to assume anybody could figure out for themselves, so I'll just lay that part out: if you know the fraction of 'positive' minutes for a given head color, in other words the fraction of gate readings where that head color was seen at least once, then you also know the overall rate per minute, on average, of that head color passing through the gate. This remarkable formula is -ln(fractionOfNegatives).

      So if you see at least one color 1 head 25% of time, then color 1 heads are passing through the gates at a rate of -ln(.75) per minute, or .287 heads per minute.

      Then for extra credit, extend the solution to hydra species of any number of heads. Such as, imagine the gate now keeps track of three head colors, and that there are hydras of 1, 2, or 3 heads, and you want to count the species of each, coming through your gate.

      Well, writing it out, it's not quite as elegant and presentable as a puzzle as I'd hoped. Oh well.

      taiwan_girlT Offline
      taiwan_girlT Offline
      taiwan_girl
      wrote on last edited by
      #2

      @Horace said in Puzzle time, count the hydras:

      How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

      Attach a color CCTV camera???

      (Actually, I have no idea and no really sure where to start. I will think about it, but doubt I will be able to do the solution.)

      1 Reply Last reply
      • AxtremusA Offline
        AxtremusA Offline
        Axtremus
        wrote on last edited by
        #3

        Nice framing of the problem, @Horace.

        Kindly clarify this ... you say the "gate" will report whether it has seen "at least one" head of a certain color in the last minute. Does that mean, the gate is reporting only "one bit" of information for each color per minute (as opposed to reporting the number of heads for each color it has seen in the last minute)?

        HoraceH 1 Reply Last reply
        • AxtremusA Axtremus

          Nice framing of the problem, @Horace.

          Kindly clarify this ... you say the "gate" will report whether it has seen "at least one" head of a certain color in the last minute. Does that mean, the gate is reporting only "one bit" of information for each color per minute (as opposed to reporting the number of heads for each color it has seen in the last minute)?

          HoraceH Offline
          HoraceH Offline
          Horace
          wrote on last edited by
          #4

          @Axtremus said in Puzzle time, count the hydras:

          Nice framing of the problem, @Horace.

          Kindly clarify this ... you say the "gate" will report whether it has seen "at least one" head of a certain color in the last minute. Does that mean, the gate is reporting only "one bit" of information for each color per minute (as opposed to reporting the number of heads for each color it has seen in the last minute)?

          Right. You get a binary for each head color, per minute. Either zero of that color passed through, or some positive number. But you don’t know how many.

          Education is extremely important.

          1 Reply Last reply
          • HoraceH Horace

            This one came up at work recently. AI will make short work of this sort of thing eventually, but as it stands, it fell to yours truly. I'm only asked if the on-site PhDs can't figure something out.

            A hydra is an animal with one or more heads, where each head must have a different color. For generality, let's give each color a number. So there is color 1, color 2, and so on.

            These hydras are immigrating into your country at a certain rate, with each type of hydra having its own rate. Hydras with a single head of color 1, call them 1-hydras, come in at an unknown average rate of x per hour. 2-hydras come in at some other rate of y per hour. 1,2-hydras, which are two-headed hydras with head colors 1 and 2, come in at their own rate of z per hour.

            You have a gate through which all hydras enter, but the information tracking at this gate is primitive. Every minute, the gate reports back whether it's seen at least one head of color 1, and whether it's seen at least one head of color 2, within the past minute. These heads could be attached to 1-hydras, 2-hydras, or 1,2-hydras. The gate doesn't tell you that.

            How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

            This has to do with the poisson distribution, which is unfair to assume anybody could figure out for themselves, so I'll just lay that part out: if you know the fraction of 'positive' minutes for a given head color, in other words the fraction of gate readings where that head color was seen at least once, then you also know the overall rate per minute, on average, of that head color passing through the gate. This remarkable formula is -ln(fractionOfNegatives).

            So if you see at least one color 1 head 25% of time, then color 1 heads are passing through the gates at a rate of -ln(.75) per minute, or .287 heads per minute.

            Then for extra credit, extend the solution to hydra species of any number of heads. Such as, imagine the gate now keeps track of three head colors, and that there are hydras of 1, 2, or 3 heads, and you want to count the species of each, coming through your gate.

            Well, writing it out, it's not quite as elegant and presentable as a puzzle as I'd hoped. Oh well.

            KlausK Offline
            KlausK Offline
            Klaus
            wrote on last edited by
            #5

            @Horace said in Puzzle time, count the hydras:

            How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

            How do you deduce what exactly?

            HoraceH 1 Reply Last reply
            • KlausK Klaus

              @Horace said in Puzzle time, count the hydras:

              How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

              How do you deduce what exactly?

              HoraceH Offline
              HoraceH Offline
              Horace
              wrote on last edited by
              #6

              @Klaus said in Puzzle time, count the hydras:

              @Horace said in Puzzle time, count the hydras:

              How do you deduce, from the information at the gate, collected over an arbitrarily long time span, x, y, and z?

              How do you deduce what exactly?

              x y and z were defined in the problem. They are the rate of entry of 1-hydras, 2-hydras, and 1,2-hydras.

              Education is extremely important.

              1 Reply Last reply
              • KlausK Offline
                KlausK Offline
                Klaus
                wrote on last edited by
                #7

                Sorry, you are right.

                1 Reply Last reply
                • KlausK Offline
                  KlausK Offline
                  Klaus
                  wrote on last edited by Klaus
                  #8

                  ***=NSFW content***

                  click to show

                  Let c-1 be the rate of 1-heads per hour and c-2 the rate of 2-heads per hour, computed via the formula as described in the task description (I take hours instead of minutes to make it easier to compute x,y,z from it).

                  Then c-1 = x+y and c-2 = y+z.

                  That's two linear equations with three unknown variables, which means that the solution isn't unique.

                  So, more information needs to be extracted from the gate somehow.

                  I think my angle of attack would be to deduce x (or z) directly, namely by only considering those minutes where no color-2 head was seen by the gate.

                  If we ignore "contains color-2 head" minutes that way, we can compute x via the Poisson distribution formula, then enter it into the two equations, which yields two equations with two unknowns, which has a unique solution.

                  HoraceH 1 Reply Last reply
                  • KlausK Klaus

                    ***=NSFW content***

                    click to show

                    Let c-1 be the rate of 1-heads per hour and c-2 the rate of 2-heads per hour, computed via the formula as described in the task description (I take hours instead of minutes to make it easier to compute x,y,z from it).

                    Then c-1 = x+y and c-2 = y+z.

                    That's two linear equations with three unknown variables, which means that the solution isn't unique.

                    So, more information needs to be extracted from the gate somehow.

                    I think my angle of attack would be to deduce x (or z) directly, namely by only considering those minutes where no color-2 head was seen by the gate.

                    If we ignore "contains color-2 head" minutes that way, we can compute x via the Poisson distribution formula, then enter it into the two equations, which yields two equations with two unknowns, which has a unique solution.

                    HoraceH Offline
                    HoraceH Offline
                    Horace
                    wrote on last edited by Horace
                    #9

                    @Klaus said in Puzzle time, count the hydras:

                    ***=NSFW content***

                    click to show

                    Let c-1 be the rate of 1-heads per hour and c-2 the rate of 2-heads per hour, computed via the formula as described in the task description (I take hours instead of minutes to make it easier to compute x,y,z from it).

                    Then c-1 = x+y and c-2 = y+z.

                    That's two linear equations with three unknown variables, which means that the solution isn't unique.

                    So, more information needs to be extracted from the gate somehow.

                    I think my angle of attack would be to deduce x (or z) directly, namely by only considering those minutes where no color-2 head was seen by the gate.

                    If we ignore "contains color-2 head" minutes that way, we can compute x via the Poisson distribution formula, then enter it into the two equations, which yields two equations with two unknowns, which has a unique solution.

                    ***=NSFW content***

                    click to show

                    Yep, that works! And it admits to a generalization to 3+ headed hydras. I didn’t use systems of equations. Just the realization that you can get the rate of single headed hydras by ignoring gate data containing other colors, and from that the rate of a two headed hydra, by subtracting the single headed rate from the total head rate. I.e. z = rate of color 1 heads minus rate of 1-hydras. You can compute it from the rate of color 2 heads as well. In the two headed hydra case, both those calculations are by definition equal. In the general case, you can compute the rate for an n-headed hydra in n different ways, and each calculation can give different results depending on where the randomness falls. So I advised averaging the n results.

                    Education is extremely important.

                    1 Reply Last reply
                    • HoraceH Offline
                      HoraceH Offline
                      Horace
                      wrote on last edited by
                      #10

                      We're actually pursuing a patent for this. One cannot patent a mathematical process, but our patent lawyers contextualize it into our physical instrumentation. They have some experience with this. They expect it'll get rejected at first pass, but maybe approved on appeal.
                      Maybe in a couple years I'll update this thread with the good news of a patent. But I would bet against it.

                      Education is extremely important.

                      AxtremusA 1 Reply Last reply
                      • HoraceH Horace

                        We're actually pursuing a patent for this. One cannot patent a mathematical process, but our patent lawyers contextualize it into our physical instrumentation. They have some experience with this. They expect it'll get rejected at first pass, but maybe approved on appeal.
                        Maybe in a couple years I'll update this thread with the good news of a patent. But I would bet against it.

                        AxtremusA Offline
                        AxtremusA Offline
                        Axtremus
                        wrote on last edited by Axtremus
                        #11

                        @Horace said in Puzzle time, count the hydras:

                        We're actually pursuing a patent for this. One cannot patent a mathematical process, but our patent lawyers contextualize it into our physical instrumentation. They have some experience with this. They expect it'll get rejected at first pass, but maybe approved on appeal.

                        That makes sense. When you think about it, Google’s “search” algorithm is a mathematical process too, yet you can bet Google has all sorts of patents around it. It may take a few years to prosecute the patent, but congratulations on getting the patent application filed.

                        1 Reply Last reply
                        • jon-nycJ Online
                          jon-nycJ Online
                          jon-nyc
                          wrote on last edited by
                          #12

                          Cool

                          Only non-witches get due process.

                          • Cotton Mather, Salem Massachusetts, 1692
                          1 Reply Last reply
                          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
                          • Users
                          • Groups