Spider Solitaire Notation (alternative version)

The streets were littered with random animal and human body parts. An arm here. A leg there. A lizard’s tail, a cat’s paw. A pair of bunny ears to the right, an ox-tongue to the left. A human kidney, a lung. Careful, don’t step on the occasional monkey brains … uh oh, somebody even managed to lose his 68,73,67,75 after, shall we say, some rather poor decision making. The city was not exactly known for good hygiene, and a vaccine for the mystery virus wasn’t coming any time soon. But the White Bishop knew he had been one of the luckier ones. He only had a nose missing.

Despite many years of debate and discussion, there was no consensus on whether the Knight or Bishop was the stronger piece on the Chessboard so they had decided to settle things over a game of Spider Solitaire, or more precisely a series of games. It was well known the Knight could wield a mean deck of cards or two, but the Bishop felt he was equal to the challenge.

They would both play 100 games each, and whoever won more games than the other would win the match. As compensation for being wheelchair-bound, the Bishop gave the Knight odds of half-a-game. Thus, if they both won the same number of games, the Knight would be declared the stronger player.

notationexample-05172020

“<ji>”, says the Black Knight.

The White Bishop obediently moves the Four of Clubs onto the Five of Clubs, exposing the Three of Diamonds.

“<eh>”.

The White Bishop moves the Seven of Spades onto the Eight of Spades, exposing the Four of Diamonds

“<ie> – oops I mean <je> … <if> … <if> … <fi>”

And on and on it went. The quadriplegic would announce his moves according to their agreed notation and his anosmia-stricken best friend would play them out. They had even mastered the lingo for supermoves, (borrowing from the simpler game of Freecell) and superswaps. When it was the Bishop’s turn to play, the Knight would only watch. Of course there would be no 85,78,68,79 for either player. All the other chessmen watched in awe, admiring the skill of both players as they navigated the good cards and bad.

< several games later >

The Knight had won 47 games out of 100. With his concentration waning near the end he probably should have won a couple extra games. But at least he didn’t have to worry about making further errors. Everything depended on the Bishop who had won 47 out of 99. The latter had reached an endgame with only six face-down cards remaining and the stock empty. At first the prelate was about to concede the game and the match, but he eventually realised he could expose one face-down card with a complex sequence of moves. But he would have to hope the newly-exposed card was good. Finding nothing better, the Bishop executes his plan and is about to turn over a card, but then pauses.

Just turn over the 70,85,67,75,73,78,71 card and get it over and done with, the Black Knight thinks to himself.

“I feel it is most unfair, for the entire match to be decided by a single card.”

“The match is very close,” replies the Knight. “I calculate the odds to be exactly 50:50. The next card will determine the outcome of the game and the match. Get a good card and even the Ninja Monkey can’t 70,85,67,75 it up with random moves. Draw a bad card and you have no plan B.”

The Bishop checks his card-tracking sheet.

“There are three good cards and three bad cards. Doesn’t get much closer than that”

“JUST 70,85,67,75,73,78,71 TURN 70,85,67,75,73,78,71 THAT 70,85,67,75,73,78,71 CARD 70,85,67,75,73,78,71 OVER so we can work out the winner and go home.”

“We both played 100 games and neither player has managed to demonstrate any statistically-significant superiority over the other,” continues the Bishop. “I don’t see any point in completing the last game.”

After some thought, the Black knight replies “All right, we’ll call it a draw.” 😊

Choose Your Difficulty (alternative version)

“Are we there yet?” groans the Sand Griper.

“Do we have to do this?” asks the Dumb Bunny. Meanwhile the Eagle has no cause for complaint as she gracefully soars across the air.

“It’s good exercise,” I reply. Even a Spider Solitaire tragic like me has to get out once in a while.

I sit on a rock, giving myself a brief rest as the rest of the gang catches up. Ninja Monkey does a quick head-count and confirms I haven’t lost any of my students.

“If you judge this fish by its ability to climb a mountain it will live its whole life believing it is stupid,” quips the Smart 65,83,83.

“You’re not helping!” growls the lion. The long trek has clearly taken its toll and even the Bad Idea Bears are not in the mood for jokes. I allow a few minutes break for everyone. We have only another 400 metres to go.

“Are we there yet?”

I turn to the Sand Griper.

“Okay, to make this trip a bit more entertaining I will let you play a game called 20 questions.”

The Sand Griper perks up – not something I see every day.

“The rules are simple,” I say. “You can ask as many questions as you like – except ARE WE THERE YET can only be used twenty times”.

The Sand Griper returns to being his usual grumpy self. Apparently he’s also not in the mood for jokes.

Finally I see a wooden sign and everyone soon reaches the top of the mountain, including the stockfish.

