• Ethanol@pawb.social
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    3 hours ago

    This is actually quite fun and simple! Even if the problem and my following explanation look complicated :P

    Let’s look at the three dimensional case. One can parametrize a 3 dimensional cube as the Cartesian product of intervals [0, 1] x [0, 1] x [0, 1]. This means a cube is a set of points (a, b, c) where a, b and c are real numbers between 0 and 1. The 2 dimensional sides of the cube are then given by fixing one coordinate. That is, the 6 sides are

    {0}    x [0, 1] x [0, 1], 
    {1}    x [0, 1] x [0, 1], 
    [0, 1] x {0}    x [0, 1], 
    [0, 1] x {1}    x [0, 1], 
    [0, 1] x [0, 1] x {0} and 
    [0, 1] x [0, 1] x {1}. 
    

    Now we just start in the middle of a side at (0, 0.5, 0.5). To get to the next side we walk towards an edge (0, 0, 0.5) and then to the middle of the next side (0.5, 0, 0.5). We iterate this process until we run out of sides with a fixed 0, then walk towards a side with a fixed 1 and continue there. That is:

       (0  , 0.5, 0.5)
    -> (0  , 0  , 0.5) 
    -> (0.5, 0  , 0.5) 
    -> (0.5, 0  , 0  ) 
    -> (0.5, 0.5, 0  ) 
    -> (1  , 0.5, 0  ) 
    -> (1  , 0.5, 0.5) 
    -> (1  , 1  , 0.5) 
    -> (0.5, 1  , 0.5) 
    -> (0.5, 1  , 1  ) 
    -> (0.5, 0.5, 1  ) 
    

    This path basically spirals around the cube, going through every side only once. Here’s a visualization (sorry, I’m no artist :P) visualization of this path on a 3 dimensional cube

    The same procedure works on a 4 dimensional cube or any other higher dimension. For the 4 dimensional cube it goes like this:

       (0  , 0.5, 0.5, 0.5)
    -> (0  , 0  , 0.5, 0.5) 
    -> (0.5, 0  , 0.5, 0.5) 
    -> (0.5, 0  , 0  , 0.5) 
    -> ...
    -> (0.5, 0.5, 0.5, 0  )
    -> (1  , 0.5, 0.5, 0  )
    -> (1  , 0.5, 0.5, 0.5)
    -> (1  , 1  , 0.5, 0.5)
    -> ...
    -> (0.5, 0.5, 0.5, 1  )
    

    This works for arbitrary dimension except for the 1 dimensional cube (which is just a line) because the “sides” there are the two end points of the line and not connected at all. Additionally note, that it is never specified how edges count in this problem, whether they somehow count towards a face or whether you’re allowed to go back and fourth on edges. You could technically only walk along edges and step into the sides every now and then.

  • Akasazh@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    5 hours ago

    Too many people are obsessing about 4d topology in this thread. The real difficulty in the question is the non -deterministic pathfinding of the ant, in the absence of pheromones.

    • PuddleOfKittens@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      15
      ·
      7 hours ago

      Possible candidate responses:

      1. Solves it (too smart for job)
      2. “That’s bullshit, who needs this for a $14.50/hr job?” (too intolerant of bullshit for job)
      3. Tries to solve it but fails (lacks self-awareness for job)
      4. Knows they can’t solve it so doesn’t even try (too lazy for job)
      5. Doesn’t understand the question/comprehend what a hypercube is (too dumb for job)
      • Ensign_Crab@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        ·
        5 hours ago

        Maybe they’re trying to weed out all actual applicants because they’re hiring the boss’ kid.

      • Echo Dot@feddit.uk
        link
        fedilink
        arrow-up
        7
        ·
        6 hours ago

        You forgot option 6, spew a bunch of techno bubble at the HR person who will definitely not understand the problem themselves and wouldn’t be able to tell if you’d answered it or not.

      • plz1@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        6 hours ago

        I’d argue that 3 and 5 are actually selection qualities for a job paying that low, with a question like that. The rest are all dis-qualifiers of course.

    • mirshafie@europe.pub
      link
      fedilink
      arrow-up
      6
      ·
      8 hours ago

      I believe this is sometimes the case. I was called for an interview with a group of 15 other people ones. We were like a class, being interviewed as a group, and were supposed to solve some problems together. Nobody in that group could solve even the simple, obvious problems - we’re talking basic math and reading comprehension here. Got an email the next day informing me that they had I had not been selected for recruitment.

  • Meron35@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    10 hours ago

    Entry level positions to Gregg’s (fast food sausage roll chain) require 1000 word personal statements as part of online applications

    • Echo Dot@feddit.uk
      link
      fedilink
      arrow-up
      4
      ·
      6 hours ago

      Yeah but you also get equity in the company so I think that’s fair enough.

      You have to be proven worthy before you are handed the recipe for the vegan sausage roll. I want to know what addictive substance they put in there.

        • cmhe@lemmy.world
          link
          fedilink
          arrow-up
          6
          arrow-down
          3
          ·
          8 hours ago

          No shit? Next thing you say that there are no 3d games, because there are no 3d monitors. And those that say they are 3d as well as VR are just faking it, by using two 2d projections instead of one.

          • dream_weasel@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            3 hours ago

            There are 2D monitors though.

            You can project a 3d object into 2d space and you can do the same with 4d into 3d, but collapsing more than that generally loses too much information. Edit: If you include movement you can reduce this effect somewhat depending what you’re doing.

            Your portrait is now just a colored line the height of your subject, and this “4D cube” doesn’t mean anything because it looks like a 3d cube with a smaller cube cut out of the middle of it. Unless you’re really into geometry I guess it you dropped a /s.

          • PuddleOfKittens@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            5
            ·
            7 hours ago

            Just code up a lemmy plugin that lets you embed basic interaction for navigating 4D shapes, my dude. It’s just basic eigenvectors.

  • vithigar@lemmy.ca
    link
    fedilink
    arrow-up
    12
    ·
    11 hours ago

    Choose a starting face and remember it. Walk each face of a cell containing that face touching each face once much like you would a 3-cube.

    Pick any adjoining cell and move into one of its faces from there, walk each of its faces saving the one opposite the face you started on for last.

    From there you’re on a shared face with the cell opposite your starting cell. Traverse this one in a similar manner to the last, but this time also visit the adjoining faces of each cell adjacent to the second cell you filled, before once again ending opposite the face you started on for this cell.

    Now you’re on a shared face with the final cell, opposite the face you started on. Walk around the remaining four faces and you’re done.

  • CromulantCrow@lemmy.zip
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    1
    ·
    14 hours ago

    Okay, if you can explain to me in detail how four dimensional topology is going to be important to me while I’m stocking the shelves of your grocery store, I’ll give you an answer.

    • fibojoly@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      Listen, once you get the job, you’ll discover the truth about those shelves. And all I’m saying is, it becomes relevant that you can find your way through four dimensional space. Okay?

    • skisnow@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      2
      ·
      7 hours ago

      stocking the shelves of your grocery store

      See that’s what’s so ragebaity about the post. There’s no mention of what the job was, which means people can just make up whatever bit of background allows them to feel the most superior.

  • Entertainmeonly@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    27
    arrow-down
    1
    ·
    edit-2
    17 hours ago

    Four dimensional? That is a tesseract. This is impossible to describe how an ant would even interact with let alone touch all eight cells only once.

    • Caveman@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      It’s not hard to imagine a 2d square sliding across a 3d surface or a line traveling across a 2d plane so an ant travelling across a 4d surface is not that weird.

    • Slashme@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      7 hours ago

      The ant is a mathematical metaphor - a point that can trace a path along any surface and can cross to another surface only by crossing an edge, but cannot leave the surface.

    • RedGreenBlue@lemmy.zip
      link
      fedilink
      arrow-up
      13
      ·
      17 hours ago

      Once done with the first cube, the ant takes a gondola, going along the 4th dimension and repeats the walk he did on the first cube.

    • OwOarchist@pawb.social
      link
      fedilink
      English
      arrow-up
      27
      ·
      19 hours ago

      Might actually be the case, lol.

      Answer this question correctly (or even intelligently at all) and your application is rejected.

  • user1234@fedinsfw.app
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    15 hours ago

    Isn’t a cube by definition a 3 dimensional object? If it were 4 dimensional, it would no longer be a cube.

    • Mohamed@lemmy.ca
      link
      fedilink
      arrow-up
      23
      ·
      15 hours ago

      Its a generalisation. A 4d cube is a shape that has the same length in all 4 dimensions. You can also talk of 5d cubes, 6d cubes, etc. These are commonly called n-cubes: a 4-cube is a 4d cube.

      There are also 4D spheres, even though spheres are definitionally 3D. They are called n-spheres.

      • PolarKraken@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        2
        ·
        edit-2
        11 hours ago

        robot voice: how many 'd' is <USER_MATERNAL_PROGENITOR> a...cube...within? Ha ha. Ha ha.

        spoiler

        I looked:

        ERROR: unbounded_index
        

        Does not compute. Ha ha.

  • Pennomi@lemmy.world
    link
    fedilink
    English
    arrow-up
    81
    arrow-down
    1
    ·
    22 hours ago

    Every cube is four dimensional, assuming time as the fourth dimension. So it would travel forward in time at a relatively constant rate (since ants don’t typically walk at relativistic speeds [citation needed]) and it would traverse the other three dimensions in normal ant ways.

    • adj16@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      17 minutes ago

      Unfortunately I don’t think this is true. Every 3D face is the intersection of a 2D plane with the upper and lower bounds of the 3rd dimension. So I think a hypercube “face” would be every 3D “plane” at both the very start time AND the very end time. Meaning the ant would need to immediately accelerate to light speed - so no time would pass - and then (otherwise) normally traverse the faces, wait until the end time, and then repeat the process in reverse (still at light speed).

    • ZoteTheMighty@lemmy.zip
      link
      fedilink
      arrow-up
      14
      ·
      19 hours ago

      If the ant can only move a single direction in time, it cannot reach all the time corners. Every corner in 3 dimensional space has a twin corner, at the beginning and end of time. Since the ant can only walk forward in time, it will only reach 2 4D corners, where it started, and where it ended.

    • Sabata@ani.social
      link
      fedilink
      arrow-up
      3
      ·
      18 hours ago

      Interviewer did not define time. I will define it as 0 seconds per second. The ant can not move as movement is impossible at this time scale.

    • FishFace@piefed.social
      link
      fedilink
      English
      arrow-up
      40
      ·
      21 hours ago

      Hairy ball theorem applies to even-dimensional spheres (the ordinary sphere is the 2D surface of the 3D solid), but a cube in four-dimensional space is a three-dimensional surface, so it doesn’t apply.

      This is a question about graph theory, not topology; it’s asking for a Hamiltonian path on the surface of 4D cube (where faces are vertices, which is different than the normal polytope graph).

      • Eggymatrix@sh.itjust.works
        link
        fedilink
        arrow-up
        4
        ·
        5 hours ago

        You are right.

        However most proofs of the hairy ball theorem also prove the converse, so that there is a continous non vanishing tangent vector field on uneven dimensional sphere surfaces.

        This can be extended to all 3 dimensional surfaces in 4 dimensions homomorphic to the sphere. The ant walking can follow the vector field and solve this problem topologically.

        My point being that the HR goon following the expected leet code solution might not understand this because they might expect the “approved” graph theory solution rather than an alternative approach.

        • FishFace@piefed.social
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 hours ago

          Why does following a tangent vector field visit all faces of the hypercube? Surely it’s not going to visit something like a dense subset of the hypersphere’s surface? (Or is it? My intuition comes from thinking about the torus)

          I’m more interested in the maths ;)