Generalized Clue

Group 7: Ludvig Ungewitter and David Vespe
lju2101@columbia.edu, djv@columbia.edu

Abstract

In this paper, we explore our generalized clue player and the analysis we did to arrive at it. First, we explain how we maintain game state. Then we walk through how we address the three basic areas of the game:

We then introduce Poor Man's Logic Extrapolation and Interrogation Pattern Analysis as approaches to interpreting the questions that other players ask in order to gain information in a non-trivial way. Finally, we examine the tournament results.


Background

In generalized clue, there are n items. k of those items are set aside and hidden. The remaining items are evenly distributed among players. The goal is to find and guess the hidden items as fast as possible. We will in this paper refer to items as cards. You may choose to guess when you are absolutely certain or you may guess earlier. An early guess is of course risky since it may be a wrong guess. However, a certain guess may be a late guess compared to the opponents.


Our Strategy

Maintaining Game State

To keep track of what we know about the game, we use a two-dimensional matrix of integers that we call a scoreboard. The scoreboard has along one axis all the players, and along the other axis all the cards. This concept is the same as the one used by many other groups and as discussed in class.

For each pair of {player, card}, we store a score of how likely we think that player is to have that card. Scores are roughly equivalent to the probability that the player holds the card, but are an approximation; determining the probability is more computationally difficult, and we do not believe it would have had a significant impact on our player's performance.

For example, at the beginning of the game, we set our score for each card we hold to 100, and the score of each card we know we do not hold to zero. Furthermore, for each opponent, we set his score to zero for each card we hold, since we know that our opponents cannot hold the cards that we hold.

As we learn that certain players definitely have or do not have certain cards, we update the scores appropriately. Furthermore, we decrease the scores of the other cards that we weren't sure about for that player.

Thus, as discussed in class, we can guarantee that in the worst case, it will take us n - k - n/p askings to determine the hidden cards. (Where n is the total number of cards, k is the number of hidden cards, and p is the number of players.)

Knowing in this many askings is not very impressive, however, since it's fairly trivial to write a program that can achieve this. Our goal was to improve upon this so that we could know the hidden cards sooner.

What Card to Ask About (and Whom to Ask)

For our player, step one is to decide whom to ask. We don’t make any decisions about the cards to ask for before we know whom to ask. We always ask the player we know the least about. To find out what player that is, we loop through all players. We start with the player directly after us. That way, if we know the same amount about two players we will ask the player that is closes after us. In example, if we are player 3, and player 4 and 5 are the players we know the least about, we will ask player 4. We do this because we want to minimize the risk of, by inference from other players question, find out about a card that we already know about. It is worth to mention here that for each player we store a probability that the player has a certain card. A value of 0 indicates that he doesn’t have the card, 100 that he does and if 0 < value < 100, we don’t know.

The algorithm for deciding whom we know the least about:

  1. loop through all players starting with player directly after us
  2. count the number of cards that we know the player possess

Once we know what player to ask, we will determine what cards that we want to ask about. Here is first a small recap of the rules for interrogations: When a player asks another player about a set of cards and the interrogated player possess at least one of the cards, the player will get back one card as the answer. At the same time the other players will only see that he got some card back. If the interrogated player didn’t have any card in the set, his answer will be no and everyone can infer equally from that interrogation.

The first round is treated as a special case, here we ask about all cards in deck since that gives away no information. In the other rounds we don’t have that option.

It is important to ask about cards that gets new information and at the same time gives away as little information as possible to other players. Our player asks about enough cards so that we, for certain, receives a new card at each interrogation but also, additionally add cards we know either belongs to other players or cards we possess ourselves. That way, we can hopefully give away as little as possible at same time as we, for sure, gain knowledge. There is the option to ask about a set of cards so that we may get a no answer. If you do that, you can get information about more than one card in one interrogation. The problem with that approach is however that, most likely, everyone will gain just as much information as you do because they will see the cards you asked about and also see the no answer. Then, the benefit you have, being the interrogator, is lost.

