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!

Spider GM wins Connect Four!

Spider GM is off to a good start in Connect Four. He has won the first four games for a flawless victory (to borrow from the Street Fighter vernacular). His friend Ninja Monkey says three out of four games were ridiculously easy with a estimated equity 0.96 or better, but game 2 was a strange exception. The last ten cards from the stock were K2248K9264 which might explain a lot 🙂

Spider GM will continue to record results for the remainder of this month in order to settle a bet with a friend concerning the biasedness (or lack thereof) of i-Phone Spider Solitaire. For further details, please see earlier posts and references therein.

From previous experimentation SpiderGM expects the equity to be between 50% and 100% for each game, since each game is supposed to be winnable (each daily-challenge deal has the option of “show me how to win”, so users would be 80,73,83,83,69,68 off if a game turned out to be unwinnable). The average would be much lower if the games were random. Spider GM will also expect to accumulate plenty of red in the latter half of the month. Fortunately the game of Connect Four is considered won as soon as one side achieves 4 in a row, even if the opponent “goes perfect” during the remainder of the month

september_game_win

Connect Four and Spider Solitaire

Every man dog and millipede on the planet has heard of Connect Four, a well-known two-player game by Milton Bradley. The objective is to line up four pieces of your colour horizontally diagonally or vertically. Unfortunately it is not played in serious competition these days, mainly because the game has been solved. With perfect play by both sides the first player wins.

The solution was found independently by James Dow Allen and Victor Allis (independently) in October 1988. The first player must start in the middle column. If she plays adjacent to the middle column then it’s a draw. Playing anywhere else even loses. Furthermore, the first player requires all 21 discs to force a win if a perfect opponent puts up maximum resistance. For a detailed analysis of the game please check out this excellent video  by Numberphile.

However, I believe Connect Four has not been solved after all, because everybody has been playing it the wrong way.

Consider the board state below. Before reading on, can you predict where the next two discs should be played?

connect4

A cursory examination shows that Yellow threatens to win on the left-most column. Moreover, Yellow has played 8 pieces but Red has only 7. Therefore it is Red to play. Clearly Red must block the threat of vertical Connect-Four. This in turn threatens a diagonal Connect-Four so Yellow’s next move is also forced.

But if you examine the board carefully, you will notice each column is labelled with one of the seven days of the week. Moreover, only 30 cells are marked with numbers but the others are empty. Not surprisingly, the board represents the calendar month for September 2019, which is further corroborated by the text above the board.

It is not hard to guess that Spider GM is going to play a game of Four-Suit Spider Solitaire on every day of this month. Every yellow disc represents a victory, and every red represents a defeat. Spider GM is only concerned with winning the game regardless of the number of moves or time taken to complete it. Of course Spider GM will play without undo. Four in a row still wins the game (but Spider GM can continue to play the remaining days just to fill up the board and see what it looks like). The current position shows a hypothetical game state after the 15th of September.

This completely changes the dynamics of Connect Four. For instance, odd and even threats still exist but here they refer to whether the cell contains an odd or even number (instead of what row the cell lies in). Going back to the example, Spider GM has an even threat on Sunday the 22nd. Unfortunately the next game will be played on Monday the 16th. Therefore the next move will either be a Red or Yellow disc on the cell numbered 16. In other words Spider GM has to wait for a whole week before his threat of winning on the Sunday column comes into play. Of course if Spider GM does win the battle on the 22nd of September then he also wins the war, unless Daily Challenges manages to build an unlikely winning horizontal Connect Four before that date.

Well done if you correctly predicted the next two moves to be “cells 16 and 17, either red or yellow”.

It is easy to see that Connect Four is now an unsolved game again, since the colour of each cell depends on the result of a single game of Spider Solitaire, and not even the Spider GM knows the perfect strategy for the latter. This I believe is the way Connect Four should have been played all along. So if you have enough spare time on your hands to play one game of Spider Solitaire per day and wish to make Connect Four great again then you know what to do 😊 Good luck.

Bring it on

One of my friends has challenged me to repeat my Ninja Monkey experiment for September 2019. Those who follow my Facebook page will know the good goss, but here it is in a nutshell:

  • I have Spider Solitaire on my i-phone.
  • This software comes with “daily challenges” where a fresh deal is provided for every day, akin to a random number generator – thus if you enter the same “seed” of e.g. 15 August 2019 fifty times you will play the same hand fifty times etc. NB: Players are restricted to any day between 1st of previous month and today.
  • However, I believe the RNG is not uniform and if we choose any month then games corresponding to later days are harder than games corresponding to earlier days
  • This can be done via statistics: choose 2 days of the same month at random and let Ninja Monkey compute the “equity” of games corresponding to both days. The probability that the later game is harder than the earlier game should be 50%,
  • but my actual probability was significantly higher (p-value < 05) when I tested the games in July 2019.

I am now going to repeat the same experiment for September, and I am laying my friend 4:1 odds in his favour that I will not get the same result as my July data.  My friend told me that twenty 66,85,76,76,83,72,73,84 tests should give one significant result (as if I didn’t already know!). But I was definitely not cherry picking. Even if I am wrong, I will have no regrets. To put it in Poker terms, my experimental results force me to call all the way to the river and if I am beat … then I am beat. We are using happy stars as currency, so it’s not as though my credit card details are at stake.

sept_calendar

Bring. It. On.

The World’s Worst Math Teacher (another short story)

“Another one of life’s disappointments.”

