Spider Solitaire challenge!

Being able to solve 4 suit Spider Solitaire sans 85,78,68,79 and uploading your brilliant play to You Tube is nothing new of course. Of course the problem is the cynics might ask questions like “is your win-loss record worse than that of Ninja Monkey?” or “Was the game so ridiculously easy that even my Grandma would win?”. The G word has been used before, for instance in the context of Scrabble where one player gets all the good tiles and wins without even trying (e.g. Joe Bloggs was grannied even though his opponent didn’t know that DOUPIONI is an irregular silk thread reeled from two or more entangled cocoons and producing a coarse yarn generally used in fabrics such as shantung or pongee). But we digress.

 

When I google-searched videos for players beating 4 suit solitaire sans 85,78,68,79 I got the general impression that everybody played like 83,72,73,84, got lucky at several critical moments.

To be more specific I conducted the following experiment. I first googled the phrase “spider solitaire four suits win undo” and obtained a list of videos. A video “qualifies” if the player beats the 4-suit level. 85,78,68,79 is strictly forbidden (even if correcting a mouse-slip). The good news is there is no penalty for lame background music, a player’s monotonous voice as he explains his moves, terrible decision making, or even the use of Microsoft Vista. All the player has to do is win sans 85,78,68,79. The bad news is everybody played like 83,72,73,84.

Ninja Monkey then computed the equity of each hand with its famous random walk algorithm. With these specifications I got the following top-5 videos:

Of those top 5, three of them got ridiculously easy hands with equity 0.88 or better. In the other two, NM thought the games were average difficulty (a random hand should have 0.61 equity). Of course it is also possible that the player unnecessarily made things difficult for himself with some terrible decision making at the start).

All videos contained many errors, and most of them boiled down to not seeing the board as a whole. For instance Joe Bloggs would focus entirely on Column 6 in the opening, because that had fewest face-down cards (and hence closest to obtaining an empty column) and ignore obvious moves such as suited connectors or shifting a Five onto one of three Sixes. Or Jane Citizen dealt a fresh row of cards and immediately shifted a Jack of Hearts onto the Queen of the same suit – before remembering the game has ten columns instead of five. If you find an in-suit build within the 5 left-most columns and play it without even considering the cards in columns 6-10 then chances are you are playing sub-optimally!

 

The other fault of most players is not mastering “Tower-Of-Hanoi” manoeuvres in the middle-game. This involves making a ton of reversible moves to tidy up columns at no cost (assuming we are playing to win regardless of number of moves), and is an essential skill for beating the highest difficulty level sans 85,78,68,79. Even my brother plays better than the vids shown here (actually my brother is the famous Terence Tao, so I should probably treat him with some respect!)

For completeness I should also mention the sample hand played by Steve N Brown. In his book he annotates a sample hand played from start to finish. He chose a hand which he considered harder than average, yet managed to win. Ninja Monkey agrees, estimating the equity of that hand to be 0.27. I am yet to find any player (You Tube vid or otherwise) who comes close to matching Steve’s skill, unless I look at a mirror at 90 degrees.

I have played through the game and cannot find any serious strategic errors from Steve. I found only minor errors (even then I wouldn’t bet my Ph. D. thesis or my day-time job to a brick that they really are errors). But that’s a post for next time.

 

A challenge to readers. To prove that you are a genuinely good player you must upload a video where:

  • You beat 4-suit Spider Solitaire
  • No 85,78,68,79
  • You have unlimited attempts. I don’t care how often you lose
  • Lame background music, monotonous voices, use of Windows Vista are allowed.
  • Ninja Monkey must say the equity of the hand was 0.35 or worse (okay I’m being generous).
  • Bad decision making is allowed. After all, if you win and NM says the game was hard then you must have done something right.

Good luck!

 

Solution to procrastination puzzle

Apologies for the delay in posting the solution.

