Header tag

Saturday, 28 December 2019

2019 in reflection

At the end of 2018 I wrote a summary reflection of the year, and the theme I identified was "first times". 2019 seems to have been similar, with a surprising number of first times. However, the other main theme for the year has been change (I suppose if you do something for the first time it's either the cause or consequence of change).

My three children now all go to the same school, with our youngest moving from pre-school nursery to primary school nursery. It's a subtle distinction, but it now means that Daddy's Taxi only has to make one drop in the morning. 2020 will see our oldest child start high school, which will mean more significant changes ahead.

Planning further ahead into the future, we had a conservatory built onto the back of our house in 2019, and that led to significant change (I still don't think of it as part of our house, and it's been finished for three months now).  It's given us more living space, and in time will become my office during the daytime, as we move things around in the future.

While I was on a work experience placement from high school, the desk I was borrowing had a desk calendar with a daily motto, and one that I saw (and kept) was "Unless we know what we want ), we stand a poor chance of getting it." Over the years, that motto has helped me identify what I actually want, and to work towards it.  This year, I have taken that a step further and extended it to, "And if we don't ask for it, we really won't get it."  What do I want to drink? What would I like for dinner? What do I want to do this weekend? What do I want for Christmas? I've started changing what I say - and how I think - so that if you ask me what I want,  I'm more likely to tell you. And sometimes, it's actually up to me to say what I want to do. I'm lifting the lid on what I think I can do, or what I'm supposed to do, or what I think I'm allowed to do (usually inside my own head) and instead of discounting my own ideas myself (I could never do that), I'm at least going to say what I want first!

So, 2019 has been a year of change - internal and external - and is likely to lead to more change next year.

Happy New Year, and may you ask for what you want.

The Lists of Firsts

A first time for everything: 2018
2019 in reflection
First times in 2021 list
First times of 2022
First times in 2023
Things I did for the first time in 2024



Monday, 18 November 2019

Web Analytics: Requirements Gathering

Everybody knows why your company has a website, and everybody tracks the site's KPIs.

Except that this a modern retelling of the story of three blind men who tried to describe an elephant by touch alone, and everyone has a limited and specific view of your website.  Are you tracking orders? Are you tracking revenue? Are you tracking traffic? Organic? Paid? Banner? Affiliate? Or, dare I ask, are you just tracking hits?

This siloed approach can actually work, with each person - or more likely, each team - working towards a larger common goal which can be connected to one of the site's actual KPIs.  After all, more traffic should lead to more orders, in theory.  The real problem arises when people from one team start talking to another about the success of a joint project.  Suddenly, we have an unexpected culture clash and two teams, working within the same business, are speaking virtually different languages.  The words are the same, but the definitions are different, and while everybody is using the same words, they're actually discussing very different concepts.

At this stage, it becomes essential to take a step back and take time to understand what everyone means when they use phrases like,  "KPIs","success metrics", or even "conversion". I mean, everyone knows there's one agreed definition of conversion, right? No?  Add to cart; complete order; complete a quote, or a lead-generation activity - I have seen and heard all of these called 'conversion'.

When it comes to testing, this situation can become amplified, as recipes are typically being proposed or supported by different teams with different aims.  One team's KPIs may be very different from another's.  As the testing lead, it's your responsibility to determine what the aims of the test are, and from them - and nothing else - what the KPIs are.  Yes, you can have more than one KPI, but you must then determine which KPI is actually the most important (or dare I say, "key"), and negotiate these with your stakeholders.

A range of my previous pieces of advice on testing become more critical here, as you'll need to ensure that your test recipes really do test your hypothesis, and that the metrics will test the hypothesis.  And, to avoid any doubt, make sure you actually define your success criteria in terms of basic metrics (visits, visitors, orders, revenue, page views, file downloads), so that everybody is on the same page (literally and metaphorically).


Keep everybody updated on your plans, and keep asking the obvious questions - assume as little as possible and make sure you gather all your stakeholders' ideas and requirements.  What do you want to test? Why? What do you want to measure? Why?

Yes, you might sound like an insistent three-year-old, but it will be worth it in the end!


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, shown as vertical pairs:

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). Yes, I conquered the edge-matching puzzle (and it only took me 20+ years).



Other recent maths puzzle articles I've written that you may be interested in:

Snakes and Ladders (Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams, five digits)
More Multiplications (numerical anagrams, four digits)
Over and Out (reduce large numbers to zero in as few steps as possible)

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).  I've covered the distribution of the Transformers cards' coloured icons in a previous post.

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 flip 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

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

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


