10 million SET games simulated using “Random among available Sets”

The tabulated  simulation results.

Total games played=10000000, total rounds=259703553,
took 6916 seconds. Games that never needed 15 cards
on the table: 3141851 (31.4 percent of all games).
Games where no cards remain on the table at the end:
121973 (1.2 percent of all games).
Selection mode="Random among available Sets" (2),
seed=473029114

In deck |   Set  | NoSet | Set:NoSet for 12 | Avg # of Sets
--------+--------+-------+------------------+-------------
     69 |9676254 |323746 |      29.9:1      | 2.78
     66 |9468978 |527296 |      18.0:1      | 2.53
     63 |9374512 |619607 |      15.1:1      | 2.44
     60 |9337376 |655619 |      14.2:1      | 2.40
     57 |9325431 |667384 |      14.0:1      | 2.39
     54 |9320318 |672271 |      13.9:1      | 2.38
     51 |9317661 |674862 |      13.8:1      | 2.38
     48 |9313410 |679052 |      13.7:1      | 2.38
     45 |9311461 |680896 |      13.7:1      | 2.37
     42 |9309600 |682694 |      13.6:1      | 2.37
     39 |9305677 |686616 |      13.6:1      | 2.37
     36 |9300715 |691445 |      13.5:1      | 2.37
     33 |9299554 |692641 |      13.4:1      | 2.36
     30 |9298495 |693439 |      13.4:1      | 2.36
     27 |9295213 |696757 |      13.3:1      | 2.36
     24 |9293950 |698209 |      13.3:1      | 2.36
     21 |9294919 |697063 |      13.3:1      | 2.36
     18 |9293365 |698576 |      13.3:1      | 2.36
     15 |9290798 |701096 |      13.3:1      | 2.36
     12 |9291109 |700790 |      13.3:1      | 2.36
      9 |9292546 |699488 |      13.3:1      | 2.36
      6 |9291528 |700243 |      13.3:1      | 2.36
      3 |9291959 |699845 |      13.3:1      | 2.36
      0 |9255777 |736580 |      12.6:1      | 2.36

In deck |   Set  | NoSet | Set:NoSet for 15 | Avg # of Sets
--------+--------+-------+------------------+-------------
     69 |      0 |     0 |        oo:1      |   -
     66 | 320020 |  3726 |      85.9:1      | 3.33
     63 | 525141 |  5881 |      89.3:1      | 3.34
     60 | 618483 |  7005 |      88.3:1      | 3.35
     57 | 655439 |  7184 |      91.2:1      | 3.36
     54 | 667158 |  7411 |      90.0:1      | 3.36
     51 | 672205 |  7476 |      89.9:1      | 3.36
     48 | 674801 |  7537 |      89.5:1      | 3.35
     45 | 678947 |  7643 |      88.8:1      | 3.36
     42 | 680833 |  7706 |      88.4:1      | 3.35
     39 | 682693 |  7706 |      88.6:1      | 3.34
     36 | 686483 |  7840 |      87.6:1      | 3.35
     33 | 691480 |  7804 |      88.6:1      | 3.34
     30 | 692380 |  8065 |      85.8:1      | 3.34
     27 | 693475 |  8030 |      86.4:1      | 3.34
     24 | 696946 |  7840 |      88.9:1      | 3.34
     21 | 698032 |  8017 |      87.1:1      | 3.34
     18 | 697022 |  8059 |      86.5:1      | 3.33
     15 | 698529 |  8106 |      86.2:1      | 3.33
     12 | 701101 |  8098 |      86.6:1      | 3.34
      9 | 700925 |  7965 |      88.0:1      | 3.33
      6 | 699225 |  8229 |      85.0:1      | 3.33
      3 | 700276 |  8196 |      85.4:1      | 3.33
      0 | 700398 |  7637 |      91.7:1      | 3.33

In deck |   Set  | NoSet | Set:NoSet for 18 | Avg # of Sets
--------+--------+-------+------------------+-------------
     69 |      0 |     0 |        oo:1      |   -
     66 |      0 |     0 |        oo:1      |   -
     63 |   3726 |     0 |        oo:1      | 5.32
     60 |   5881 |     0 |        oo:1      | 5.33
     57 |   7004 |     1 |    7004.0:1      | 5.34
     54 |   7185 |     0 |        oo:1      | 5.37
     51 |   7410 |     1 |    7410.0:1      | 5.36
     48 |   7476 |     1 |    7476.0:1      | 5.36
     45 |   7538 |     0 |        oo:1      | 5.35
     42 |   7643 |     0 |        oo:1      | 5.36
     39 |   7705 |     1 |    7705.0:1      | 5.37
     36 |   7707 |     0 |        oo:1      | 5.35
     33 |   7839 |     1 |    7839.0:1      | 5.32
     30 |   7804 |     1 |    7804.0:1      | 5.31
     27 |   8066 |     0 |        oo:1      | 5.34
     24 |   8029 |     1 |    8029.0:1      | 5.35
     21 |   7840 |     1 |    7840.0:1      | 5.31
     18 |   8018 |     0 |        oo:1      | 5.32
     15 |   8059 |     0 |        oo:1      | 5.31
     12 |   8103 |     3 |    2701.0:1      | 5.31
      9 |   8100 |     1 |    8100.0:1      | 5.32
      6 |   7966 |     0 |        oo:1      | 5.30
      3 |   8229 |     0 |        oo:1      | 5.31
      0 |   8190 |     6 |    1365.0:1      | 5.31