The correct move is to shift the K of hearts in column 6 onto the empty column to expose a new card, and then clear the suit with the 3-2-A. The difference is if we expose the Three of hearts then we have two empty columns instead of one. Of course the odds are small since there is only one Heart Three unseen, but nothing to be lost by trying!

Note that if you were scoring according to number of moves instead of playing a “pure game” (i.e. just winning) then you would probably not procrastinate and save a move. Since the game is going so well, you would probably expect to win anyway.

Oh, in other news I have just lent  Steve N Brown’s book to my work colleague so I expect to see some big improvement in her play in January 2020. Bring it on!

Happy procrastinating

The virtues of procrastination

We’ve all been there. Your Chemistry assignment is due tomorrow. You’ve got to prepare for your English Exam next week. You need to do the dishes. It’s baby’s bath time again. Gotta start looking for a job. Time to install Tensorflow on your machine and understand Neural Nets and Deep Learning 101. Or maybe all of the above. Oh well, one more game of Four-suit Spider Solitaire sans 85,78,68,79 can’t hurt can it?

Spider players rejoice! Your favourite game is one of a select few where procrastination can be a virtue. Here is a simple example:

proc_1

There are two obvious options: either we can expose a new card in column 3 (shifting the Spade Five on the Club Six) or move the Diamond Queen onto the king of the same suit. Which is the better option?

Suppose we build in-suit with the Diamond K-Q. A little thought shows we then have nothing better than to shift the Spade Five and turnover a card column 3. Therefore we may as well start by turning over column 3 and seeing what happens. Here are a number of possible scenarios:

  • We turn over the Diamond Queen (recalling there are two decks, so this is indeed possible). This means we get to turnover a second card in column 3 and build the K-Q of Diamonds.
  • We turn over the Spade Queen. Again we get another turnover (albeit off-suit), which is probably worth more than building in-suit.
  • We turn over a Nine of any suit. This Nine goes onto one of the three Tens and we get another chance for either of the first two scenarios.
  • We draw an Eight of any suit. This is a bad card and we have nothing better than to build the K-Q of diamonds.

In effect we are procrastinating the act of moving the Diamond Queen onto the King. It probably should be done at some point, but we lose nothing by waiting. In all the above cases, procrastination either gains something over non-procrastination or breaks even.

You might have noticed there was a further option of moving the Two of Clubs onto either Three in columns 7 or 9. Again there is no reason to do this immediately, so we procrastinate by leaving the Two of Clubs alone. The advantage becomes apparent if column 3 reveals two Deuces in a row.

Opportunities for procrastination frequently arise during the course of play. Each individual opportunity represents only a small edge, but the cumulative effect of these small edges can become significant over a large number of games.

Now that you have studied this example in great detail and have suddenly became a Master Procrastinator I think you might enjoy studying the next problem:

proc_2

The obvious move is to complete a run of hearts using columns 6 and 7. Even better: Microsoft is kindly highlighting this move for us. And we also expose the last hidden card in column 6. The only downside is we expose the ace of clubs. Aces are generally undesirable since nothing can be played onto them. Since this game is going well, one ace will probably not hurt us. But we may as well try to avoid it if at all possible. If you’ve suffered too many bad beats in Texas Holdem and you think Spider Solitaire is out to get you then you probably know what I’m talking about.

Of course we know by now that the most obvious move is not always the best. Looking around for other options, we notice we can get two empty columns by shifting the 3-2 in column 4 onto the Four of Hearts in column 6. But that is a Pyrrhic victory since we don’t get to clear Hearts. We have to give back one of the empty columns just to reveal a new card.

Oops: I’ve just noticed that if we do get the second empty column then we can tidy things slightly by swapping the Ten of Clubs in column 4 with the Ten of Diamonds in Column 9 (note this is not possible with only 1 empty column). Okay, Microsoft is no longer highlighting the obvious move but we can live with that.

proc_3

