Math Gurus: Probability & Statistics of Solitaire?

Chronos, I guess lousy code is contaigious! :smiley:

<< Kesagiri, the link I got that off of was discussing Freecell, not Klondike. >>

And those are very different; in Freecell, there are four rows of 6 cards and 4 rows of seven cards; if the first row and the fourth row are interchanged, it’s the same deal. Also, not sure whether that number of deals is just that Freecell has set up a fixed number of hands arbitrarily. I don’t think that’s all possible hands if you were dealing the deck yourself; that’s just the selected numbered hands that the computer-game authors allow, so that you can replay a hand by recalling the number of that hand. (The game instructions for Freecell claim that all games are winnable.)

But, of course, in Freecell, you can see all the cards. You know when to make bizarre plays. In solitaire, you can’t see all the cards, and therefore you don’t know (most of the time) when to make a bizarre play.

Kesagiri: << Wouldn’t his algorithm correspond to a strategy? >>

Yeah, OK, I can see I was using sloppy language. And I think our conversation may be mostly semantics: I was distinguishing between the algorithm and a strategy. What I meant is that, generally speaking, the rules of solitaire totally dictate the play. You turn over a card, there is either a legitimate play or there isn’t. And usually there is only one legitimate play, not two or three or six. Thus, you can play “mindlessly” or write a simple computer algorithm that makes each play.

If you wanna call that a strategy, OK. I’ve been thinking of that as the rules of the game, not the strategy. Example: in chess, the pieces move a certain way. Those are the rules. When you sit down to play chess, the opening move by white could be any one of about 20 moves. When you sit down to play solitaire, the opening moves are pretty much set. There’s very little choice. It would normally be considered “weird” not to make a play, and there is normally only one way to make a play. I’m saying there is a sort of algorithm to playing solitaire, dictated by the rules, that leaves a limited number of moves.

I’ve been using the term “strategy” to mean a decision point at which the play of cards is not mindless. The algorithm does not cover all cases. We’d already talked about situation where there are two black 9’s on which to play the red 8, and similar.

When I’ve been using the term “strategy”, I have not meant the game-theoretic use of the word but the common use. The strategy that says, try to uncover the largest pile of unknown cards first; or hold up a play to the ace pile because blah blah. I confess, I didn’t even think of having memorized the order of the deck as you sort through, so that you would know whether to make an “unusual” play. My assumption is that at almost every moment there is a “usual” play; unlike chess, where there are a small number of times when there is a “usual” or “required” play. The fact that one can even think of a play as “usual” or “unusual” is confirmation of what I’m talking about.

My assumption is still that “unusual” plays will not affect the overall winnabilty of solitaire. If you have two competent players, playing the same games, I aruge that they will tend to win or lose in synch; one player will not have an advantage over the other because of thinking deeper. And that’s the way I read what sdim was asking.

That is, the basic competent approach to play will include things like trying to get through the largest piles first (because they’ll have the highest probability of having the most usable cards), etc. I think that some of the casino games REQUIRE that a card be played on the ace pile if it can be. And my hypothesis is that added degrees of subtlety to this basic approach will not impact the outcomes.

If you will: in chess, added degress of subtlety clearly affect the outcome. In tic-tac-toe, if both players know the basic strategy/algorithm, added degrees of subtlety won’t help; the winning probability is zero (all games end in ties.) I contend solitaire is closer to tic-tac-toe in that regard than to chess.

Now the easy way to test my hypothesis is to get some others to play and tell us their statistics. (I don’t have solitaire on my computer at work, so I can’t help, and I don’t know if my home game keeps stats.) Manlob’s made a start, but those were computer run.

I think Sdim has given us the rules he’s been using (since there are lots of variants), let’s copy those and go to it.

Dex,

By strategy I mean that the player may have already run through the deck once and knows where each card is in the draw pile (sorry I don’t know the names). Then when going through again you may see a playable card, but might forgoe that play to reach and even more disirable card to play. See Chronos’ statements on this a few posts up. The “mindless” (perhaps simple is better) strategy would be to just play a playable card as soon as it comes up. A more sophisticated strategy would be to try and remember what you have seen previously, try to do some probability calculations, and determine whether or not to play a card at a given time. In some cases it might be the only playable option, other times you might have a choice.

Why would they have such a rule, if it has very little effect on the winnability?

Kesagiri: OK, then we’ve got definitions agreed.

Chronos: To avoid conflict later? Remember that in the casino games, you pay an amount for the deck and you win an amount for each card on the ace pile. If someone could put a card on the ace pile but doesn’t, and covers it with a lower-card-opposite-color, then they could complain later that they could have earned the money for it.

I don’t know, I’m speculating. And I confess, my notion that “strategy” makes little difference is based on the way most people play – what I called mindless and what Kesa has more tactfully called “simple” or straight-forward.

The other way to test the waters would be to set up a few hands, and have some people play them one way (straight-forward) and other play them with great thought (memorizing order of deck, etc), and see how the results come out.

In short, the numbers preclude a mathematical solution, so I am suggesting a empirical approach.

Chronos said “Why would they have such a rule, if it has very little effect on the winnability?”

Funny but I think it is to prevent a certain strategy.

Imagine a scenario where you have the 3 of hearts as a card in one of the seven piles. Also assume that the Ace and two of hearts have been played. Under the rules you would have to play the three to the two and score points.

Now let’s assume that you have yet to see either black ace or either black two and that you are fairly early in the draw deck. If you play the three to score, then draw a black two before a matching black ace, you will have to discard that two. Having the option of not playing the three give you the opportunity to use it to hold the two in anticipation of getting the ace at some point.

If either two never comes up then you have lost nothing.

If one or both aces come up before the twos, you have lost nothing.

If the 2 comes up before the ace and would have been unplayable otherwise, you have gained the value of the two, plus whatever other upside that affords.

If the 2 comes up but the ace never does, then you have lost the value of the 3 (and any playable cards under it)

When playing on the computer under Vegas rules, I find I make more money by playing a card for a score as soon as I can, but although I can’t prove it, I think I would win fewer games (play all cards on the aces) using that strategy.

But I don’t know if the difference is material, so this could be one of the things Dex can throw out as immaterial.

Dean

an addendum - if the casino has the rule that forces the play on the ace as soon as possible, then my belief that I make more money by following that strategy must be incorrect. I would imagine the casino knows what such a rule does to the take, and would adjust accordingly.

I don’t know what the Vegas rules are, but keep in mind we are talking strictly about winning the game as a whole. Such a rule could clearly have an effect on how much money you win in a given game; I’m with Dex, though, in thinking such a rule won’t have much effect on actually winning the game.

The program plays by the simpliest possible strategy- it never passes up an opportunity to move, and does no planning ahead. So its winning percentage is about what a person should get if he plays mindlessly. For this strategy, it was easier to program it than to play a bunch of games.

Anyone who thinks strategy makes no difference is mistaken. I played some games by concentrating much more than in a casual game and won 10 out of 21 games for 48%. This is with Microsoft Solitaire drawing 3 cards at a time. The key is to ignore most playable cards, and only play the ones you really need or which set up the hand so the cards you need come up next cycle through the hand. Unfortunately I didn’t know it was possible to bring cards back off the aces pile until the 20th game, so the potential winning percentage is bound to be even higher. In both games that I knew of this rule, bringing cards off the aces pile saved me from losing. Playing with this much concentration, isn’t a whole lot of fun, so I don’t plan on continuing more trials, but it seems like it should be possible to win more than half the time.