In deck |   Set  | NoSet | Set:NoSet for 21 | Avg # of Sets
--------+--------+-------+------------------+-------------
     69 |      0 |     0 |        oo:1      |   -
     66 |      0 |     0 |        oo:1      |   -
     63 |      0 |     0 |        oo:1      |   -
     60 |      0 |     0 |        oo:1      |   -
     57 |      0 |     0 |        oo:1      |   -
     54 |      1 |     0 |        oo:1      | 5.00
     51 |      0 |     0 |        oo:1      |   -
     48 |      1 |     0 |        oo:1      | 6.00
     45 |      1 |     0 |        oo:1      | 9.00
     42 |      0 |     0 |        oo:1      |   -
     39 |      0 |     0 |        oo:1      |   -
     36 |      1 |     0 |        oo:1      | 7.00
     33 |      0 |     0 |        oo:1      |   -
     30 |      1 |     0 |        oo:1      | 9.00
     27 |      1 |     0 |        oo:1      | 8.00
     24 |      0 |     0 |        oo:1      |   -
     21 |      1 |     0 |        oo:1      | 7.00
     18 |      1 |     0 |        oo:1      | 10.00
     15 |      0 |     0 |        oo:1      |   -
     12 |      0 |     0 |        oo:1      |   -
      9 |      3 |     0 |        oo:1      | 8.67
      6 |      1 |     0 |        oo:1      | 7.00
      3 |      0 |     0 |        oo:1      |   -
      0 |      0 |     0 |        oo:1      |   -

6 responses to “10 million SET games simulated using “Random among available Sets”

  1. Why doesn’t:
    NoSet (for n cards) = Set + NoSet (for n+3 cards) ?

    • Hi Brett,

      Great question! The answer is that in most cases you can get to a certain point “from two directions” – either by encountering a “no set” condition and adding three cards, or by finding a set and removing three cards from the table. This is the reason I chose to tabulate the results for cards left in deck, as opposed to “round of play” – I think it makes discussions like this one easier to have.

      For example, when there are 57 cards left in the deck, there are 655439 cases where a set is present with 15 cards on the table, and 7184 cases of “no set”. In these 7184 cases, three cards are added. So now we should look at the row with 54 cards left in the deck, and 18 cards on the table. Here we see 7185 cases where a set is present, and zero cases of “no set”. The one extra case (7185 – 7184) comes from the case of 21 cards on the table and 54 cards left in the deck. From that case, there was a set found, so when that set is removed there are now 18 cards on the table, and still 54 cards left in the deck.

  2. Thanks for the response (and good explanation)! Are you ready for my next question?

    What exactly is it about your “1st set found” that makes it less random?
    In other words, what do you think makes the results noticeably different between your “1st set found” and “random among available sets”?

    In my own simulation, I systematically check each combination of 3 cards until I find a set, or until I’ve exhausted all combinations currently on the table. Before I deal out the initial 12 cards, I randomize the order of the 81 cards in the deck. So, my theory is that even though I’m always selecting the first set found, which set that is, among the group of available sets, is as random as we can get.

    My results happen to fall in between your two results, a little closer to “first set found”.

    • Yes, another great question! I don’t have a good explanation why there is a difference.

      My simulation works like yours – I shuffle the deck, and then I put out 12 cards from it. I then check each combination of 3 cards for a set, just like you do. In the first round (with 69 cards in the deck) I agree that any choice of set is as random as it gets. This shows in the results for the 3 different strategies – the values for when there are 69 cards on the table are virtually identical.

      The difference only shows up in subsequent rounds. This is where things cease to be totally random, since we remove sets in a certain way (and because we remove sets, not just three random cards). Suppose we lay out all the cards on the table in one single row from left to right (as opposed to the more common 3 by 4 matrix). In the “first found set” case, in my search algorithm, it is equivalent to always preferring to pick sets “as far to the left” as possible, i.e. picking the set whose left-most card is as far to the left as possible. In the “random among available sets” the difference is that I find all the possible sets in the row, and then randomly pick one of those.

      Somehow, by systematically picking sets “as far to the left” as possible, the probabilities are altered a little bit. Even though I can’t explain why that happens, I do think that “first found set” is not as good of a model of real game play as the “random among available sets” is.

      Another question in the same vein is: why is there such a steep change in probability for the first 4 rounds, and then it levels out? Why doesn’t it change linearly instead? I can’t explain that either, but I would love to hear theories or explanations for both of these questions.

  3. My theory for the steep change in the first 4 rounds is:
    The average number of sets is largest when you first begin the game because you haven’t removed any sets yet. Once you start removing sets, the average number of sets available declines. It levels off after the first 4 rounds, which is the exact point when that the odds against NoSet begin to level off.

    Interestingly, in my simulations, I routinely get 1.53 occurrences of “NoSet” per game. For this statistic, with zero cards left in the deck, I only count a “NoSet” if there are at least 12 cards on the table.

    Instead of attempting to randomly select a set among those available, I may try randomizing the order of the cards on the table before “selecting the first set found”.

    • As soon as we begin to remove cards, there will be some sets that we can’t make, so it makes sense that there is a decline. However, the shape of the curve is quite intriguing I think. Why the pronounced “knee? Why does the average number of available sets stabilize there?

      Yes, randomizing the order of the cards on the table should have the same effect as randomly selecting a set among the available sets.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s