Jenga

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

User avatar
LaserGuy
Posts: 4317
Joined: Thu Jan 15, 2009 5:33 pm UTC

Jenga

Postby LaserGuy » Fri Jul 29, 2016 6:22 pm UTC

Played this game with my son the other day and it got me thinking about strategy...

Jenga consists of a tower of rectangular blocks. Each level of the tower has three blocks in it, forming a square. The blocks on the next level up are rotated by 90 degrees, and so on. Suppose that the tower is 12 levels high, with 36 bricks total.

Version 1:
Two players take turns removing blocks from the tower until it falls over. The tower will fall over if the middle block + either of the side blocks are removed. So valid positions for any given layer are |||, |X|, X||, ||X, X|X. This will hold even on the very top layer.

Assuming both players play perfectly, is it possible for either player to devise a strategy that will guarantee a win?


Version 2:
When a piece is removed, it added to the top of the tower to either fill in the layer or create a new one. In adding to a new layer, players must add bricks in valid positions (ie. you have to put the middle block in first, then you can add the sides or add a new layer).

Assuming both players play perfectly, is it possible for either player to devise a strategy that will guarantee a win?


My solution to version 1:
Spoiler:
The first version seems fairly straightforward. You need to be the person to make the last legal move. Player 1 wins if there are an odd number of legal moves played, Player 2 wins if there are an even number of legal moves played. Since there are an even number of levels, it looks to me like Player 2 always wins this version, just by repeating whatever Player 1 does on a different level.


I think there ought to be a solution to version 2, but I haven't worked through the variations yet.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 1928
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Jenga

Postby Soupspoon » Fri Jul 29, 2016 6:57 pm UTC

For an "Ideal Jenga", the mathematical solution dominates (akin to the game of Nim) and unless the number of blocks (thus opportunities for removals and hence new layers) is specifically atuned towards making the optimal Player 1 first turn an unattainable 'null move', a 'perfect' play would seem to be in control of the first player and their actual choice of first move such that they then force Player 2 to make moves that Player 1 can always complement (e.g. always respond to a centre-removal with another centre-removal, an edge-removal with the countering edge-removal, or maybe contrariwise). I haven't modelled this is in full, and certainly haven't modelled Version 2 play where extracted blocks are, on every third occasion, forced to be placed so as to be part of an asymmetrical tower-cap over a possibly asymmetrical 'depleted tower' beneath.

But in a real game of Jenga, there's an added complication that (in all versions I've played, from tabletop to 'giant' version) the blocks seem to be deliberaely cut to loose tolerances. You know the feeling of when you want to remove a centre-block, or an edge block opposite an already removed edge, but due to slight differences in height, that block will not freely push or pull out of the stack.

When choices become scarce, you know that you've tried tapping several blocks subtly, at first, to test them. And then with cautious but increased percusiveness you persist with one or maybe a couple of the possibilities to try to do a 'tablecloth removing' manouever, aiming to whip the block out (usually in stages), hoping that the inertia of its vertically neighbouring blocks overcomes the friction between them enough not to cwuse catastrophe.

As such, the idealised strategy is likely to hit upon the stubborn central block, when central-blck removal is strategically called for, and ditto with edges, and you may wish to abandon the optimal removal rather than risk causing your own calamity, and hope that the opponent feels similarly constrained (or inadvertently accomodating) in not then choosing the idealised countermeasure to your weakness of choice and seizing (almost) certain victory from the jaws of inevitable defeat by you.


But I shall ponder the specifics of the Idealised Version 2 game. It sounds like an interesting problem. (Also for a number of players, albeit in strict rotation, other than two!)

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 1928
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Jenga

Postby Soupspoon » Fri Jul 29, 2016 10:25 pm UTC

I have pondered, but not yet implemented beyond a form of 'statefulness', my analysis of Ideal Jenga. I'll put what I have down here before I put things aside for the night, and I know I won't have time to continue until late tomorrow at the earliest.