We immediately enter a tunnel. We follow the path and soon find ourselves at a large Games Room. All the animals marvel at the immense variety of board and card games, ranging from the prosaic Snakes and Ladders to the ever-popular Die Siedler von Catan or the ethereal strategic complexity of Risk. Not surprisingly the usual suspects are keen for a game of Texas Holdem after a long trek up the mountain.

“This is different,” says the Stockfish.

Stockfish is looking at a chessboard, except there is something unusual about the Black pieces.

“White has a large advantage” says the letter Alpha.

“Not so fast,” says the Dumb Bunny. “Black only needs to capture the King to win, but White has to capture everything.”

“I say White is completely winning,” replies the letter Zero.

The Eagle notices something unusual about the adjacent Backgammon board: one of the Green dice has the numbers 1,2,3,4,5,5 instead of the usual 1,2,3,4,5,6.

“Oooh look!,” I squeal. “My favourite game!”

Even better – the cards are already dealt, sparing me the arduous task of setting up the start position.

The Wise Snail seems pleased with the initial position. There are four guaranteed turnovers and two guaranteed in-suit builds.

“Jack of Clubs onto the Queen,” says the Elephant. “It’s in-suit and we also have a spare Queen.”

“Well done,” I reply. “You’re learning fast – no wait, I think this game could be rigged.”

“Why is the game rigged?” asks the Eagle. “Yes, there are two exposed Aces but …”,

“My favourite card!” squeals the letter Alpha. Clearly, he is new to the game. But from what I’ve heard these Letters and Numbers are capable of learning a new game with only four hours of self-training.

“But you have taught us many times the initial position is a poor indicator of whether a game will be easy or difficult,” continues the Eagle. “Besides you have four guaranteed turnovers and two in-suit builds.”

“There are other indicators,” I reply. “Remember the backgammon board with the faulty Green Dice, and what about the chessboard with unequal armies? If that’s not rigged then I’m challenging RIGGED whenever somebody plays it in Scrabble!”

“Look at this!” squeals Minnie Mouse. “Texas Holdem is also rigged. Take the Queen of Spades from the deck. Hold the back of the card to your nose. It should be blurry. Focus as though you are looking through the image into the distance. Very slowly move the card away from your face until the letter Q appears …”

Meanwhile the Bad Idea Bears are engaged in a fierce battle of Snakes and Ladders. They eventually realise that every square between 83 and 88 (inclusive) contains a snake and no ladder reaches a number higher than 88.

“So does that mean every single game here is rigged?” asks the Eagle.

“I will assert with 95% confidence every game is rigged, including Spider Solitaire,” I reply. “Welcome to Peak Stupid. But at least we know the game is rigged before moving a single c-”

“But that’s outrageous!” says the Eagle. “I refuse to play”.

“I know you are one of my top students but I want you to understand carefully: I have no problem with the game being “rigged” if the player knows in advance the cards are not properly shuffled. Think of it as an extra challenge – we already know it is possible to beat four-suit Spider Solitaire without boop if the cards are properly shuffled.”

It takes some convincing, but my students eventually agree to play the game out.

< several moves later >

  • Round 1: three Kings appear simultaneously
  • Round 2: A very awkward Q84KA84Q20 with lots of evens.
  • Round 3: three Threes
  • Round 4: four Fours
  • Round 5: at least I didn’t draw five Fives. But three Sevens and three Tens are awkward.

“You’re right,” says the Eagle. “You correctly predicted the game would be rigged. I’m not sure whether trips and quads in every round is a true indicator of difficulty and we haven’t even considered the permutation of unseen cards in the tableau but it is apparent someone did put in the effort to rig the cards”.

“Despite our best efforts we couldn’t win without the help of boop,” I say. “We obtained two empty columns at one stage and came close to completing the Heart suit. Pity that both Jack-of-Hearts were hiding behind two Kings in Column Four though.”

Hang on, I think to myself. Stockfish’s fishbowl has somehow moved right by a good half-a-meter when nobody was paying attention. I soon figure out this mischief was due to Ninja Monkey (thanks to his extremely fast metabolism and lightning reflexes he was able to avoid suspicion for quite a while). But at least I’ve worked out how the stockfish was able to ascend the mountain without violating the laws of physics.

The End

Artificial Stupidity in Chess