So it’s decided then: NOW we can safely drag the 3-2-A of Hearts onto the Four, clear the suit and reveal the last card in column 6.

Actually it is possible to improve this plan slightly. Can you see it? (hint: it involves procrastination).

You know the drill by now: No peeking at the answers below (deliberately or otherwise) until you’ve had an honest crack at this problem

image-8

The correct move is … Ah 70,85,67,75 it. I can’t be bothered completing this post. I’ll do it tomorrow 😊

The Duplicate Spider Solitaire Club

“Minnie and her glasses did it again!” fumed Cy the Cygnet (*)

(*) Yes … I borrowed that idea from Frank Stewart’s excellent Bridge Columns

Minnie Mouse, the smallest member of the Duplicate Spider Solitaire club, wears second-hand bifocals that make her mix up same-colour suits, much to the chagrin of other players. Cy had been her chief victim.

“Now what?” I sighed. If I had a happy-face disc for every bad beat story someone told me then I swear I would never lose a game of Connect Four.

“The play had started well at my table. I had already turned over eight cards and I only needed one more good card to get an empty column.”

I nodded. Judging from the game state below, Cy hasn’t done anything majorly wrong yet.

duplicate_1

“Alas, the next card in column 8 was the other Ten of Diamonds,” continued Cy. “Column 1 didn’t yield anything useful either, a Four of Spades underneath the Ace of Clubs.”

In this hand there is a stipulation saying no cards to be dealt from the stock. I presume this is to help students improve by focusing on one concept at a time.

“Game over, +100.” I said. “How did Minnie go?”

“Minnie started the same way, but then she moved the Ten of HEARTS in column nine onto column 2.”

“Thinking it was the Ten of Diamonds,” I said.

“Minnie turned over a Nine of Clubs in column 9 and that was all she wrote, if you pardon the terrible cliché. It wasn’t even close.”

“I’m okay with terrible clichés,” I replied. “I use them time and time again.”

“Minnie’s play was wrong on two counts,” insisted Cy. “Not only did she misread the suits, but her goal was to expose as many cards as possible, not build sequences in suit.”

Actually Minnie’s play was correct. There are three guaranteed turnovers in columns 1,8,9 even if the worst possible cards turned up – provided the cards were played in proper order. Cy’s impulsive play meant that he was no longer guaranteed to turnover a card in column 9. If he shifts the Js-0h in column 9 first then the turnover in column 8 will not run away.

One might even make an argument of shifting the Ace in column 1 first. This “kills” column 5, but column 7 contains a suited 2-A. Therefore, we will only regret this move if we turned over two Threes (whereas we only need one King in order to regret shifting the Js-0h). The important point is Minnie’s play was better than Cy’s.

“Has anybody managed to expose all the cards for a single hand yet?” coos the Smart 65,83,83.

“Don’t ask,” replies the Dumb Bunny.

“Shush!” I say. “There are still animals playing.”

Duplicate Spider Solitaire is a fun variant, particularly for lousy players who never get close to winning a game at the highest difficulty level. Certain stipulations are also provided such as “score 10 points per turnover” or “do not deal any cards from the stock.” Therefore, if you get into a complete mess you can always hope your measly score is enough to beat the others players who must play the same lousy hands. You gain match points whenever you perform better than anyone else.

Unfortunately I am not aware of any existing Duplicate Spider Solitaire clubs anywhere in the real world. Perhaps some of my Bridge friends would know of one (or are willing to start one!). If so, then please leave a comment below 😊

The importance of move order (alternative version)

Yawn. Yawn. Yawn. Yawn. Yawn.

I could use a bit of sleep. It all started last night after the Bad Idea Bears suggested a long poker session with the usual suspects. After some thought I agreed, but only because they actually behaved well during the last week. One thing led to another and … anyways, you get the gist. Hopefully today won’t be too much of a disaster.

“Here is an interesting position,” I say. “What would be your play here?”

