Game On (20 June 2021)

Last week we asked the following:

Is it possible to determine the identity of the next unknown card for all columns containing at least one face-down card?

The answer is no. I can get columns 4,5,6,9,10 but not 1,3, or 8.

The problem with column 8 is we need to build off-suit with 3-2 to get the empty column, but then there is no Four or Three to shift that off-suit 3-2. One empty column is not enough. I will not discuss columns 1 and 3. That has already been covered last week with Bart and Schistocerca Americana’s (SA) excellent comments. Well done again to Bart and SA. I guess the next step is to take the easy turnovers and take it from there.

BTW Thanks also to Sebastian for liking one of my recent posts. I hope to hear more from him.

We reach the following position (both the current game state according to Microsoft Spider Solitaire and our cheat sheet) with the five newly turned over cards highlighted:

Let’s just say these are not the most helpful cards. At least this can partly explain why I lost this game rather convincingly without undo. It seems to be hard enough to win, even with the undo Awesome Superpower.

I guess we can take some freebies in column 4 at the expense of dumping a King into an empty column. This leads to the following:

And now we reach a dead-end. There are no more easy turnovers and we have to make some choices. If we think about long-term planning (rather than short-term gains) then there are three basic choices to consider:

  • Go back to the very beginning and look for more turnovers without dealing anything from the stock
  • Go back to the first position of this post(score = 141) and try to arrange matters so that the next deal of J-6-2-5-4-A-3-8-8-K is as helpful as possible
  • Look for ways to remove at least one suit to the foundations, given the information we already know

Stepping back for a minute, we can observe a problem with Fours and Nines. Despite turning over more than half the cards in the tableau we didn’t find a single Nine. We know six of these are in the stock. We only managed to find two Fours at the expense of dumping a King into an empty column.

Over to you. How would you continue here?

A small reminder: Microsoft Spider Solitaire will not allow a player to deal a row of cards if there is at least one empty column.

I guess that got pretty pathetic (alternative version)

Commentator 1: “Welcome to the biggest event of year in the Animal Kingdom – Shah Mat Spider Solitaire! This is a charity event to help raise funds for animals affected by the Virus That Dare Not Speak Its Name …”

Spider GM waltzes around the tables dealing different hands to ten different players.

Commentator 1: “On board 1 we have the eagle. Widely known as the best animal in Poker, she can also play a mean game of Spider Solitaire.”

Commentator 2: “Board 2 is the lion who also knows the game.”

A large crowd gathers as the commentators introduce all the players. Spider GM has the routine task of simultaneously monitoring 10 boards and making sure no illegal moves are played. But he is not complaining. However, all eyes are on the player at Board 10. Conspicuous by his presence, one doesn’t have to be named Captain Obvious to spot the strange-looking player.

Commentator 1: “Not the most exciting of tasks for the Spider GM. But he understands it’s all for a noble cause – wait a minute, who is this Big Shiny Red Question Mark?”

Commentator 2: “Very little is known about BSRQM. His name is N. Kamath, co-founder of some stock brokerage most folk wouldn’t give a rot13(fuvg) about. His Spider Solitaire rating is 800 something … compared to the Eagle who is 2400 something”

The spectators exchange confused glances with one another. They are well familiar with the usual riff-raff animal types from Phil Hellmuth’s Play Poker Like the Pros. But not one spectator has heard of N. Kamath.

Rick Astley (guest commentator): “You know the rules – and so do I. Each player has 30 minutes to win as many games as possible. There is no penalty for losing a game. You cannot move any cards until Spider GM appears at your table. You can resign the current game and start a new hand whenever you want. Undo is not allowed.

Commentator 1: “The name sounds familiar – Kamath used to play Chess …”

Commentator 1 pauses. He suddenly realises this is a charity event after all and nobody is supposed to mention the C word that is rhyming slang for Paul Keating.

With all players seated at their tables and ready to play, the formalities have concluded and the games can begin.

As predicted, the Eagle is the first to win a hand. The Lion does the same soon after. Most of the players perform to expectations. But there are some sharp-eyed members in the audience. Big Shiny Red Question Mark has this weird habit of glancing to his left every now and again – but never when Spider GM has appeared at his table.

The time limit is almost over, and the commentators’ voices reach a crescendo (as one does in the pointy end of horse races).