You may remember some time ago I discussed an algorithm for Spider Solitaire that is not very good: it simply outputs random moves. It turns out somebody did a much better job in the game of chess. Some dude designed no less than 30 Artificial Stupidities and organised a Tournament of Fools, and published a number of papers in SIGBOVIK. Ideas for weird algorithms include color preference (e.g. White prefers to play pieces onto light squares), random moves, blindfold algorithms (simulating a novice trying to play blindfold), algorithms based on mathematical constants like π and e, single player (pretending opponent will pass) and linear interpolation between Stockfish and some other lousy algorithm (e.g. choose Stockfish’s best move with probability p, lousy move with probability 1-p. But my favourite algorithm was the Mechanical 68,79,82,75 that proved a forced win for Black after 1 d2-d4?? a7xd4!! checkmate 🙂

You can watch all the fun in the video below:

I’m not sure if these ideas will be applicable to Spider Solitaire. Color Preference is easy since we can prefer to move red cards or black cards, and single-player is even easier given the nature of the game, but I am not aware of any equivalent of Stockfish. Mathematical constants should be easy but probably not very interesting. It may be possible to simulate a blindfold (human) player who struggles to remember every card, but I’m, not sure how to do that yet. And I don’t know of a (sensible) variant of Spider Solitaire where all the red cards are replaced with chess pieces. Since Western chess has Black vs White, it may be more appropriate to use Xiangqi, which has Red vs Black pieces. Perhaps something to think about for next time.

Thanks to my good friend Tristrom Cooke for the heads up.

Evaluating a Start Position

We now consider the following question: How can we evaluate a starting position? That is, if you are given an initial game state with 10 exposed cards how do we determine if the chances of winning are good, average or poor? Can we quantify our winning chances as a percentage (e.g. 58%)?

NOTE: evaluating a start position is useful since most Spider Solitaire implementations allow the player to abandon a game without counting it as a loss. But if you are serious about improving your game, I strongly recommend you never abandon games with a poor initial state.

A first thought may be to look for “features” of a game state. For instance suppose we are watching some top quality chess at an unhealthy time of the day. We might notice that

  • White has an extra pawn
  • The position is an endgame: both sides want to activate their king without fear of suddenly being mated.
  • Black’s rook and king are more active than their opposite numbers
  • Both sides have vulnerable pawns

Bear in mind we are only identifying individual features at this early stage. Eventually we may wish to formulate an overall assessment by combining these features somehow, but that comes later.

QUESTION: What are plausible features to use in an opening game state in Spider Solitaire?

How would you evaluate this starting position?

Avid readers of this blog (yes you!) would immediately identify “guaranteed turnovers” as a possible feature. In the above diagram you should be able to quickly identify 5 turnovers. Of course every man, dog and millipede on the planet knows that building in-suit is even more desirable. In this case we have Q-J in spades and 2-3 in clubs. Therefore we have 2 guaranteed suited turnovers (and hence 3 off-suit turnovers).

Finally we can look at rank multiplicity. All players know that having too much of one rank can be a problem, especially when the adjacent rank is in short supply. You don’t need a Ph. D. in economics to work out things are less than ideal when the Spider Solitaire gods have supplied five Jacks on the opening deal and there is little demand for them. For simplicity let us define the rank multiplicity as the count of the most frequent rank. For instance the above diagram has a rank multiplicity of 2 since we have two Threes/Deuces and no rank appears more than twice. In summary:

  • We have 5 guaranteed turnovers
  • We have 2 guaranteed suited turnovers
  • The rank multiplicity is 2.

There may be other features to consider, but we’ll keep things simple for now.

 Are these values good, bad, or average? It turns out one can use simulation to answer this question. For instance if I had nothing better to do, I could play 10 million games of Spider and compute the number of guaranteed turnovers should be 3.97 on average.

Of course the lazy solution is to write a computer program to do the simulation for me. The program can simply deal 10 cards, do the relevant calculations and then abandon the game. An even lazier solution is to copy the results from Steve Brown’s excellent book Spider Solitaire Winning Strategies. He got the following results:

Thanks to Steve N Brown …
For his excellent book
Spider Solitaire Winning Strategies

Looking at these graphs, I would immediately dismiss rank multiplicity as a useful feature (the entry for 5 is non-zero but is too small to be visible). After all more than 90% of games will have a value of 2 or 3! It is true that one can tweak rank multiplicity somehow (e.g. giving more weight to Aces and Kings which are the bugbears of most players), but I wanted to keep things simple for the time being. The important point is these quantities are easily obtained via simulation.

Suited turnovers is nice, but I think it’s more important to have many turnovers at the start of the game. In other words, quantity is more important than quality. In the above example, we have 5 guaranteed turnovers and 2 suited, both of which are above average. Hence if given a choice, I would take this position over a random position.

If you are a beginner, I would estimate that:

  • If you start with exactly 4 guaranteed turnovers, your chances of winning are average
  • If more (less) than 4 then your chances are above (below) average.

Of course if you lose every game at the 4-suit level then this rule only works when you have exactly 4 turnovers! So perhaps this rule is better suited to the 2 suit level, if you excuse the lousy pun. As you gain more experience, you would be able to tweak these guidelines. For instance, you might think that two suited turnovers is worth an extra non-suited turnover, etc.

That’s it for now. Happy Spider playing, and may all your builds be in-suit 😊