White = 6
Data Pad x3
Spinner Rims x3


Blue = 8
Evasive 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.

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.

My next article on a Transformers theme is my review of the TV series War for Cybertron Siege.

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.

Other articles on this blog on similar themes:

Snakes and Ladders (A look at the Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams with five digits)
More Multiplications (numerical anagrams with four digits)
Over and Out (reduce large numbers to zero as efficiently as possible)
Calculator Games: Front to Back
Calculator Games: The Kaprekar Constant

Other articles in the 'A Puzzle A Day' series:

Three Horse Race
How Old is Aunt Tabitha
Big Ben Strikes Twelve

Monday, 16 September 2019

Port Vale 1 Cambridge Utd 0

At the end of the last school year, our family was fortunate enough to win a pair of tickets (one adult and one child) to any one Port Vale home match of the 2019-2020 season. My wife has zero interest in football (possibly even less than that), and one of my children loves football, one has no interest and one is too young to appreciate it. So Lizzie and I won by default, and I opted for the home game against Cambridge United on Saturday 31 August.
This, like my report from Port Vale vs Stevenage from a few years ago (February 2011!), is more of an eyewitness report than match analysis.

The game started brightly under blue, cloudy skies. Vale had some very early chances and most of the early pressure.  The team played well and the majority of the first 45 minutes was played in Cambridge's half.  I don't recall Cambridge having any first-half chances, and it was mostly one-way traffic.


A couple of rare attacks along Cambridge's right wing were stopped by some strong physical defending, as the Vale left back and centre back were pushed, pulled back and occasionally got into a tussle with shirts being pulled and so on.



Nathan Smith (left) keeps an eye on Sam Smith (centre)
There was a period in the first half where the game threatened to boil over, and here I must blame the referee, who (in my own unqualified opinion) had a poor game. He missed a lot of the pushing and shoving that I've mentioned - from both sides - and failed to make the bookings that would probably have calmed things down and reminded the players of the rules.  Port Vale's Nathan Smith was involved in a number of physical challenges against Cambridge attacker Sam Smith, and they both (in my view) came close to getting booked.  

Port Vale continued to press, but the players went in at half time with no goals scored. Some of the fans near us viewed this as a glass-half-full situation, since Vale hadn't conceded either, and were on track for their first clean sheet of the season.


The referee didn't make any bookings during the first half, and consequently in the second half the game came very close to boiling over. 



The referee attempts to deal with a scuffle
without getting directly involved.
The referee steps into another scuffle, but note the two players behind him STILL fighting over the ball.

One petty incident involved a minor controversial scuffle - did he slip or was he pushed? - and one of the Cambridge players landed on the ball and  stopped to pick the ball up as he was certain he'd been fouled.  The Vale defenders argued that he hadn't been fouled, and had subsequently handled the ball immediately.  A scrum of around seven or eight players followed, each side determined to get hold of the ball (literally). The referee failed to take charge of the situation, and remained an almost impassive bystander, only booking one or two of the players, when other officials may have gone further.  It's always unfortunate when a referee manages to get himself noticed through his decisions - this was one of those games.

Cambridge United started the second half much more brightly and energetically and started gaining chances, but did not convert any of them.  As the game opened up, Vale were able to make some headway down both wings. David Amoo constantly made his presence felt in the inside right position, and kept threatening to beat the Cambridge defence.  

On the left wing, David Worrall was not having a great game.  His work rate was excellent, chasing down any opportunities on the Vale left, but he failed to make any progress and his crosses were all easily collected by the Cambridge goalkeeper, Dimitar Mitov.  Vale won a quick series of corners on the left hand side as the second half went on, but none of them produced any real chances, with Mitov proving excellent in goal and easily collecting any of the high crosses into the box. 







On the right wing, there were some nice tight passing sequences as the Vale attack attempted to break down Cambridge's deep and persistent defence, and it was through the right wing that Vale eventually got their winner.  David Amoo was able to break forwards and beat two defenders on his way into the Cambridge area; he got close to the by-line and sent a fast, low cross across the face of the goalmouth.
  


Retreating defender Davies beat his own goalkeeper to the ball and turned it in to the goal for an unfortunate own-goal.  Vale were able to hold on to their lead for the final five minutes (plus stoppage time) and also achieved their first clean sheet of the season, so it was a double winner that consolidated their mid-table position and allowed them to set their sights on the top half of the table.

 



Tuesday, 3 September 2019

Star Trek Discovery - First Impressions