Forgive the likely non-standard notation, but hopefully it is self explanatory enough.

Define superstates S, A, B and C as having four explicit metrics across them all, and each representing a fifth metric implictlly.

S ('starting state') has 11 'Threes' (full 'floors', assuming a total of 36 blocks, excluding the top layer), zero 'Pairs' (floors with two adjacent blocks, one a centre, but one missing edge), zero 'Splits' (two edge blocks remain, separated by a missing central block), and zero 'Singles' (a solitary central block, both edges removed previously). Implicitly, S has 3 'Tops' (blocks on the top whole layer that cannot be legally removed in a turn). For setups of other than 36 blocks, adjust the Threes and the assumed Top number appropriately, naturally, and potentially the entry-point marked*, below.

It does not matter what order the Threes, Pairs, Splits and Singles are stacked, assuming theoretical maximum mathematical stability for our purposes.

For states with 3 Tops (S*|C) three changes may be possible:
If Threes>0, a centre block may be removed. Change Threes-1, Splits+1 (implicitly, Top=4, a full layer and a solo block) and state=>A
If Threes>0, an edge block may be removed. Change Threes-1, Pairs+1 (implicitly, Top=4) and =>A
If Pairs >0, a second-edge may be removed. Change Pairs-1, Singles+1 (Top=4) and =>A

A slightly repetitious version for the 4 Top state (A):
If Threes>0, a centre block may be removed. Change Threes-1, Splits+1 (Top=5, a full layer and a two more blocks) and state=>B
If Threes>0, an edge block may be removed. Change Threes-1, Pairs+1 (Top=5) and =>B
If Pairs >0, a second-edge may be removed. Change Pairs-1, Singles+1 (Top=5) and =>B

And repeat (with modifications! ) for the 5 Top state (B):
If Threes>0, a centre block may be removed. Change Threes-1 then re-add one so actually unchanged, Splits+1 (implicitly, Top=6-3, a new full layer, the previous one now replenished the Threes count) and state=>C
If Threes>0, an edge block may be removed. Change Threes-1+0=unchanged, Pairs+1 (implicitly, Top=6) and =>C
If Pairs >0, a second-edge may be removed. Change Threes+1, whilst Pairs-1, Singles+1 (Top=6) and =>C

The cycle S=>{A=>B=>C=>...} repeats until there are no valid moves (Threes=Pairs=0, Splits and Singles and Tops are all that remain), at which point a loss is forced. There is a finite 'net' of gameplay (always a loss of Threes, across each full cycle of three moves, whether that is one or two of them; Splits and Singles, meanwhile, irrevocably accumulate at the same combined rate(?)) and there may well be a single Nimesque strategy applicable in a game of N playes that one player can use every Nth turn to avoid loss or N-1 players must use to force the remainng playet to take the loss or possibly somewhere inbetween. For arbitrary or specific N, to be determined.

User avatar
SirGabriel
Posts: 35
Joined: Wed Jul 16, 2014 11:54 pm UTC

Re: Jenga

Postby SirGabriel » Mon Aug 01, 2016 10:50 pm UTC

LaserGuy wrote:My solution to version 1:
Spoiler:
The first version seems fairly straightforward. You need to be the person to make the last legal move. Player 1 wins if there are an odd number of legal moves played, Player 2 wins if there are an even number of legal moves played. Since there are an even number of levels, it looks to me like Player 2 always wins this version, just by repeating whatever Player 1 does on a different level.

Except that there has to be a rule against removing blocks from the top layer, otherwise the ideal game (and probably most actual games) wouldn't end until every single block had been removed from the tower. Which means that
Spoiler:
there are only 11 layers that can be touched. So Player 1 can guarantee victory by first removing the middle block from any layer other than the top (leaving 10 playable layers) and then following the strategy you gave.

User avatar
Qaanol
The Cheshirest Catamount
Posts: 3031
Joined: Sat May 09, 2009 11:55 pm UTC

