Remix.run Logo
fwlr 2 hours ago

This is a bit more stream of thought, hopefully that is helpful.

The pyramid can’t take up all the space inside the cube, only another cube could do that. So there must be some points that are “inside cube, outside pyramid” and other points “inside cube, inside pyramid”. The pyramid is given as wholly inside the cube so there are no “outside cube, inside pyramid” points. Same for sphere inside the pyramid. So it’s

    { out-cube | in-cube out-pyramid | in-cube in-pyramid out-sphere | in-cube in-pyramid in-sphere }
I struggle parsing the ray description, “horizontal” must meaningfully constrain the ray somehow (otherwise it wouldn’t have been mentioned), but I don’t know what that changes. Then I think about facts I know about rays - they can be uniquely specified with two points, or one point and one direction - oh, and we are given the direction is always “horizontal”, so we only need one point. The ray goes on forever so every “in” is “enter+exit”, so add 2 for every “in”. So it’s

    { out-cube (=0) | in-cube(2) out-pyramid (=2) | in-cube(2) in-pyramid(2) out-sphere (=4) | in-cube(2) in-pyramid(2) in-sphere(2) (=6 }
1) Maximum, that’s 6, from the last option, so “cube, pyramid, sphere…”, have to exit the innermost first, so “…sphere, pyramid, cube”. I don’t know where this ray is positioned, “halfway” might be a good guess, or maybe pyramid is half of square and circle is half of pyramid so “a quarter way up”.

2) Distinct, that’s `0 2 4 6`. `0` doesn’t count because we want “still passes through the cube”, so 3 counts exist. Thankful that “tangents don’t count” so I don’t have to think about them, because nothing immediately comes to mind on how to handle them.