If we don’t pad our set of cards, it is easy for opponents to infer which cards we already know that the player we are asking has. It’s because they know that we don’t want to ask about cards we already know about since in those cases a known card may be returned. The padded cards have to be random to further hide information. We decided to always pad with half of the cards we have certainty about. We figured that a value in the middle would make it hardest for inference. The amount of cards we know about will increase as the game develops, so in effect our player will pad with more and more cards the later in the game it gets. The padding strategy is one part of the game where we aren’t certain if we are doing the best thing. There is possible room for further improvements in that area.

In the second round, we do something we call a spoof guess. The logic is to take away only one card from the first round. However, this card is not the card we got back from player so we will probably get back the same card as we got the first round. We do this to try and mess with the inference that other players do about our question. Our thoughts are that, if they see that we take away only one card they will infer that it is the card we got back the first round. They will add the wrong probability and maybe guess wrong in the end. We only do this once because, for our player, it is like throwing away one round and therefore is very costly. Additionally, just one round of spoofing should be enough to result in a wrong guess.

Here is our algorithm for deciding what cards to ask assuming we know what player to ask:

  1. if it is the first round, ask about all cards
  2. if it is the second round, ask a spoof question (see below for more on spoofing)
  3. otherwise, create a list of cards to ask about in the following way:

Spoofing is what we call the practice of including in your ask list a card that the player has already told you he has. By spoofing in a given round, we pass up the opportunity to learn anything on that round.

In class we discussed the idea of repeating a card you already know in an ask list, and most of the class decided that no one would ever do this. Based on this assumption, people devised methods to determine what cards certain players were holding in order to gain more information about the state of the game.

Our thinking is that as soon as strategies rely on players not to re-ask cards, it suddenly becomes a good idea to re-ask for a card, since doing so will interfere with the opponents' strategies. Specifically, we have decided that in every game, after we had asked every player one question, we ask one player about all the cards except for one, where the one card is a card that our player holds. Thus we hoped to foil all the players who rely on the fact that we would not do this.

Unfortunately, it appears that no players relied on this heavily enough that they were induced to make wrong guesses consistently. So in the tournament, this behavior probably hurt us rather than helped us, since spoofing put us a turn behind everyone else in terms of knowledge of the board.

What Card to Respond With When Asked a Question

Set-up: we are asked about a set of cards

First of all, we find out if we possess any of the cards in the set. If we don’t then we return a 0 indicating that we don’t have any of the cards. This will not happen very often since interrogators always like to gain knowledge relative to our other opponents.

If it is the first round and we have a card in the set, we randomly return one of the valid cards and save that card. After that we always try to give back a card that we previously have returned. That way we always give back as little information as possible. If we cannot find a card that we previously have returned we have to randomly find a valid card again and return and save that. For each player, we save the cards we have returned. Cards in history for the interrogator are looked at, and tried to be returned, before the other players cards are. The interrogator will however not likely ask about known cards unless he is trying to trick opponents’ inference techniques.

Here is the algorithm:

When to Guess

Our player guesses only when the scoreboard indicates that we are certain of what cards are hidden. This situation occurs when every player has a score of 100 for (n-k)/p cards and 0 for all other cards. However, certainty in the scoreboard does not equate with absolute certainty, because we make certain estimates in the course of the game that may in fact be incorrect. If these estimates are wrong, we may make an early, wrong guess at the hidden cards. In practice, these estimates appear to be wrong less than one game in twenty, so wrong guesses are a fairly infrequent occurrance, and we do not concern ourselves with them.


Interpreting Other Players' Questions

Poor Man's Logic Extrapolation

Our first improvement to the maintenance of game state outlined above is to listen to what questions are asked and interpret the responses. In certain cases, this is a completely trivial idea. For example, if we hear a "no" answer, we score zero for the question recipient for all the cards that were asked.

