# What is the maximum number of moves in a Giant Jenga?

You may not even know it by name, but you have certainly seen a set of little pieces of wood piled up in which people remove them from the base and put them on top until someone drops the tower. Pleasure, this game is called Jenga. The version with pieces that doesn’t even show in the cover photo is known as Giant Jenga.

The minimum number of moves is very easy to calculate, 0. The person knocks down the tower without removing any pieces.

But to calculate the maximum number of moves, we need to remember how to play.

In a N-floor tower, if the top of the tower is complete, you can take any piece from the ground floor to the N-2 floor.

In a N-story tower, if the top of the tower has one or two pieces, you can take any piece from the ground floor to the N-3 floor.

Let’s also assume that the minimum number of pieces that we can take from one floor is 0, while the maximum number of pieces that we can take from one floor is 2.

Thus, if we initially have 18 floors, each with 3 pieces, we can think that the answer is 18*3 – 18 = 36 (total pieces minus the 18 corresponding to the central column of the tower initially assembled). But far from it!

The rule of number of pieces at the top tells us a lot about the rest of the entire division by 3 (called a mod [3]).

Let X be the current number of plays played:
if X mod [3] = 0, then there are exactly 3 pieces at the top of the tower;
if X mod [3] = 1, then there is exactly 1 piece at the top of the tower;
if X mod [3] = 2, then there are exactly 2 pieces at the top of the tower.

As there are at least two complete floors at the top of the tower, we can imagine that these 6 pieces are fixed (we can never touch them), so we have 48 pieces on 16 floors to play.

The maximum we can take from each floor is 2 pieces, so we can take a maximum of 32 pieces. But this value changes depending on the current divisibility of the number of moves (I will show below):

Notice that the number of pieces available to remove after the third move has increased. This happened because we formed another complete floor.

And so this structure follows, so that only after 92 moves will we have a total of 0 pieces available to remove.

As 92 mod[3] = 2, this means that we will have a 49-floor tower (16 initials floor, +2 fixed floors, +90/3 floors + 1 floor with 2 pieces at the top).