Commentator 2: “We’re into the home stretch, last five minutes … hey rot13(jung gur shpx)?  Big Shiny Red Question Mark is about to win a hand!”

Commentator 1: “I don’t believe it – two suits removed, three empty columns. There is no way he can lose from here. Only two face down cards. Plenty of time on the clock … and”

Commentators 1 and 2 (simultaneously): “Big Shiny Red Question Mark Resigns The Game!!!! Unbelievable!!! Rot13(haorshpxvatyvrinoyr!!!). What is this madness???”

n the post-game interview BSRQM explains there were no useful moves detected – therefore he had to resign. He squirms in his seat while the press continue to ask uncomfortable questions. Thankfully the absolute train-wreck of a post mortem doesn’t last long and everyone can head home. BSRQM is never heard from again and everyone lives happily ever after.

THE MORAL OF THE STORY: Cheats never prosper.


I guess that got pretty pathetic

Some time ago I played with a Spider Solitaire app for iPhone. And I have to say its features are more bewildering than the infamous “At first condemn our very feeble excuse for everything that follows constant negative press (7)” tweet from 2017 US politics.

Earlier this year I could load the program and deal a hand. Unfortunately I couldn’t see any cards!  I eventually decided to update all my apps, but only because Gmail also needed an upgrade for some reason. A few days ago I played my first game and lost narrowly. On the very next game this happened:

(Text version):

Suits removed: Diamonds, Spades

Stock: 0 cards remaining

Column 1: Ks

Column 2:

Column 3: Kh,Qh,Jh,Th,9h,8h,7d,6d,5d,,4c,3c,2c,Ad,8d,7c,6c,5c,4c,3c,2c,Ac

Column 4:

Column 5: 6h,5h,4h,3d,2d,As,2s,Ah,7c,6s

Column 6: ?,8c,Qd,Jd,Tc,9d,8s,7s,6c,5s,4s,3s,2h,Ah,9c,Kh,Qh,Js,Td,9s

Column 7: Kc,Qc,Jc,4d,7h

Column 8:

Column 9: ?,Kd,Qc,Jc,Tc,9c,8c,5h,4h,3h,2h,Ac

Column 10: Kc,Qs,Jh,Ts,9h,8h,7h,6h,5c

Ummm … excuse me? Do I not even get a chance to turn over the last card in Column 9? Like I said, this is more bewildering than the infamous “At first condemn our very feeble excuse for everything that follows constant negative press (7)” tweet from 2017 US politics. Don’t say you weren’t warned.

At the risk of insulting the intelligence of Captain Obvious, I have removed two suits and obtained three empty columns. I know from experience this does not automatically guarantee victory (especially if you are playing a certain server). But this game state is not even close to being one of the exceptions. I leave it as an exercise for the reader to verify the game is mathematically won regardless of the permutation of unseen cards.

Not every Spider Solitaire player has above average IQ and all game developers must cater to the whole market instead of a single expert player – yes, I get that. But whoever wrote this software doesn’t understand the fundamentals of the game. Therefore I am deleting this app.

The good news is Humanity has not (yet) been completely surpassed by its Artificial Intelligence counterpart. While I cannot pretend to understand the detailed game-theoretic specificity of AlphaGo’s Move 37 against Lee Sedol I can still sleep at night knowing AI has some catching up to do when it comes to playing Spider Solitaire.

Out of curiosity I clicked the magic button to see what would happen. The app yanked a full set of clubs from various columns and moved that to the foundations. I’m not sure how this esoteric piece of knowledge will help me in future, but I guess knowing this fact can’t hurt either.

Just In Case You’re Really Bored: can you win the above game with only two empty columns instead of three?

Just In Case You’re Really Really Bored: can you win the above game with only ONE empty column instead of three?

Just In Case You’re Really Really Really Bored: Write a 5000 word essay explaining why move 37 at P10 is more awesome than my attempt to “improve” Grant Woolard’s Classical Music Mashup IV.

Game On (13 June 2021, Alternative Version)

“I think I have discovered the secret of playing well at Four Suit Spider Solitaire,” says the Cat. “I can win about 99% of the time.”

“How is that possible?” asks the Wise Snail. “Our best player is the Eagle, but she can only win about half the time”