Now I know I am a little late to the party, but our household recently started a Netflix subscription (primarily because we has just finished Parks and Recreation from start to end) and Mrs Leese had seen clips of Brooklyn 99 on YouTube. Brooklyn 99 is only available through Netflix, so that was that - we subscribed to Netflix.

An additional benefit is that Netflix streams Star Trek Discovery. It wasn't my idea to subscribe to Netflix, but I am not complaining!


Star Trek Discovery is the first new Star Trek series I've seen since Enterprise, and a lot has changed since then - 9/11, ISIS, the discovery of the Higgs Boson... it's a whole new world.  Star Trek has kept pace with changes in sci fi TV visuals, in the same way as the rebooted films have presented the best of Hollywood's visual effects.  But what about the audience? While Enterprise was airing in the UK, I was recording episodes on VHS video cassettes, so that I could watch episodes either live or at a time after their original air date.  It took weeks and months to get through a series (season), and by the end of a season  you could watch the series from end to end and better see the threads in the plot - if there were any.  Star Trek was entirely episodic, so you knew everything would be back to normal by the end of the hour.  In fact, season 3 of Enterprise (the Xindi arc) was widely criticised because it ran as a season-long arc and you couldn't just watch an episode in isolation (there were a few that could stand alone, but not many).


Now, with streaming services delivering on-demand TV 24/7/365, it's possible to watch Season 3 of Enterprise in a day. Not sure you'd want to, but the possibility exists.


Star Trek Discovery is able to balance the episodic nature of Star Trek with the demands of modern streaming audiences. The first two episodes are best viewed back-to-back, in the same way as TNG, DS9, Voyager and Enterprise all started with two-parters. There is a clear arc set up - the start and execution of the Klingon War - and then there are some serious differences. Observant viewers will notice that the series is called Star Trek Discovery, but the episodes start on the Shenzou. And the Captain is played by Special Guest Star Michelle Yeoh, who, as a Hollywood film actress is unlikely to be sticking around for the series. I predicted the destruction of the Shenzou with the captain on board before the opening credits had even finished.



Not that I'm complaining. The story shows us life in the Federation from the perspective of a mutinous officer who has only been saved from the brig and eventual court martial and expulsion by the needs of war.  Star Trek hasn't had a criminal in the crew since Tom Paris was pardoned and allowed to join the Voyager crew, and Lt Suder fought his violent tendencies while trying to integrate into the same crew.  This allows for some wonderful character interaction as the crew realise that they have Michael Burnham (famous mutineer) on board.  Meeting the crew from Michael's perspective means that we're thrown into the middle of a fully integrated crew - there's no shakedown time.  


The characters and names in this story are entirely fictitious. 
Any resemblance to any persons living or dead...
This is more TNG than Voyager, for sure.  Voyager started with the death of the second officer, the chief medical officer and the conn officer, throwing the Maquis and the Federation crews together.  There's none of that here; this is an established crew  who already know each other - and we don't.  The officer with the eye-enhancement (Keyla Detmar), who bears no resemblance to Seven Of Nine; the bridge officer who looks like a relative of Nebula from Guardians of the Galaxy (Airiam) - we know very little about them, except that they're bridge officers. Still, there's plenty of time for the series to show us more about them, all in good time.
...is entirely coincidental.
So far, I have watched the first seven episodes, up to and including Magic to Make The Sanest Man Go Mad, and I am pleased to say I have thoroughly enjoyed a very new, fresh angle on the Star Trek universe. The crew have a healthy smattering of imperfections and character flaws; and when placed in a stressful war scenario, these imperfections become exposed .  The writers are not afraid to kill off characters and destroy ships with alarming frequency (the captain of the Shenzou is one example).

And there's a great balance between episodic and arcing TV. In episode five, Choose Your Pain, we meet Harry Mudd (who will go on to become a thorn in James T Kirk's side). By the end of the nearly wrapped episode, he's left to to rot in a Klingon prison, and that's a neat and tidy conclusion.  But oh, no, he's back again in the standout episode seven, Magic to Make The Sanest Man Go Mad, and he wants revenge.  Again we have another episode which reaches a firm conclusion, but now we're also wondering how long it will be before he'll be back again.


There are a few minor drawbacks to the way the story has been set up, the most noticeable being that as a prequel, we know how the story is going to end - there's no spore drive in Kirk's universe, so the ship is probably going to get destroyed eventually.  I just hope it doesn't get erased from the timeline completely ("And Spock woke up and realised it was all a dream"? No thanks).


Otherwise, I am thoroughly enjoying the new series and can wholeheartedly recommend it.

I mean, it's good, but it's not as good as Star Trek: Picard; here are my episode reviews for the first season of Picard: