10

I have a question about a weird, unknown (and possibly impossible) game a friend of mine has taught me. It is a solitaire game that's played with a regular deck of 52 cards but it is suspiciously difficult to beat. What's more, neither my friend nor I were able to find ANY reference to it in all the Internets.

I am aware that the question is not necessarily interesting to anyone but my friend and I, but I was wondering if someone would be willing to help me calculate the odds of beating this game? I think it would help us decide if this is a real game or if it's just a weird multi-generational prank my friend's father (who taught him the game) is pulling. My current grasp of math and probability does not allow me to undertake the project alone.

Here are the rules:

Nine columns of three overlapping face up cards are laid on the table. The face value of each card is used to calculate a sum with the two closest cards (either on top or on bottom) on the column and the last card can "wrap" with the bottom card (the first one played on the column) to achieve a certain sum if needed. Face cards all are worth 10 points.

Each turn you go to the "next" column (cyclically), place a card from the deck on the top of that column, and then, in the same column, look for potentially three cards one after another (two at the top and one at the bottom, and one at the top and two at the bottom, are also valid) which make up 9, 19 or 29, then, if found, remove those cards and put them at the bottom of the deck, in the same order.

If any other valid combinations are revealed after the removal of a triplet of cards from a column, they are also removed and placed back at the bottom of the deck.

If all the cards of a column are thus picked up, the column is eliminated.

The theoretical goal is to pick up all nine columns before the deck runs out. If the deck does run out, it's game over.

Now... my friend has played thousands of games and has never beat the game even once. He holds on to it only because his own father boasts that he finished it twice in thirty years of playing it... But it really sounds fishy.

Can anyone help?

L. Scott Johnson
  • 11,612
  • 1
  • 21
  • 49

2 Answers2

13

Depending on the deck's starting arrangement, your game either ends in a win or loss, or it never ends. To estimate the probabilities, I simulated 10^8 games (using the Python program below), under two different rules:

  1. After a card is added to a column, only the three triplets (using wrap-around) that include the added card are to be considered for removal.
  2. After a card is added to a column, all triplets (using wrap-around) are to be considered for removal.

Following are the results:

                      with rule (1)              with rule (2)
                   --------------------      --------------------           
est.P(win)    =    0.000040 +- 0.000001      0.000043 +- 0.000001
est.P(loss)   =    0.999921 +- 0.000002      0.999914 +- 0.000002
est.P(cycle)  =    0.000039 +- 0.000001      0.000043 +- 0.000001

This suggests that your friend's father, in order to win twice in 30 years, would have had to play about 2/(.00004)= 50000 games in that time, which is more than 4 games per day.

It's interesting that some rare arrangements of the deck allow a win in less than 100 moves, while others (also rare) require more than 1000 moves to win! The games that don't end can be interesting too, as they may not begin cycling until after several hundreds of moves, and the cycles have various lengths (e.g., 51, 96, ...).


Python 3 program (you can try it online, but it takes about 50 seconds for 10^5 games. I ran my 10^8 games using pypy, which is very must faster, but still took about 2 hrs.):

import random

deck0 = [i+1 for i in range(9)]4 + [10]16

def game():

return the list of final columns ( or None if cycle, else [] if win, else nonempty if loss)

deck = deck0[:]
random.shuffle(deck)
#print(f"starting deck = {deck}\n")

# with cards from the deck, make 9 cols of 3 cards each 
cols = []
for i in range(9):
    cols += [deck[:3]]
    deck = deck[3:]

nmoves = 0
max_nmoves = 10**4  # assume cycling if nmoves > max_nmoves  (confirm this works in separate testing)
#print(f"deck = {deck}\ncols = {cols}\n")

c = -1    
while cols and deck:

    nmoves += 1 
    if nmoves >= max_nmoves:
        return None  # signal that it's cycling

    # make the next col (with wrap-around) the current col
    c = (c + 1) % len(cols)

    # move one card from deck to current col
    cols[c] += [deck[0]]
    deck = deck[1:]

    done_col = False  # a flag for when finished processing the current column
    while not done_col: 
        # in current col, remove the first "good" triple (if any) to the deck (good := sum ends in 9)
        l = len(cols[c])
        if l < 3:
            break
        else:
            found_triple9 = False  # a flag for when a valid triple is found anywhere in this column
            #for triple_indices in [[l-3, l-2, l-1], [l-2, l-1, 0], [l-1, 0, 1]]:   #<-- rule(1)
            for triple_indices in [[i, (i+1) % l, (i+2) % l] for i in range(l)]:   #<-- rule(2)
                triple = [cols[c][i] for i in triple_indices]
                if sum(triple) % 10 == 9:
                    found_triple9 = True
                    # remove the triple from the column
                    cols[c] = [e for (i,e) in enumerate(cols[c]) if i not in triple_indices]
                    if cols[c] == []:  # delete the column if it's empty
                        del cols[c]
                        done_col = True
                        c -= 1  # <-- column-index adjustment due to deleting a column (omitted in previous version)
                    deck += triple
                    break 
            if not found_triple9:
                done_col = True
    #print(f"nmoves={nmoves}\ndeck={deck}\ncols={cols}, c={c}\n")   
return cols

import math

nsamp = 10**8 wins = 0 losses = 0 nonstops = 0 for i in range(nsamp): cols = game() if cols == None: nonstops += 1 elif len(cols) == 0: wins += 1 else: losses += 1

p_win = float(wins/nsamp) p_loss = float(losses/nsamp) p_cyc = float(nonstops/nsamp) print(f"wins = {wins:>10}; est.P(win) = {p_win:8.6f} +- {1.96math.sqrt(p_win(1-p_win)/nsamp):8.6f}") print(f"losses = {losses:>10}; est.P(loss) = {p_loss:8.6f} +- {1.96math.sqrt(p_loss(1-p_loss)/nsamp):8.6f}") print(f"nonstops = {nonstops:>10}; est.P(cycle) = {p_cyc:8.6f} +- {1.96math.sqrt(p_cyc(1-p_cyc)/nsamp):8.6f}") print(f"total = {wins + losses + nonstops:>10}")

Note: The program allows simulating either of the rules (1) or (2) by simply commenting out with a "#" the line of code that doesn't apply. (Rule (2) is now the default, but takes almost twice as long to run.) The rules as implemented in the program completely determine the game's outcome once the deck is shuffled.

r.e.s.
  • 246
  • 2
  • 4
1

I've played this game all my life (60 yrs). It was passed on from my great grandmother, to my grandmother, to my mother and then to me when I was a wee lad. We start with 7 columns of three and then play as you describe. One year I played many games daily and won probably 20 times that year. Now I play maybe once a week and it's been over 10 years since my last win. My wife won the first time she played (impossible odds) and never again in 36 yrs (odds evening out). I only continue to play if I pick up at least two columns after the initial 7 columns of three are dealt out. I've won by picking up no columns at the beginning, or only one, but I find I get a better chance of winning if I at least pick up two. I've even picked up 6 of the 7 columns at the beginning. Every time I've gotten down to one column, I've won. We had no name for it except "9, 19, 29". I sure would like to know if there is an official name for it. Because it is so hard to win, it is exhilarating when I do.