“Well, there are many secrets to winning about 99% of the time,” replies the Cat. “The first secret I will like to talk about is minimum guaranteed turnovers. Expert opinion says on average you should have just under 4 guaranteed turnovers if the cards are dealt randomly. But I think it should be significantly higher.”

“How do you make it higher?” asks the Elephant.

“Let me show you,” replies the Cat. The Cat quickly deals another hand. The initial state is shown below:

“Yes. This is a good example,” says the Cat. “Observe that we start with two Jacks and one Queen. Ignoring the other cards for now, most experts will say this is worth one turnover – either the Jack of Hearts or Jack of Spades can move to the Queen in column Three. Most players will choose the Jack of Hearts for obvious reasons.”

“So far so good,” says the Lion.

“Now I want everyone to close their eyes,” says the Cat. “The Wise Snail will count to fifty and then everyone can open their eyes again.”

“Now I have two turnovers: I have superimposed both the Jack of Hearts and the Jack of Spades onto column 3 revealing two cards in columns 7 and 9.”

“This is revolutionary!” says the Dumb Bunny. “I wonder why nobody has ever thought of this before. I like it!”

All the students nod in agreement with their eyes wide shut. The Cat continues to move some cards around. Meanwhile the song I’m A Believer by Neil Diamond can be heard in the distance. Yes, The Singing Monkeys don’t have the best voices but my students are used to that by now.

At last, the Wise Snail reaches fifty and everyone can open their eyes.

“Cat is sus,” says Purple. “As far as I can tell, there are only eleven cards exposed. The Cat has made a solitary move: Jack of Hearts from column 7 to column 3, revealing the other Queen of Hearts.”

“Yes, it appears I have only made a single move,” replies the Cat. “But I also know that column 9 contains King of Diamonds beneath the Jack of Spades. Column 7 starts with Jack of Hearts, Queen of Hearts, Two of Diamonds, Seven of Clubs. Moreover, it is possible to get an empty column – ”

“But how would you know all this?” asks Orange. “You must have cheated!”

“And remember,” yells the rot13(fzneg nff), “the first rule of Spider Solitaire Club is you do not play with undo. The second rule of Spider Solitaire Club is you DONOT … play with undo!”

Purple immediately calls a meeting. A plurality vote is held and all twelve colours from Among Us decide that Cat is indeed sus.

“Sorry I’m late – hey rot13(jung gur shpx?)” I say. It takes me less than three nano-seconds to observe the Elephant has grabbed the Cat with his trunk and is about to hurl the poor thing in the direction of The Singing Monkeys. It doesn’t take long for my students to explain what happened.

“I know I normally don’t play with undo,” I state matter-of-factly. “But I wish to remind you that playing with undo was absolutely necessary for me to publish my paper on Spider Solitaire. And without this paper, I wouldn’t be maintaining this blog – which you are all part of.”

It’s a process, but I am able to eventually convince the Elephant to release the poor Cat. Also, in future when I am late nobody is allowed to give impromptu lessons during my absence.

Nobody ever hears from the Cat again. On the very next day, an unpleasant rumour starts spreading: the cat has somehow been poisoned. Unable to confirm any details, I can only assert that she is simultaneously dead and alive.

The End

Game on (13 June 2021)

In the last week I asked the following question: how many rows do we need to deal from the stock to be sure of procuring an empty column (assuming the worst possible permutation of unseen cards)?

First let us clear up the Captain-Obvious stuff: Column 2 is the only column with no unknown cards so we must focus on that. Also, there is not a single Nine anywhere until the second deal so the answer must be at least 2. By that time, two Sixes will appear in Column 2 so we need to find enough Sevens to take care of these Sixes.

Schistocerca Americana gave a correct answer of three rows. I say correct because the Grand Faster mucked up by not asking for the minimum number of deals. I should have asked what is the minimum number of rows we need to deal from the stock to be sure of procuring an empty column?

Bart gave another correct answer of two rows. Starting from the game state from last time:

The following moves do the trick:

Before deal: dj,aj
After deal 1 (J6254A388K) : db,ad,ba,ge
After deal 2 (562259AJ8Q): gc,bg,bf

Note that the first move dj is a typical tesuji (link) when playing with undo. This can only be explained by prior knowledge of cards in the stock – it is inconceivable an expert player can find some miniscule advantage of dj over “doing nothing” if playing without undo. Also observe that we got lucky with ba after deal 1: the Five and Six are the same suit, hence the move is indeed legal.