“What’s wrong?” I ask.

“Marking assignments, the bane of every teacher,” growls Ms. Spider, as she angrily scrawls the word “DREADFUL” on a sheet of paper. “This goose just divided by zero.”

I’ve always enjoyed math, but I am all too aware that it represents a bugaboo for many ordinary folk. Not everybody can have higher than average IQ and not everybody can play piano and solve Rubik’s Cube at the same time. I agree we have to Make Math Great Again.

“I s’pose I could improve my presentations skills or learn Statistics 101,” admits Ms. Spider.

“I confess I never studied stats at uni,” I respond. “I had to pick it up all by myself.”

“Learning stats 101 sounds too much like work. Surely there must be a better way.”

“You could make the exams and homework easier,” I suggest.

“We can’t make it too easy,” responds Ms. Spider. “I’m sure the good students wouldn’t mind an extra challenge or two,”

I steal a glance at the goose’s assignment. Yes the goose is below average, but one of the assignment questions are badly worded. Another question has kilometres as a typo for metres, and I have to suppress a chuckle. I can see why some of Ms. Spider’s students call her the WWMT.

“Actually,” says Ms. Spider, “I was toying with a more radical solution”

“Which is?”

“We could give different exams to different students”

“What a revolutionary idea!” I exclaim. “Nobody has ever thought of this before!”

“From each according to his abilities … “

“From each according to his needs,” we chant in unison.

I am impressed: this Spider is clearly well-educated, not just in mathematics. She knows her clichés and sayings.

“Does that mean,” I ask, “if an awesome student correctly answers 40 assignment questions in a row then he will get a very difficult exam?”

“Exactly.”

“Hang on, what if an awesome student deliberately flunks the assignments …”

“Well … we could give the exam less weight than assignments,” the Spider responds somewhat nervously. “Then there is no advantage to tanking the assignments.”

“That’s Dandy!”

“For this to work,” continues Ms. Spider, “we have to come up with some way of measuring the difficulty of certain questions.”

“I understand,”

I mull over this for a while. We all know that students can be graded according to some chosen system. For instance, a math student can be Outstanding, Exceeds Expectations, Acceptable, Poor, Dreadful or Troll. But how can we grade certain questions?

The Spider writes two math questions on a sheet of paper:

mathquestionz

“Which of these problems is harder?” asks Ms. Spider.

“I think both are equally easy. After all, I participated in the International Mathematical Olympiad many years ago.”

Somehow, I think that was not the answer Ms. Spider expected.

Behind us, a monkey, eagle, mouse, elephant, lion and jackal are enjoying some Texas Holdem. As usual, the monkey has squandered away all his chips early, and the Eagle is schooling the rest of the field, having accumulated more than half the chips in play. The Spider eyes them warily: clearly they should not be privy to our discussion.

“You see,” says Ms. Spider. “Sometimes I find it hard to judge the difficulty of a single question. For instance, I expect problem X to be easier than Y, but for some reason the reverse holds when I mark the assignments.”

I mull over Ms Spider’s words. I am not really in a position to judge, given I have never marked any student assignments.

“I have an idea,” says Ms. Spider. “Let’s draw a table”

pic1

“For simplicity,” says Ms. Spider. “Let’s assume each question is either marked correct or not correct, hence there are no partial marks. I use blank instead of 0 for ease of reading. Sam is an awesome student since she answered most questions correctly. Owen is a Stupid student because he only scored 2 out of 9. Each individual is represented by a single row.”

“Okay.”

“But there is no reason we can’t do the same with columns if you pardon the double negative. For instance, only six people solved problem 8 but nine solved problem 9. Therefore problem 9 is harder than  problem 8 …”

“So even if you don’t understand the questions themselves you can still say things like Debbie is better than Anna”

“Exactly,” replies Ms. Spider.

“With 18 students and 9 problems, you don’t have a lot of data”

It’s a stupid observation, I know – but I am only trying to buy time as I try to digest her ideas.

“Well, the same logic applies if we had 1800 students and 900 problems.”

“I think I understand,” I say. “It’s like some kind of Mechanical Turk. Previous students have tried these questions (and of course you don’t have to pay them to do these exams!), so you can work out which questions are easy or hard.”

“Wasn’t the Mechanical Turk some kind of fake chess-playing machine by Wolfgang von Kempelen? What a disgraceful idea! I would never try to cheat chess players like that”.

Okay, didn’t see that one coming. We need to agree on a definition of Mechanical Turk.

“Do you think your students will eventually find out their exam papers are different?”

“That shouldn’t be an issue,” says Ms. Spider, as she squirms in her seat. “If a poor student finds out, he has no reason to complain. If a good student finds out then deep down in his heart he already knows he is better than the poor student, so the exam result doesn’t matter.”

Somehow I think her logic is very, very, unsatisfactory. But I do know that many of the greatest insights precisely come from those who are willing to suggest ideas that sound utterly outrageous. For instance Rivest, Shamir and Adleman are your average computer scientists, but with a bit of luck they might one day become famous, known to every student of cryptography. So I should cut her some slack.

In fact, I am more than looking forward to the results of her revolutionary teaching methods. After all, I’m not the teacher and I don’t set the exams. I was especially careful not to suggest any drastic ideas of my own. If the radioactive 83,72,73,84 hits the fan and grows to fill the size of the entire house then I am more than happy to watch, knowing my 65,82,83,69 is fully covered.

Bring. It. On.