Re: Jenga

Postby Qaanol » Wed Aug 03, 2016 7:05 pm UTC

In real-physics Jenga, there is an added constraint that the *center of mass* for *the entirety of the top n levels* must always be located above the remaining blocks in the next level down.

In particular, if the left-hand block has been removed somewhere, then there is a limit on how many right-hand blocks parallel to and above it can be removed while the left-hand blocks remain.

The specific effect of this constraint depends on the width and mass of the blocks, and how far out the side blocks are placed.
wee free kings

Tirear
Posts: 24
Joined: Fri Feb 05, 2016 5:42 pm UTC

Re: Jenga

Postby Tirear » Thu Aug 04, 2016 5:39 pm UTC

LaserGuy wrote:
Version 1:
Two players take turns removing blocks from the tower until it falls over. The tower will fall over if the middle block + either of the side blocks are removed. So valid positions for any given layer are |||, |X|, X||, ||X, X|X. This will hold even on the very top layer.

Assuming both players play perfectly, is it possible for either player to devise a strategy that will guarantee a win?

Spoiler:
Suppose there is only one untouched layer. The player can remove a side piece, which will leave the layer with a single move, or the player can remove the middle piece, which will leave the layer with no moves. Since there are no real choices left, this will determine who wins the game. In order to prevent your opponent from getting the last layer, you will want to avoid touching the second to last layer. If whoever touches the second to last layer loses, you are now effectively playing N-2 layer jenga. By induction, 12 layer jenga is equivalent to 0 layer jenga, and as such the first player will always lose twenty dollars and my self respect be defeated.

FAKEEDIT: modified for word filters

User avatar
SirGabriel
Posts: 35
Joined: Wed Jul 16, 2014 11:54 pm UTC

Re: Jenga

Postby SirGabriel » Thu Aug 04, 2016 6:22 pm UTC

Tirear wrote:
Spoiler:
Suppose there is only one untouched layer. The player can remove a side piece, which will leave the layer with a single move, or the player can remove the middle piece, which will leave the layer with no moves. Since there are no real choices left, this will determine who wins the game. In order to prevent your opponent from getting the last layer, you will want to avoid touching the second to last layer. If whoever touches the second to last layer loses, you are now effectively playing N-2 layer jenga. By induction, 12 layer jenga is equivalent to 0 layer jenga, and as such the first player will always lose twenty dollars and my self respect be defeated.

Spoiler:
Again, you're ignoring the fact that it is illegal to remove any blocks from the top layer. 12 layers means 11 playable layers, which by your logic is equivalent to 1 playable layer, meaning the first player will always win.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 1928
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Jenga

Postby Soupspoon » Thu Aug 04, 2016 7:17 pm UTC

Qaanol wrote:In particular, if the left-hand block has been removed somewhere, then there is a limit on how many right-hand blocks parallel to and above it can be removed while the left-hand blocks remain.
If two adjacent blocks are left, after removal of the opposite edge-block, that layer's CoG is at the ⅓ point, i.e. the edge of the middle block (with near enough idealised blocks and stack alignment). No matter how many lop-sided (alternating with perpendicularly stacked layers) pairs there are, their contribution to the stack CoG goes no further over than this

Take into account the intervening layers (however so depleted, all stretch the full width, their CoG being entirely central in the same axis) the consistently edge-depleted stack (doubly depleted, even, in both axes) is moved firmly onto the centre-third of any lower stack and even if that's oppositely edge-removed, it can safely suport the contrary layers above it.


The prime exception might be if in the 'remove and place on top' version of the game you don't start a fresh layer with the centre, but with an edge. One solitary top edge block has a CoG at the 1/6th point of its layer, which could be enough to move the CoG (of an arbitrary stack segment below) across the ⅓ point above a current/imminent missing edge.

I think. ICBW.


Return to “Logic Puzzles”

Who is online

Users browsing this forum: No registered users and 2 guests