I pull out my i-Phone and show the position to my students. It’s a pity we don’t have whiteboards and chalk in the jungle.

pic1_08sep

The monkey takes out two decks of playing cards. After three minutes he is the first to offer an answer.

“I say it doesn’t matter what move we play. I’ve played 100 games thanks to my usual extremely-fast-metabolism and I estimate the winning chances are exactly zero”.

Groan.

“I believe we call this a self-fulfilling prophecy,” I reply. “Perhaps, if we thought that victory was actually possible and adjust our strategy accordingly then our chances would increase.”

Unfortunately most of the students are sympathising with the Monkey. After all, nobody in the animal kingdom has managed to beat the game at the four-suit level.

“Anyone else have a better opinion? How about you Mr Snail?”

“I need some more thinking time,” says the Wise Snail.

Hmmm … this lesson ain’t off to a great start. Not surprisingly, the Wise Snail is the slowest player in the Animal Kingdom. At least I will give him credit for being a better player than the Monkey since the Snail hasn’t lost 50 quintillion games in a row.

“The position isn’t that complicated,” I reply. “There are only 11 cards in play and 5 legal moves.”

“Yes, but with 11 cards in play we have 93 cards unseen.”

“But what’s that got to do with the Fundamental Theorem of Calculus?”

“Well, we know that in Freecell the chances of winning is exactly 100% or 0% assuming perfect play,” replies the Snail. “This is because all cards are exposed. In Spider, if we ever reach a game state with only 2 hidden cards then the winning chances must be 0%, 50% or 100%. With 3 hidden cards, the winning chances will be some number divided by three …”

“Three factorial is six,” says the Smart 65,83,83. “Some number divided by six.”

“Whatever,” continues the Wise Snail. “Similarly one can compute the exact winning chances for any number of face-down cards”.

“I see where you’re coming from,” I reply. “Unfortunately with 93 face down cards, there are 1.156 * 10^144 possible permutations if we ignore cards with identical suit and rank. We only have half an hour remaining in this lesson.”

The Wise Snail pulls a frowny face.

“I wanna flip a coin, since there are no in-suit builds,” offers the elephant. “Unfortunately there are 5 legal moves and we don’t have a coin with five sides.”

Okay, +1 for humour but not exactly the answer I was after.

“Four of Hearts onto the Five,” says Bad Idea Bear #1.

“Only three more good cards and we get an empty column!” adds Bad Idea Bear #2.

“We can eliminate some moves,” offers the Jaguar. “Moving either Eight onto the Nine is equivalent, so pretend there is only one Eight. We shouldn’t move a Four onto the Five since that means we only have two guaranteed turnovers, not three. Therefore it’s a choice between 9-8 or 6-5.”

“That’s good,” I say. “Finally we’re getting somewhere.”

“So we don’t need a 5-sided coin after all,” says the Monkey.

At least the monkey is paying attention this time and knows a thing or two about humour. The Smart 65,83,83 gives the Monkey an oh-so-polite wink.

The eagle remains silent. He knows the answer, but wants to give the other students a chance to contribute.

The lion raises his front paw. It’s always a pleasure to witness the insights of the lion, one of my better students.

“If we move 9-8,” roars the lion, “then assuming we turn over a bad card we have to choose 6-5 next. But if we start with 6-5 then we can choose between 5-4 or 9-8 later. 6-5 it is.”

This is a good insight, but not the answer I intended.

“Every player knows that building in-suit is more desirable than off-suit,” I say. “When we build off-suit then (at least in the first few moves) most of the time we are effectively losing an out, assuming our goal is to expose as many cards as possible.”

“For instance, if we move a Ten onto a Jack then a Queen is no longer a good card. There are a number of exceptions: for instance, moving a Queen onto a King does not lose an out for obvious reasons and if we have e.g. a Two and a pair of Threes then again we avoid losing an out. Once all the easy moves are exhausted we have to choose carefully.”

I briefly glance at my notes, just checking I have the right game state.

