Help with a 3x3x3 matrix

AddyW

New member
Joined
Mar 22, 2022
Messages
10
If there's a 3x3x3 cubical matrix of marshmallows and each marshmallow is connected by a toothpick only to those adjacent to it (including all diagonal adjacencies, and only once each). How many toothpicks are there in total?

There are 27 marshmallows so each "layer" connecting the marshmallows should have 12 toothpicks (12*3 layers)=36. Then the toothpicks connecting those layers (9*2)=18. Then there are (I think) 88 diagonal adjacencies that I counted in my head so in total 142 toothpicks. Did I do everything right? Maybe there is a really easy way to get this without doing so much math in my head lol.

Update: I think the answer is actually 158. I was missing some diagonals.

I am trying to come up with a formula for this now. So far I have (faces * 2) + # of edges + (???) = toothpicks

The ??? is 8*4=32, which are all the space diagonals in each little 2x2x2 marshmallow matrix. There are 8 of them in the 3x3x3 matrix and each one has 4 toothpicks
 
I am too lazy to do the work myself, but my script agrees with 158.
You have a script that can solve problems like this? Can it do 2x2x2x2 and see what the answer is then? That is the next problem I am working on. I got 88.
 
Marshmallows in 4D must be something :)
But: in case of only 2 marshmallows across each dimension would not every marshmallow be a neighbor with every other one? In which case you would simply count all pairs. And my scripts thinks so too:)
 
Marshmallows in 4D must be something :)
But: in case of only 2 marshmallows across each dimension would not every marshmallow be a neighbor with every other one? In which case you would simply count all pairs. And my scripts thinks so too:)
There are 16 marshmallows in this matrix so just 8 pairs, but each pair would have at least 4 toothpicks connected between them (two direct and two diagonal), so the answer is 32? In a 2x2x2 matrix the answer is 28 so I'd think the answer would be much larger but I can't visualize what a 4-d matrix would look like. If I do my little formula I get 88 toothpicks but if literally every marshmallow is a neighbor then I'd think there would be a ton more in total. Was your script getting 32?
 
There are 16 marshmallows in this matrix so just 8 pairs, but each pair would have at least 4 toothpicks connected between them (two direct and two diagonal), so the answer is 32? In a 2x2x2 matrix the answer is 28 so I'd think the answer would be much larger but I can't visualize what a 4-d matrix would look like. If I do my little formula I get 88 toothpicks but if literally every marshmallow is a neighbor then I'd think there would be a ton more in total. Was your script getting 32?
I agree with you that for 2x2x2 the answer is 28 (= 8*7/2), but in the case of 2x2x2x2 you have 16 marshmallows, so why only 8 pairs? Nor can I understand how a single pair would have 4 toothpicks.
 
I agree with you that for 2x2x2 the answer is 28 (= 8*7/2), but in the case of 2x2x2x2 you have 16 marshmallows, so why only 8 pairs? Nor can I understand how a single pair would have 4 toothpicks.
I was having a hard time visualizing a hypercube and still "seeing" it in a weird way. Hmmm... if a 2x2 matrix is (4*3/2)=6 and a 2x2x2 matrix is (8*7/2)=28 then is a 2x2x2xx2 (16*15/2)=120?
 
Most people, yours truly included, have a hard time visualizing dimensions above 3. But you definition of adjacency means that coordinates of adjacent marshmallows must have differences of 0 or 1. In the 2x2x2x2 cube all coordinates are either 0 or 1, so any pair of points is adjacent. Which means that your answer of 120 is correct.
 
Most people, yours truly included, have a hard time visualizing dimensions above 3. But you definition of adjacency means that coordinates of adjacent marshmallows must have differences of 0 or 1. In the 2x2x2x2 cube all coordinates are either 0 or 1, so any pair of points is adjacent. Which means that your answer of 120 is correct.
Woohoo! Thanks so much for taking time to help me. You rock! 8-)
 
Top