Similarly, if we hear a "yes" answer and there was only one card in the ask list, then we score 100 in the recipient's corresponding box. We further extend this idea by noting that if there are multiple cards on the ask list, we may still be able to infer something. In the case where we know a player does not have all but one of the cards in the ask list, we can score 100 for that player having the remaining card.

We found this approach to be effective but incomplete: it missed a lot of information that we could have inferred if the questions had occurred in a different order.

Our answer to this problem is that each turn, we review the entire ask history for any new inferences we can draw based on the old interrogations plus whatever new information we have. This is the essence of Poor Man's Logic extrapolation.

For example, imagine that we see that player 1 is asked on the first round about the 2 and the 3 and responds "yes". If we know nothing about the 2 and 3, we cannot reason anything. If, however, we find out in a subsequent turn that player 7 holds the 2, then we can reason that player 1 must hold the 3. Thus by reviewing the entire ask history, we can glean more information than if we interpret each ask event only once.

The drawback of this approach is that, as Professor Ross points out, it does not accomodate more complex logic statements. For instance, if in the above example we learn that player 7 must hold either the 2 or the 3, we could reason that neither 2 or 3 is a hidden card, and we could stop asking about both of them without knowing for sure who holds which. This did not seem to be a big drawback when first we recognized it, but it is likely a component that the winning players in the tournament exploited to their advantages.

Interrogation Pattern Analysis

When players interrogate one another, there are generally two components to each question. First, there is a list of "interesting" cards -- the cards whose locations the interrogator does not know for certain; the interrogator generally guarantees himself that he will get a "yes" response to at least one of these. The second component of a question is noise; these are cards that the interrogator includes simply to deceive any third player who is listening to the interrogation. If we could filter out the noise from the interesting cards with 100% accuracy, we would be able to gain a lot of information about what cards people hold.

Analysis of some real players reveals some patterns. However, some of the apparent conclusions are easy to deceive, and so we avoid these. For example, it is dangerous to draw conclusions from one specific question, since it is inexpensive for a player to "throw away" one question, and it would be perilous for us to draw conclusions from that question. Thus we focus our efforts on analyzing the entire set of questions that are asked to deduce patterns from these.

In our experimentation, we reasoned that the most interesting and reliable characteristic of a player's interrogation pattern would be what cards he asks for in relation to his own cards. We decided this because each player has perfect information about his own cards from the beginning, and thus this knowledge is more likely to influence is ask pattern at every interrogation. By contrast, information that the player learns later will only affect his interrogations after he has learned that information. There will therefore be two phases of interrogations (one before and one after he learned that particular information), and thus the information would be more difficult to process. In addition, knowing that a player knows about a card does not tell us where that card is, so it is less useful.

Thus we came to focus on players' interrogation patterns relative to the cards in their hands. By counting, sorting, and visually displaying the interrogations of each player, we found that some players exhibited a simple pattern with respect to what cards they asked about.

For example, here are the sorted results for two of the players (these are not the final submissions but intermediate submissions).

6:   *************************************
13:  *************************************
34:  *************************************
37:  *************************************
38:  *************************************
16:  ************************************
9:   ***********************************
15:  **********************************
44:  *********************************
49:  ********************************
41:  *******************************
25:  ******************************
21:  *****************************
19:  ****************************
11:  ***************************
4:   **************************
1:   *************************
47:  ************************
42:  ***********************
36:  **********************
32:  *********************
26:  ********************
18:  *******************
17:  ******************
5:   *****************
31:  ****************
46:  ***************
8:   **************
24:  *************
2:   ************
22:  ***********
35:  **********
30:  *********
45:  ********
33:  *******
29:  ******
27:  *****
20:  ****
14:  ***
12:  **
10:  *
3:  #
7:  #
23: #
28: #
39: #
40: #
43: #
48: #