“We have three guaranteed turnovers with 9-8 and 6-5-4. For simplicity let us ignore the fact we have duplicate Fours and Eights. Clearly we won’t move the Four onto the Five as that will bring us down to two guaranteed turnovers. Well done to the Jaguar for spotting this. Hence the choice is between 9-8 and 6-5.”

“Let us pretend that we have to make two moves before exposing any face-down cards. For instance, we might move 9-8, then 6-5 then turn over the cards underneath the Five and Eight. Or we might move 6-5, then 5-4 then turn over the cards underneath the Four and Five.”

Uh oh. The Sloth is snoring. I think nothing of it: after all he’s not the sharpest tool in the jungle out there if you excuse the terrible cliché and/or mixed metaphor. In fact I don’t recall the last time he didn’t fall asleep.

“Observe that in the first case we have lost two outs since Tens and Sevens are not as good as before (even though they are still good). But in the second case we only lose one out (the Seven). Therefore the correct move is 6-5. Well done Lion!”

“Roughly speaking, making two moves before exposing face-down cards corresponds to a worst-case scenario when a useless card comes up (e.g. an Ace). If a decent card came up then we might reconsider. For instance, after moving 6-5 we might expose a Two and then we must choose between 5-4, 2-A or 9-8.”

The Eagle is desperately trying to suppress a chuckle. Something is out of character: my best student doesn’t exactly have a reputation for lame puns, knock-knock jokes or pranks.

“As a general rule,” I continue, “building a long off-suit sequence of cards means you generally have more safe moves before you start losing outs. For instance if you had 3-4-5-6-7 within the first ten cards then playing 7-6 loses an out, but then you can build 6-5-4-3 within the next three moves without losing any extra outs. Of course the fickle Spider gods might eventually give you an Eight and an empty column, and you find you are still unable to move the 7-6-5-4-3 onto the Eight –”

79,72,32,70,85,67,75.

I’ve just realised that EVERYBODY HAS FALLEN ASLEEP EXCEPT THE EAGLE. Maybe quitting my day job and teaching various animals how to play well at Spider Solitaire ain’t what’s it cracked up to be. Or perhaps my teaching skills need a bit of work. Or perhaps I should learn to say “NO” to the Bad Idea Bears whenever I have to teach the following day.

Now it is my turn to pull a frowny face.

THE END

The importance of move order

Every player knows that building in-suit is more desirable than off-suit. When we build off-suit then (at least in the first few moves) most of the time we are effectively “losing an out”, assuming our goal is to expose as many cards as possible. For instance, if we move a Ten onto a Jack then a Queen is no longer a “good card”. There are a number of exceptions: for instance moving a Queen onto a King does not lose an out for obvious reasons J and if we have e.g. a Two and a pair of Threes then again we avoid losing an out. Once all the “easy moves” are exhausted we have to choose carefully.

Consider the following position. What would be your play here?

pic1_08sep

We have three guaranteed turnovers with 9-8 and 6-5-4. For simplicity let us ignore the fact we have duplicate Fours and Eights. Clearly we won’t move the Four onto the Five as that will bring us down to two guaranteed turnovers. Hence the choice is between 9-8 and 6-5.

Let us pretend that we have to make two moves before exposing any face-down cards. For instance, we might move 9-8, then 6-5 then turn over the cards underneath the Five and Eight. Or we might move 6-5, then 5-4 then turn over the cards underneath the Four and Five.

Observe that in the first case we have lost two outs since Tens and Sevens are not as good as before (even though they are still good). But in the second case we only lose one out (the Seven). Therefore the correct move is 6-5. Well done if you chose this move.

Roughly speaking, making two moves before exposing face-down cards corresponds to a worst-case scenario when a useless card comes up (e.g. an Ace). If a decent card came up then we might reconsider. For instance, after moving 6-5 we might expose a Two and then we must choose between 5-4, 2-A or 9-8.