Of course, it will be desirable to achieve an empty column without dealing any rows from the stock. We can guarantee at least three turnovers in columns 1,6 and 7. On a good day, we will get an empty column without any of the shenanigans described above. The worst-case scenario says we are forced to deal two rows, take the empty column and proceed from there.

Our luck is in: the final hidden card is the Queen of Spades which can immediately go onto the King of Hearts in column 5. So now we know it is possible to get an empty column without dealing any of the shenanigans described above.

Our cheat sheet now looks like the following:

The power of an empty column should be pretty clear. For most of the columns it is easy to determine the next face-down card, then undo to recover the empty column.

It is time for a new question: Is it possible to determine the identity of the next unknown card for all columns containing at least one face-down card?

Assume we are allowed to restart from the very beginning, but cannot deal any cards from the stock.

Thanks to Bart Wright and Schistocerca Americana for once again reminding me of my lack of cultural knowledge (e.g. Kung Fu). There is only so much one can do with my favourite animal types from Phil Hellmuth’s book Play Poker Like The Pros 😊

Game on (6 June 2021)

Last week I asked the following questions:

  • Which suits have all 13 cards appearing at least once?
  • Assuming you answered “more than zero”, can we actually remove a suit (regardless of identity of face-down cards)?

Bart Wright had some vague intuition that it might be possible. Judging from his writing, I think he would have some valuable management skills to contribute to any company who is interested in hiring. Unfortunately, he failed the “specific/measurable/achievable/relevant/time-bound” test. Schistocerca Americana has found a solution: Diamonds is the only suit with each card appearing at least once. His solution is as follows:

Deal – Do Nothing

1st Draw – ed

2nd Draw – hj, hf, dh, da, eb

3rd Draw – fb, hf, cg, eg, ig

4th Draw – ja, ji, ji, jd, fj, eg, fg, ei, gi, ga, ch

5th Draw – da, ad, ab, ib, ab, jb, af, aj, aj, ij, fj, hd, hj

The result is shown below. Using cut-n-paste in Excel proves this solution is indeed valid with no illegal moves, sloppy explanations or typos.

To be honest, I didn’t try to solve this problem myself since I am currently working on another fun project that is unrelated to Spider Solitaire. Well done to Bart Wright and Schistocerca Americana for their excellent contribution to this blog.

Of course, we are interested in removing eight suits instead of one. Clearly it makes sense to look for easy turnovers and empty columns at the beginning of the game. But the above was not an exercise in futility. At least we know that it’s possible to remove a suit just by sheer power of information (i.e. knowing the identity of unseen cards) even without an empty column. Besides an aspiring player must (i) learn to analyse long move-sequences involving a large number of face-up cards when playing without undo (ii) learn to play the cards well even when there is no empty column 😊

Let us first focus on exposing as many turnovers as possible without dealing any cards from the stock. Experimentation shows it is easy enough to turn over many cards in the tableau, including all cards in column 2:

Further experimentation with undo leads to the following cheat sheet:

It’s time for another fun question: how many rows do we need to deal from the stock to be sure of procuring an empty column (assuming the worst possible permutation of unseen cards)?

Note that NaN may be a valid answer if this turns out to be impossible even allowing for dealing all cards from the stock.

Game On (30 May 2021)

We continue our game from last week. Last time I asked what is the minimum number of face-up cards we are guaranteed if undo is allowed and we don’t care about losing 1 point for every move or undo?

Not surprisingly Bart and George found the correct answer of six cards (it wasn’t meant to be difficult). With the help of undo we can see what’s beneath the Queen of Hearts, the two Jacks and the three Tens. One can also argue the correct answer is 56 because we get to deal all cards in the stock and then undo – or perhaps even 66 cards if we count the ten cards that are already showing.

Nitpicking aside, our card-tracking now looks like this:

It should be pretty clear we can improve on our 66 exposed cards. But given we know so much information it might be possible to complete a suit by force! Here are some questions to ponder:

  • Which suits have all 13 cards appearing at least once?
  • Assuming you answered “more than zero”, can we actually remove a suit (regardless of identity of face-down cards)?

Playing with the “Undo” Awesome Superpower.

