Tuesday 11 March 2014

Much Ado About Muffin - THE RESULTS

My previous post told the exciting tale of how Ruby, an intrepid bakerista, saved the day (having first sabotaged it, but shh!) at Tetris HQ. While her coworker Howard may have been content simply to ferry cakes back and forth between taskmasters all day, I'm sure you were wondering (or maybe you've already deduced) what the results of her glutenous ingenuity were. To explain, here's the same illustration as previously, with the squares labelled. Since it takes eight pieces to make two tetrominoes, every puzzle involved removing a single square in such a way that the remaining eight made up the shapes required.


We may as well nerd-it-up a notch and use the proper Tetris terminology, which of course I researched using Wikipedia. Have a click if you're curious - the main point is that the pieces are denoted by the letters that roughly approximate their shape: I, L, T, S, Z, J, O. J is 'backwards L' and O is the square-shaped one. Swotted up? Good! Here we go.

Answer 1
Which square should be removed to leave a shape containing a Z and a T together? Luckily for methodical types, the answer was A. Here's how it works, and do excuse Howard's paint-job, won't you. He hasn't had to do this since 1998!

  

Answer 2
Unfortunately the dream world was much kinder to our heroes than the real thing, and Ruby found herself having to take her best stab with the information 'two of the same - possibly Ls, Js or Ts'. There was no question of which slice to remove: as Ruby noted, there is only one configuration that allows any pairs of twin pieces. If we trust her on that, it means that if we find just one pair of twins in a configuration, then it must be the one that contains all the others, too. She also said it contained only twins, so if we're checking a configuration and find a pair of different pieces, we know instantly that we're in the wrong one. These pieces of information actually made this an easier question than the first, and the answer was... B! Maybe Howard's painting will be better in the real world?


Oh dear, I guess not.

Answer 3
This is where we part company with Ruby, since the tastiest-looking piece is obviously D. However, the piece she had to remove in order to leave the highest number of combinations is I. Perhaps she was trying to make herself feel better about giving most of the cake away, but I think it's more likely that as she began discovering her inner mathematician, her idea of what is tasteful became more questionable*. There are four possible combinations: LS, LO, JZ and JO:


I'm not sure even the Mario mushrooms can explain these ones, Howard!

Unlike question 2, question 3 was much harder than the first, since it required you to find all pairs of shapes that can be made from all combinations. How to do this? I think the most efficient way is to pick a square in the configuration that looks like it can't be used to form many different shapes, form what you can using that square, then see what you have left. As an example, try 'eating' G and examine the square labelled I. With G gone, I can only be part of the L shape made with squares IHED. The only configuration possible if you eat G is the pair LJ.

Even if there are several ways to use your chosen square (e.g. eating I as above), it's not hard to make this procedure fairly methodical and be sure you haven't missed any. Notice once you've exhausted all ways of using that single square, you're done, since every configuration must use that square somehow in a way you've already tried.

Answer 4ish
What about Ruby's other comments? The worst square to eat is H, since it leaves I hanging off the end and unusable. The next-worst are C and D. If you eat C, you can make just the pair JZ, but we already saw that that's contained in the 'eat I' set. Similarly eating D leaves the pair JT, which you'll find is included in the two pairs possible when you eat A.

You might also wonder whether other pairs are unique to a particular configuration, like ZT was if you ate A. The answer is 'yes', and in some cases it's the only pair that can be made, so allowing only a small number of pairs doesn't necessarily make the configuration useless. This property of some configurations to be 'contained' in others on the basis of which pairs they allow, while others neither contain nor are contained, hints at the mathematical notion of a 'partial ordering', where you say a set X is 'larger' than Y for some choices of X and Y, but not all choices admit a comparison. (Compare the 'total ordering' on the number line, where you can always say which of two different numbers is larger.)

Epilogue
What about the fate of Ruby and Howard? Since Tetris HQ is currently enveloped by a thick smog of flour, sugar and edible glitter, it's hard to say, but we can certainly work out the probability that they gave Paul what he requested. With seven shapes - I, L, T, S, Z, J, O - available, there are 28 different ways to make a pair from two of them**, and Ruby only gave Howard four, leaving just a 1/7 (about 14%) chance of success. If she had given him all nine pieces and trusted him not to eat the extra one, they would have had access to eight more possible combinations, increasing their chances to 12/28 = 3/7 (about 43%). Not hopeful, but better. Expensive cake, Ruby!***

So I'm afraid it looks like Paul was probably not very happy with Ruby once again, and this should be a lesson to all of us: while an apple a day keeps the doctor away, a cake protégée won't get Tetris to play.



* If you doubt this phenomenon, pay a visit to Warwick Maths Department, where a decent number of professors have decided that shoes and socks are not necessary equipment for lecturing. And actually they have a point, I guess?

** There are 7*7 = 49 ways to pick two pieces in a set order, but some of these are double-counted since the order doesn't matter. There are 7 pairs of twins, and of the remaining 42, 21 are unique. So 7 + 21 = 28 combinations. This happens to be the 7th triangle number 28 = 7*8/2. To see why, draw a table with the first piece along the top and the second piece down the side and ignore the entries that get counted twice:

    ILTSZJO
I *  * *****
L
 *  * ****
T

 * ****
S


 * ***
Z



 * **
J




 * *
O





 * 

*** With a few reasonable (?) assumptions, economists could use this information to estimate how much Ruby values cake relative to her job (or hers and Howard's together!). Ruby has sacrificed a 8/28 = 2/7 increased chance of success... for a piece of cake. If the probability of her getting fired for this blunder is p, the value of cake is c and the value of her job is j, then Ruby has implicitly declared:

c > 2/7*p*j

(the value of the cake is greater than the value of her job times the increased probability of losing it), or rearranging:

j < (7/2)/p*c.

We don't really know p, but we can see what happens at various points, for instance if p = 1% then Ruby considers her job worth at most 350 pieces of cake. If p = 100% then she would happily trade her job for the certainty of four slices of cake. If that's the case, she should have just kept the whole thing and not worried!

No comments:

Post a Comment