There is an upper limit to winning percentage. A simple estimate can be found by just looking at the opening deal. If after the opening deal, a pile contains a card above what is needed to move this card then there is no possible way to win. For example, if a pile initially contains (starting from the face up card): Ace of hearts, Ace of spades, 6 of clubs, 7 of hearts, 7 of diamonds, and 3 of clubs. There is no way to win. This is because, the 6 of clubs can only be moved off the pile onto a red 7 or onto the aces pile. Both red 7’s are beneath the 6, and with the 3 of clubs also covered, the pile on ace of clubs will never reach 5 of clubs so that 6 can never be moved. Similarly, multiple cards can also combine to block the cards the other needs to be moved. I did a Monte Carlo simulation of millions of opening deals, it looks like 2.1% of games are hopeless because of this.

Another case for a futile game is not being able to play anything from the starting hand. 0.75% of the time absolutely nothing can be done from the beginning. 6.67% of the time there is no opportunity to play from the hand (after being able to move around some of the starting face up cards). Although there is some overlap between not being able to play from the hand (6.67%) and the hopeless situation described above (2.1%), it looks like about 9% of the games are doomed from the start. There are certainly other impossible situations, but they get increasingly complex to identify when moves are possible prior to losing.

<< Unfortunately I didn’t know it was possible to bring cards back off the aces pile until the 20th game, so the potential winning percentage is bound to be even higher. >>

Yeah, we’d better agree on rules before we start collecting Monte Carlo samples!

It’s interesting that your play with concentration did produce a much higher winning streak. Of course, with only 50 games, that could be sheer dumb luck. My hypothesis has been that a deeper, more strategic player will not have a very large edge (a few percentage points, perhaps) over a standard player. Your statistic tends to invalidate my hypothesis; I guess I’d like to see more evidence. Sigh. I suppose this means a weekend at solitaire.

I find it also interesting that your simulation gives only 2% as the number of games that are unwinnable on account of a “buried” card being unplayable. I guess if we could quantify all unwinnable situations, and estimate their occurence, we could solve the initial problem.

Depends. In addition to the situations which are totally hopeless, there’s also the situations where the a priori “best strategy” would not lead to a win, but a nonobvious, “wrong” strategy, by luck, would. It seems to me that it’s not meaningful to compare a player to the results of an omniscient strategy.

I did my bit. I played ten games last night, mostly straightforward (no attempt to memorize the deck, etc)… and I lost all ten. Then I gave up in disgust. So much for my willingness to participate in a noble experiment for the glory of the science of probability.

CKDextHavn, don’t give up so soon, you are the only other doper providing any data. If you play without out concentrating, you can expect to win 7.5% of the time (this assumes you don’t bring down cards from the aces or split sequences, like the pre-Microsoft rules), so losing 10 straight should not be discouraging. To win more than half the time you need to pay attention to the hand. No need to memorize- just lay out real cards to match the computer hand, or just play analog solitaire.

Dealing 3 cards at a time is frustrating to plan out, so try playing with dealing one at a time instead. I just tried 15 games this way, won 67% of the time, and I am sure winning percentage could be raised with more thought. Dealing three cards at a time could give no better a winning percentage than one at a time dealing. Although I was winning only 48% of the time when dealing 3 at a time, most of the games I was losing were because of buried facedown cards rather than not being able to access cards from the hand. So I think the winning percentage of 3 and a time and 1 and a time dealing may be fairly close together. That 48% with 3 at time dealing was before finding out about bringing cards back down from the aces, and using that extra rule will only raise winning percentage.

Huh? Dealing one card at a time will of course give a better winning streak than dealing three cards at a time, unless you have a rule about only going through the deck once, for instance.

The idea of gathering data was that we all use the same rules. Otherwise, the data is useless.

I was figuring that if sdim’s 15% winning rate was in line with national average, that I’d win at least one game in ten. I didn’t so, I gave up. I mean, after all, it’s a borrrrrring game.

You wouldn’t say such things about me if you knew I grew up in Lake Woebegone! :wink:

**

It’s only boring because you’re playing it on the computer. I have it on my Palm… I spend a lot more time in the bathroom nowadays!

If anyone still cares, I am now at [sup]21[/sup]/[sub]137[/sub] for a winning percentage of 14%.

Still in the groove…