As a general rule, building a long off-suit sequence of cards means you generally have more “safe moves” before you start losing outs. For instance if you had 3-4-5-6-7 within the first ten cards then playing 7-6 loses an out, but then you can build 6-5-4-3 within the next three moves without losing any extra outs. Of course the fickle Spider gods might eventually give you an Eight and an empty column, when you are still unable to move the 7-6-5-4-3 onto the Eight – but that’s beyond the scope of this post.

Until next time, happy Spider Solitaire playing!

Building Complete Suits

One of the hallmarks of a winning Spider player is the ability to consistently clear at least one suit, even on difficult hands. Often players get caught up in the minutiae of trying to turn over as many cards as possible or to “tidy” things up by arranging suited builds. This is all well and good near the beginning but when you have several cards in play it’s time to think about building suits. This often requires “whole board thinking” and long term planning.

In easy or medium (1 or 2 suit) level, if a player turns over enough cards and gets and empty column or two then complete suits will take care of themselves. But this is not true at expert level. A good player should be thinking about building suits at virtually every stage of the game.

What happens if you get 1 or 2 empty columns, a few suited connectors scattered here and there but are never able to remove a complete suit onto the foundations? The following diagram should give you a pretty strong hint 😊

To clear a suit, two things must happen:

  • All 13 ranks of that suit must be visible
  • It must be possible to organise them into a single column.

 The first condition is easy to check, since it’s just an exercise in card-counting. The tricky bit is answering the second condition, assuming the first condition actually holds.

Here is a simple example, which you may recognise from my (admittedly lame) short story from a previous post.

We have already cleared the club suit and there are three empty columns. This game should be easily winnable, but we may as well use this example to illustrate the concept of building full suits. Every rank in the Heart suit is visible. We have K-Q-J-0 in column 2. The remaining cards are found in columns 3,4 and 9. With three empty columns it is not hard to verify the Hearts can be collected into a single column.

As a fun exercise, try to do it with less than three empty columns. The following table should give an estimate of your playing strength

If you can clear Hearts with Then
Three empty columns Well done
Two empty columns You are already above beginner level
One empty column You are probably an International Master
Zero empty columns or less Your name is probably Chuck Norris

If you wanna get really good at 4-Suit Spider, you should try to visualise what happens after clearing a suit. After all the aim of the game is to complete eight suits, not just one. But that’s a lesson for later. As usual, it’s best for a beginner player to focus on learning one thing at a time.

In practice, it is often wise to think about complete suits before all 13 ranks of a particular suit become visible. As an example, consider the following two diagrams and answer the questions below:

  • What is the difference between two diagrams?
  • Are they equivalent? That is, given one diagram can you reach the other?
  • Assume your next move is shifting the 10 of Hearts to an empty column. Which diagram would you prefer and why?

These diagrams are the same, except columns 8 and 9 have some cards switched. If we assume that each suited connector is worth 1 brownie point, both diagrams would score the same number of BP.

The difference of course is that in the second diagram we already have a run from K-Q-J-0-9-8 in spades. If, somehow, we get a run from Seven to Ace, then the difference between the two diagrams becomes manifest. It is true that we are a long way from getting 7-6-5-4-3-2-A in Spades, but there is no harm setting up the run from K-Q-J-0-9-8.

Those with an attention to detail might have noticed it took me 15 moves just to swap the Q-J-0-9 in columns 8 and 9 for some nebulous gain. But I recommend that the serious player should get into this habit of striving for perfection even at the cost of playing numerous moves and losing score. Once the player can get a decent win rate (e.g. 30% without 85,78,68,79) he can start to think about optimising score.

Many close games are lost because a player is stuck with a “twelve-suit” instead of a complete suit, and it is quite possible the loss can be blamed on poor planning at an early stage of the game.

I hope you found these lessons useful. If your Spider win rate has dramatically improved in the last three weeks, please leave a comment below 🙂