Header tag

Monday, 21 October 2019

How to Solve Edge Matching Cards Puzzles - Practical Advice

While I was at high school, around 25 years ago, I was first introduced to an edge-matching puzzle.  This is made up of 16 square card pieces, with a colour on each edge, that have to be arranged into a 4x4 square so that all the colours of the edges on each piece matches their adjacent neighbour.

It all sounds so easy.

I recently acquired two versions of this edge-matching puzzle - one based on cogs, and one based on footballers - with a view to finally solving it.  I didn't solve the puzzle while I was at school, and I've not revisited it much since, except to conclude that it was impossible, or was going to take longer to solve than I wanted to invest in it.  Well, things have changed, and as it's clearly been pestering me for 20+ years, so I figure it's time to rise to the challenge - especially since the Special Educational Needs Co-ordinator at my high school took delight in telling me that one of the 'weaker' children in our year group had successfully solved it.  Challenge accepted, Mrs Kirkham!

Here, for reference, are the 16 cards in the "Mechanical Mayhem Puzzle":



My first few attempts at the puzzle were not at all successful.  I very quickly connected a few pieces, but never made significant progress, and never really got past about 75% complete  before the pieces refused to go together any more.  I therefore decided it was time to get some hints and help, from that reliable source of all knowledge - the internet.

The most helpful information I found was from a research paper into edge-matching puzzles - apparently, these puzzles are not trivial, in fact they are N-difficult.  The advice was to find matching pairs, and then try to connect pairs to form fours, sixes and eights.  The pairs didn't always form squares, but at least I was now working systematically.  Here are a few candidate pairs, as examples:

And then some candidate squares:


As I became more familiar with the cards, I quickly identified patterns that would not work - for example there are only two squares which contain the bronze-coloured cog shown on the right.  Therefore they must form a pair, since the likelihood of them both being on the outside edge of the 4x4 square seemed low to me.  I didn't count each kind of cog and work out which were the most and least frequent, but I soon noticed that the large golden cog was very common, as was the yellow daisy-style cog.  The very small silvery cog was quite rare, so I was more careful with how I placed any cards that contained it.

And, with a little trial and error, this approach worked for me (with some adjustments, intuition and observation).  You can see from my final solution that the key pair of bronze coloured cogs are in the top-left corner, and yes, I conquered the edge-matching puzzle (and it only took me 20+ years).




Sunday, 20 October 2019

Transformers Trading Card Game: Applied Probability

I've mentioned previously that I have an interest in the Transformers Trading Card Game.

It works like this:  you select a number of character cards, each with specific abilities.  You also compile a deck of 'battle' cards - at least 40, but with no upper limit - that you use to form your hand and the cards that you play in conjunction with your character cards.