In this hand I wanna set the task of winning a game with undo. Normally I would view undoing moves as a cardinal sin – equivalent to Mark Goodliffe’s infamous bifurcation strategy when live-solving Sudoku. but I will allow myself this luxury for an important reason: I needed undo to get my paper published when proving that a certain Spider Solitaire was biased (or at least there was good reason to believe so). Therefore, the U-bomb will not be considered a rude four-letter word and there will be no attempt to encrypt it with a rot-13 cypher.

Our goal is to win the following deal with the luxury of undo. I will not attempt to optimise my score. Also, there will be no cheevo considerations. Note that Microsoft Windows does not offer the player of explicitly restarting a hand: the best we can do is repeatedly press undo until we reach the start (Some folk have complained about this, but I have seen much worse bugs from other servers. Hence, I will avoid the Microsoft-bashing bandwagon for now). At least Microsoft allows undo of every move, including removing a suit or dealing a new row. Other programs may be less luxurious in that regard.

You may have recognised this deal from my previous blog posts. I deliberately did this since a random deal should be easily won with the undo superpower – but since I lost rather badly without undo I would expect this particular deal would not be a walkover.

When playing with undo I assume we have the luxury of card-tracking (this is equivalent to tile-tracking for serious Scrabble players). A card-tracking sheet will indicate the identity of known cards in the starting position. This would look something like the following:

I will use four different colours green/blue/red/black for C/D/H/S respectively. This colour scheme is often used in poker.

SANITY CHECK: the cards in the first four columns are all different suits. If this colour scheme is inconvenient (e.g. for people with red-green colour blindness) please let me know in the comments!

We will start with a warm-up question: what is the minimum number of face-up cards we are guaranteed if undo is allowed and we don’t care about losing 1 point for every move or undo?

NOTE: For purposes of this exercise, we will pretend we have conveniently forgotten about my previous blog posts. This means e.g. the answer is not X, where X is the number of face-up cards when I conceded the game in my previous post.

Game on … or off (9 May 2021)

As promised, we deal the final row of cards:

Yeah that does look pretty bad … if the next card in column 1 is e.g. an Ace then there will be no legal moves (ignoring breaking the in-suit build with fb). I guess the only bright spot is the Ten and Jack are the same suit which is what keeps us mathematically alive.

Right card, wrong timing. Game over, thanks for coming!

Game on (8 May 2021)

Here is the position from last week

Our latest turnovers have not been good. We started with four guaranteed turnovers and only managed to increase it to five. On the other hand we did manage to find the Queen of Clubs – which means there may be some prospect of clearing the club suit (which Bart has correctly pointed out).

If you’re wondering why the Noble Spider GM has goofed, it’s because I was no longer able to connect the J-T-9 of clubs in column 4 with the 8-7-6-5 in column 10. By trying to be too clever with delaying certain non-reversible moves, I only succeeded in losing the ability to build the massive run of clubs. So maybe I shouldn’t have extolled the virtues of procrastination as per a previous post. In any case, it’s adios to our empty column, unless we get a good card.

It’s tempting to shift the Queen of Clubs into the hole, but Bart found the Wright idea (ba-dum-tish!!!) of tidying up the 8-7-6 of Spades with the moves df,ad.

There are several reasons why this is important:

  • there are three Eights unseen as opposed to one King, therefor more chances of getting back the empty column
  • The move bf would duplicate Queens in columns 7 and 8, and that also means less chances of getting back the empty column
  • The most important reason is that we want to correct our earlier mistake with the Grand Master’s Goof from last week. In other words, if we get the empty column back we get the additional bonus of building in-suit. Note that any Nine will not yield an empty column, but we would still be able to correct the Grand Master’s Goof.

There is another possibility to consider. We can build in-suit with the 6-5 of spades in columns 1 and 5. This also allows us to swap the Twos of Clubs/Spades in column 5/9, thus tidying up our club suit. Because we have committed to completing the clubs, it makes sense to extend the run by one card. The downside of course is we expose another Ace. But since there is only one Five unseen, the Six of Spades is expendable. If the card gods give us the case Five – then they give us the case Five. I’m not sure why poker players use the term “case five” but I digress.

My recommended move sequence is: ea,ef,eh,ih,ie,he,hi,fi,df,ad.

And sure enough we do get a Nine – so now I can sleep with a clear conscience even if we do manage to lose the game!

It is now time to deal the final row of cards, but I will wait till tomorrow – for no other reason than to build up the suspense 😊