6:  #*************************************
9:  #*************************************
13: #*************************************
15: #*************************************
16: #*************************************
34: #*************************************
37: #*************************************
44: #*************************************
49:  ************************************
25:  ***********************************
47:  ***********************************
14:  **********************************
41:  **********************************
3:   *********************************
31:  *********************************
46:  *********************************
4:   ********************************
29:  ********************************
40:  ********************************
42:  ********************************
8:   *******************************
19:  *******************************
36:  *******************************
38:  *******************************
39:  *******************************
5:   ******************************
12:  ******************************
21:  ******************************
22:  ******************************
28:  ******************************
30:  ******************************
10:  *****************************
11:  *****************************
23:  *****************************
24:  *****************************
26:  *****************************
33:  *****************************
35:  *****************************
45:  *****************************
48:  *****************************
2:   ****************************
7:   ****************************
17:  ****************************
20:  ****************************
27:  ****************************
32:  ****************************
43:  ****************************
18:  *************************
1:   ****************

(Number of times this player asked about this card by end of game; players' own cards denoted by '#'.)

Note that in the first case, the player's strategy is to ask only about the cards about which he is unsure and does not add his own cards as "noise". In the second case, the player frequently throws in his own cards as noise; in fact, he includes his own cards more frequently than any others.

From these observations, we developed and implemented the following rule (where p is the number of cards per player):

If at any point in the game, we know more than half of a player's cards for certain, and those cards are all in the p most frequent or p least frequent cards that the player has asked about, and we do not know where the remaining p cards are held, then we assume the player has all p cards in the set.

Thus if p=8, we may infer after knowing 5 cards in a person's hand what the other 3 cards are. This enables us to guess what the hidden cards are at least 3 rounds early, and in some cases more (because we may be able to make additional inferences based on the positions of these 3 cards).

In practice, we find that this rule is applied in almost every game against certain players, and is never used against some other players. When it is applied, it appears to be accurate at least 9 times in 10 applications. When applied, it tends to enable our player to guess correctly at the hidden cards several turns before any other player. The occasional incorrect guess means that we finish particularly low in the scores, but since this negative is so infrequent compared to the positive result, we accept that it is a necessary consequence of our strategy.


Results

Our player's strength is in games with a medium number of cards (peaking at 5) and a large number of players. For example, with 5 cards per player and 8 players, we tend to finish first and second often, and the majority of our finishes are in the top 3. (Because the pattern analysis sometimes fails, we do come in last place about one time in ten in these tournaments, so our rank numbers are sometimes skewed towards the bottom.) 5 cards per player and 8 players is the scenario that we ran most of our tested on, so this observation makes sense.

For smaller numbers of cards, our performance is in the middle or towards the bottom. One problem our strategy has with small numbers of cards is that they do not allow our pattern-finding algorithm enough data to draw conclusions. Furthermore, because we threw away a guess every game, we were a round behind everyone else, and in a small game this makes a big difference.

With larger numbers, our performance was in the middle. The problem with large numbers is less clear. It may be that it takes more trials to get a clear picture of what cards the other players have, and by that point other players are already winning.


Conclusions and Future Work

Our player performed well in the situation we optimized it for, and was a reasonable performer in other situations. Since many other players clearly did better than ours in many situations, perhaps a hybrid of several of our strategies could form an overall stronger strategy.

One interesting aspect of this game is that it is a game of secrecy, yet the class stresses sharing of ideas. Thus by sharing our methods for exploiting other players with the rest of the class, the other groups appear to have closed some of those holes in their players. Therefore a lot of our efforts did not bear fruit in the tournament.

In a future revision of our player, we would benefit if our player had a simple learning algorithm to govern spoofing behavior. Specifically, in a tournament, it would try spoofing in perhaps 20 games and determine if it did well in those. Then it would pass 20 games without spoofing and compare the results. It could then use whichever behavior worked better for the rest of the tournament.


Acknowledgements

We acknowledge contributions from Edan Harel in the areas of the scoreboard and for the idea that you could infer what is hidden based on what people are asking most frequently.