Much of the skill in the game comes in deciding which characters to play together as your team, and then in deciding which battle cards you put into your deck.  The battle cards can provide weapons upgrades, armour or utilities, or they can be actions that you play to benefit your team (or to damage your opponent's team).  Each battle card can have between 0-3 coloured icons on them, which has a specific effect on your character's performance when you battle your opponent.  There are orange icons (good for attacking), blue icons (good for defending), white (lets you play more cards while battling), green icons (separate effect on the cards in your hand) and black icons (also good for attacking).

Before you play the game, you have to decide which cards you want to play, and what mix of coloured icons you want to have in your deck.  All orange is all-out attack; all blue is all-out defence; and so on.  But this is where it gets interesting:  some of your characters' special abilities rely on you getting white icons, or orange icons, or even a mix.  One of the character cards I'm working on at the moment is Mirage.  He has an ability where he can 'untap' if you can draw three white icons while he's attacking.  If you draw one white icon while attacking, then you draw two more cards - and hence have the possibility of getting more white cards, if you have a good proportion of white icon cards in your deck.  (There are other ways of drawing more cards while you attack, but that gets very complicated).

And the second - in a different team - is Grapple.  If you can flip a specific combination of cards while he's battling, you get a significant boost to your attack or defensive ability.  You can double his attack rating from 4 to 8, and improve his defence rating from 0 to 4 if you can flip cards which have EXACTLY four different coloured icons.  Duplicated icons are allowed - so flipping one white, one orange, two blue and two green is a success.  Three different colours don't count, and neither do five (if you drew a black, orange, yellow, white and green).

There is an additional property of the cards that we can use - some cards have two different coloured icons on them... white and green; green and blue; green and orange.  There are a strictly limited number of card which have three icons - typically white, orange and blue.  So the probability of hitting a successful flip are increased if I use these cards in my deck.  Computron's Lab have carried out some extensive quantitative research on the ideal deck for Grapple, which is composed entirely of blue-black and white-green, explaining that this gives the highest likelihood of drawing cards to enable Grapple's skill.  I've taken a slightly different approach:

THE GRAPPLE DECK







Grapple - 12 stars


Private Red Alert - 7 stars
Silverbolt - 5 stars

(Red Alert and Silverbolt have similar benefits to Grapple - they both activate their skills when you flip at least one white, orange and blue icon when battling).

Extra Padding:  two icon colours and Tough 1.
What's not to like?
Blue-Green = 4
Extra Padding x3
Dismantling Claw x1 (may remove this in future)


White-Green = 9
Secret Dealings x3
Spare Parts x3
Personal Targeting Drone x3


White = 6
Data Pad x3
Spinner Rims x3


Blue = 8Evasive Maneuvers x2
Inspiring Leadership x3
Reinforced Plating x3


Orange = 15
Flamethrower x3

Incoming Transmission x3
Body Armour x3
Treasure Hunt x3
Supercharge x3


and
Orange-White-Blue (although this a 'star card') = 1
Fuel Depot

Total 42

Orange: 16; Blue 13; White 16; Green 13  Total 48

The selection is almost certainly not the optimum in terms of drawing one of each of the four colours.  However, there is more than just the coloured icons to consider - some of the cards can be played to enable you to draw more cards in your turn.  The game calls this "Bold" when you're attacking, and "Tough" when you're defending.
Bold 3? Yes, please!

Flamethrower - Bold 2
Supercharge - Bold 3
Spinner Rims - Bold 1

Extra Padding - Tough 1
Evasive Maneuvers - Tough 3

Additionally, I have over-indexed on white icons, because if you can draw a card with a white icon, you get to draw two extra cards for that battle (only applies to the first white icon you draw per battle) - and I want to be as confident as possible of hitting a white icon each time.  In total, 16 of the 42 cards have a white icon; ideally I should probably have half of the cards with a white icon, to give me a higher chance of hitting one white icon in every two cards I draw.

In simulations with Bold 0 or Tough 0 (where I drew two cards - plus the two more if I flipped a white), I achieved success in almost a quarter of the draws (6/26).  When I gave myself Bold 1, drawing one extra card, I saw surprisingly little difference - a smaller sample size saw me achieve success on 2 out of 10 occasions.  I shall continue optimizing through empirical data - and because I like the idea of going 'full rainbow.  The research continues.

Thursday, 10 October 2019

"A Puzzle A Day" - Sum of three numbers equals their product

Puzzle 84:
Mr Puzzle says there is only one unique set of three numbers whose total (added together) is equal to their product (multiplied together).  What is it?


This puzzle reminds me of the recent question - "What three numbers satisfy 1/a + 1/b + 1/c = 1?", where the answer was 1/2 + 1/3 + 1/6 = 1.  

The answer to a + b + c = abc can be found if you know that 6 is a 'magic' number - the sum of its factors is equal to their product.

The factors of 6 are 1, 2 and 3:   1 + 2 + 3 =  6 = 1 * 2 * 3

6 is a perfect number  - it's equal to the sum of its divisors (except itself).  Another example is 28 (1 + 2 + 4 + 7 + 14); there are plenty more perfect numbers, and they are extremely large.

6, also is a magic number - it's equal to the product of its divisors (again, except itself).  I can't find any other examples - I guess 6 is unique.  Well, that's what Mr Puzzle said, anyway.