Singapore Mathematics Project Festival 2003 Project title Team Members Quah Wan Fen Nicole Quah Wan Jen Cheryl Sim Jingwei Tan Wei Lin Project Supervisors Mrs. Sia Wai Leng Mr. Kenneth Lui School Raffles Girls’ School (Secondary) Project Category Junior Section Contents Summary……………………………………………………………………….. 3 Introduction……………………………………………………………………... 5 Aims & Objectives..…………………………………………………………….. 6 Theoretical Background………………………………………………………… 7 Procedure of Investigations…………………………………..…………………. 15 Investigation I...………………………………………………………………… 16 Investigation II...………………………………………………………………... 21 Investigation III…..……………………………………………………………... 24 Conclusion…………….………………………………………………………... 28 References & Acknowledgements……………………………………………… 29 Matrices in Game Strategy Page 2 Summary This project is an investigation on Bridge, the common card game for four players who team up to play, pair against pair (the teams are called “North-South” or “EastWest”, according to their seating positions at the table). It is played using the usual 52-card deck. At each round, each player is to play (or put down in full view) one of his cards. The player who plays the highest card amongst the four wins the round or “trick” for his team. The introduction defines briefly game theory and matrices, as well as gives the connection between Bridge and these two main aspects of our investigation. Our original aim for this project was to propose an optimal strategy for Bridge, through investigating various situations and models, where strategies and payoffs were approached differently. We adopted the following methodology in our investigation. Various methods involving matrices were used to solve the examples we came up with for each game model. The optimal strategies for Investigations I and III yielded patterns or generalizations. However, there was insufficient time to complete Investigation II. We realized that Bridge was too complex to investigate within the time frame that we had. Instead, we came up with several simplified number games that retained a few of the methods of play from Bridge, namely that the four players played two-against-two and that each player had to put down one card for each round, with the player playing the highest-valued card out of all four cards winning the round for his team. Our first investigation involved dealing three cards to each player. We assumed ‘telepathy’ between the partners where each player would have a definite knowledge of his partner’s hand. This allowed for the strategy, which we investigated and found an optimal solution to, to be the cards that the partners should play as a round together. It was found that the largest payoff would result from East-West team playing Min [max(East), max(West)] and Min of player holding {max [max(East), max(West)]}, while the North-South team used the same strategy, playing Min Matrices in Game Strategy Page 3 [max(North), max(South)] and Min of player holding {max [max(North), max(South)]}. After Investigation I was completed, we decided to investigate other game models, which had randomly chosen structured payoffs, resulting in more variation in the payoff matrix. In Investigations II and III, each player had 4 cards, and as we found it difficult to retain the 13-cards-within-a-suit property of card games, we modified them into number games (i.e. assigning an increasing numerical value to all cards required). We came up with a varied payment that would allow for more variation in the payoff matrices; the winning pair gains the basic $0.30 from the losing pair for every play. Extra money was gained from the losing pair based on the summed value of their cards (see value-and-payment table in Investigation II report). We then mapped out every way of playing a single distribution of hand and the average was taken for all the ways of playing for each set. Optimal strategies were developed for our two examples, but we could not develop a full generalization. As for Investigation III, it was created as a furthering of Investigation I by including such a payment system like Investigation II. It was approached using “telepathy” and the pairing of cards, and it was found that Investigation I’s generalization could be applied in solving the first step of optimal strategies required. The following payoff matrices were constructed such that the strategy was to find which pair of cards to start with, and though no generalization was reached, we had a general assumption that when a team had matching rows/columns, their strategy would be ¼ for all the rest and the matching ones would be the same such that it needed only one of them to make the strategy equal 1. We found that there were also easier ways of finding the value of the game by looking at the payoff matrix alone. The various investigations carried out in this project have allowed us to better understand how to develop our own investigative models from existing games. It is hoped that with our first steps of investigation, a generalization of the actual game of Bridge can be proposed in the future, taking into account the more minute (but complex, in the real gambling world) details such as bidding and trumps. Matrices in Game Strategy Page 4 Introduction The project This project involves an investigation of several game models that have been simplified and adapted from the card-game bridge. We chose to work on this because we took an interest in a different form of mathematics – matrices. Using matrices to solve games of strategy was easier to relate to than other diverse fields where matrix mechanics are involved, e.g. forest management, chaos etc. The matrix When a set of regular numbers is written as an oblong arrangement of terms consisting of m rows and n columns and thus treated independently, this forms the basis of a different expression of mathematics – matrices. A matrix is a concise way of uniquely representing and working with linear transformations. The theory Game theory is the formal analysis of strategic behaviour, or the relation between interdependent agents. It takes into consideration the consequences of actions, and the interplay of competition and cooperation. Any situation with two or more people requiring decision-making can be classified as a game. For many games, continual playing trains the player to think strategically and determine the best moves to maximize his chances of winning through basic logic. Mathematics can also be used to map out a more structured format of any game. When it is possible to represent the outcomes of different strategies in the form of a payoff matrix, the optimal strategies for each player and the expected value of the game can be solved. The investigation We aimed to find the optimal strategies of various number games that were simplified and modified from the game of Bridge. We applied different techniques of matrix solving to find the optimal strategy for each player, to either minimize his loss or maximize his gain. The Bridge basis We originally intended to base our investigation on the 4-player card game of bridge. The game of bridge requires comparison of players’ cards with originally assigned values to them, and weighing numbers against one another is also a part of calculating optimal strategies of competitors. However, due to the complex nature of the actual card game Bridge, we later came up with several simplified game models, which we based our investigation on instead. Matrices in Game Strategy Page 5 Aims Research segment To find out how matrices are applied in games of strategy to the advantage of the player and to solve for optimal strategies and values of games. To find out how matrix mechanics applied in solving various game models and approaches differ. Investigative segment Our original aim was to find an optimal strategy or generalization for the card game Bridge. We later modified this to finding optimal strategies or generalizations to various simplified game models, using experimentation through matrices, tabulations and formulae. Objectives To come up with several simplified game models from Bridge that require various approaches to solve. These models still retain a few Bridge rules: a) There are four players who team up to play, pair against pair; b) The player who plays the highest card amongst the four played wins the round or “trick” for his team. To use various methods and forms of matrices to solve and propose the optimal strategies of these models. To come up with generalizations for each of these models based on the results of our investigation. Matrices in Game Strategy Page 6 Theoretical Background (I) Bridge In Bridge, the standard deck of 52 cards is used. 4 players compete in pairs – players East and West (aptly named for their seating position at the play-table) play against North and South. In every round, the pair that plays the card of the highest value of those from the suit established beforehand wins the round, or “trick”, as it is called in Bridge. (II) Optimal Strategies & Saddle Points To demonstrate the use of a payoff matrix, we use the example of the spinning wheel, a carnival game: Row wheel Player R Figure 1.1 Column wheel Player C The payoff matrix is then fashioned, showing how much row-wheel player has to pay column wheel player when there are different combinations. Note: The payoffs in the matrix are arbitrary. An example of such a matrix would look like this: Region Nos. C falls on 1 C falls on 2 C falls on 3 R falls on 1 -$3 $2 -$6 R falls on 2 -$5 -$4 $5 R falls on 3 $2 $3 $0 R falls on 4 $1 $4 -$3 Figure 1.2 Matrices in Game Strategy Page 7 This table shows how much Player R gains for any move. Should R’s move fall on region 4, and Player C’s in region 2, R will receive $4 from C. Positive numbers shown are thus R’s gains and C’s losses, and vice-versa for the negative numbers. The following table shows the division of regions in each player’s game wheel, and consequently, the probabilities of landing in each section. Region Fraction for R’s Fraction for C’s No. wheel wheel 1 1 /4 1 /2 2 1 /4 1 /3 3 1 /6 1 /6 4 1 /3 N.A. The expected payoff to Player R is the weighted average of the payoffs to him, where each payoff is weighted according to the probability of its occurrence. This is expressed by the equation a11p1q1 + a12p1q2 + … + a1np1qn + a21p2q1 + … + amnpmqn (1) Figure 1.3 which is obtained through multiplying Player R’s strategy, the row vector: p = [p1 p2 … pm] by Player C’s strategy, the column vector: q= q1 q2 q3 q4 Here, pi = probability that Player R makes move i (i = 1, 2, …, m) qj = probability that Player C makes move j (j = 1, 2, …, n) and by the payoff matrix (refer to example of Figure 1.2), which can then be represented similarly this way A= a11 a12 … a1n a21 a22 … a2n . . . . . . . . . am1 am2 … amn Considering that piqj is the probability that for any one play of the game, Player R makes move i and Player C makes move j. For such a pair of moves, the payoff to Player R would then be aij. Multiplying each possible payoff (A) by its corresponding Matrices in Game Strategy Page 8 probability (pq) and summing over all possible payoffs, equation (1) is then obtained. Alternatively, it can be written in matrix form as: a11 E (p, q) = [p1 p2 … pm] a12 … a1n q1 q2 q3 q4 a21 a22 … a2n . . . . . . . . . am1 am2 … amn Where E (p, q) is the expected payoff to Player R, and – E (p, q) is thus the expected payoff to Player C. Thus, for the game described above, the expected payoff to Player R is denoted by. 1 1 1 1 /4 /4 /6 /3 -3 2 -6 -5 -4 5 2 3 0 1 4 -3 1 /2 1 /3 1 /6 = -0.4305 Therefore, it can be expected that Player C will gain an average of 43 cents (this number is tended towards over many times of playing only) from the row wheel player every play. In this spinning wheel game, the outcome is based on chance and the players have no control over their moves, thus the above is just the calculation of predetermined strategy. However, based on the payoff matrix, the players could find optimal strategies for themselves by manipulating the areas assigned to each number on their wheel. Optimal strategy is defined as Player R’s strategy to maximize his gain, denoted as p*, and Player C’s strategy to minimize his loss, denoted as q*. The fundamental theorem of zero-sum games states that there exist strategies p* and q* such that E(p*, q) ≥ E(p*, q*) ≥ E(p, q*) for all strategies p and q. Also, v = E(p*, q*), where v is the value of the game, and where v = 0, the game is termed fair. One way of finding an optimal strategy is by using the saddle point of a payoff matrix. A saddle point is an entry ars in a payoff matrix A where ars is (i) the smallest entry in its row, and (ii) the largest entry in its column. 60 is the saddle point in the following matrix: Matrices in Game Strategy Page 9 -50 -5 30 90 75 60 60 -30 -10 0 Therefore, p* = [0 1(rth entry) 0] and q* = 0 1 sth entry Player R’s optimal strategy is thus to always make the rth move, and Player C’s the sth move. This is known as a pure strategy, contrary to what is known as a mixed strategy – more than one move to be made for the optimal strategy. A game with a payoff matrix that has a saddle point is known as strictly determined, and its value is the payoff in the saddle point entry. Also, a payoff matrix may have several saddle points, but the uniqueness of the value of a game guarantees that the numerical values of all saddle points are the same. For non-strictly determined, 2 X 2 matrix games, the optimal strategies of Players R and C can be found using the theorem: a22 – a12 p* = a22 – a21 a11 – a12 a11 + a22 – a21 – a21 a11 + a22 – a21 – a21 q*= a11 + a22 – a21 – a21 a11 – a21 a11 + a22 – a21 – a21 a11a22 – a12a21 and v = a11 + a22 – a21 – a21 (III) Optimal Strategies & Assignment Matrices Operations research requires assigning tasks to facilities on a one-to-one basis, e.g. distributing machines to building sites. The assignment problem, requires the number of facilities and tasks (taken to be n of each) to be equal. Therefore, there are (n)(n-1)(n-2)…(3)(2)(1) = n! possible ways to assign all n tasks. Among the n! assignments, a next task is given to find one that is optimal in some sense. To define an optimal assignment, we introduce the following term which takes on the appropriate unit of the problem: cij = cost of assigning the ith facility the jth task where i, j = 1,2,…,n The cost matrix of the problem refers to the n X n matrix: Matrices in Game Strategy Page 10 C= c11 c12 … c1n c21 . . . cn1 c22 … c2n . . . . . . cn2 … cnn As each task can be assigned one unique facility, and each facility can be assigned to one unique task, no two corresponding cij’s can come from the same row or column. Therefore, given any n X n cost matrix C, an assignment is a set of n entry positions, no two of which lie in the same row nor column (i.e. no facility can be assigned twice). The sum of the n entries of the assignment is called the problem’s cost (there will be n! costs in this case). The assignment with the smallest possible cost is the optimal assignment. The assignment problem seeks to find an optimal assignment in a given cost matrix. In the following example of a cost matrix, the various possible assignments are highlighted in yellow. The final optimal assignment is blue: 50 35 40 5 65 30 2 3 25 50 35 40 5 65 30 2 3 25 50 35 40 5 65 30 2 3 25 50 + 65 + 25 = 140 50 + 30 + 3 = 83 35 + 5 + 25 = 65 50 35 40 5 65 30 2 3 25 50 35 40 5 65 30 2 3 25 50 35 40 5 65 30 2 3 25 35 +30 + 2 = 67 40 + 5 + 3 = 48 40 + 65 + 2 = 107 However, as the value of n in C increases, it becomes impractical to solve any assignment problem. There is a theorem that if a number is added to or subtracted from all entries of any one row or column of a cost matrix, then an optimal assignment for the resulting matrix is also the optimal assignment for the original cost matrix. The Hungarian Method applies this such that the resulting matrix contains an assignment entirely of zero entries (called optimal assignment of zeros; obviously optimal because it is impossible to get a cost below zero from a matrix of nonnegative entries). The original numbers at the position of the zero entries form the optimal assignment for the original problem. The last three steps are applied iteratively as many times as necessary to generate an optimal assignment of zeros: 1. Subtract the smallest entry in each row from all row entries. With this, each row will have at least one zero entry, and all other entries will be nonnegative. 2. Where a column still has only non-zero entries, subtract the smallest entry in each column from all column entries. With this, each row and column will Matrices in Game Strategy Page 11 have at least one zero entry, and all entries of the resulting matrix will be nonnegative. 3. Draw lines through appropriate rows and columns such that all zero entries are now covered and with the minimum number of lines. This may be done through trial and error, but for larger numbers, algorithms suitable for computer coding are available. 4. To define the optimality in this case, (a) If the minimum number of covering lines is n (i.e. the number of rows or columns in this n X n cost matrix), an optimal assignment of zeros is possible and the Hungarian Method is complete. Search for set of n zero entries, no two of which lie on the same row or column. If more than one set exists, validate optimal set. (b) If the minimum number of covering lines is less than n, proceed to Step 5 as an optimal assignment of zeros is not present. 5. Determine the smallest entry not covered by any line. Subtract this entry from all uncovered entries and then add it to all entries covered by both a horizontal and a vertical line (i.e. twice). Then, return to Step 3 and reiterate until 4(a) is reached. The Hungarian Method can only be used for minimization. The problem of maximizing the sum of entries of a cost matrix is easily converted to one of minimizing the sum by multiplying each entry of the cost matrix by –1. (IV) Optimal Strategies & Linear Programming For larger, non-strictly determined matrices, their optimal strategies are found using linear programming. The Simplex method, used to solve linear programming problems, can be applied to manually calculate the optimal strategies and the value of the game, but the more practical way is to key a list of constraints into one of the many Simplex applets available online, for example at http://people.hofstra.edu/faculty/Stefan_Waner/RealWorld/simplex.html. Matrices in Game Strategy Page 12 To make all the elements in a payoff matrix positive, a constant r is added, which can later be subtracted from the value of the game. Player R seeks to find v, such that it is the minimum of the expected payoffs no matter what Player C plays. If C plays column 1 a11p1 + a21p2 + … + am1pm ≥ v If C plays column 2 a12p1 + a22p2 + … + am2pm ≥ v If C plays column n a1np1 + a2np2 + … + amnpm ≥ v . . . . . . Thus, Player R seeks to find p1, p2, . . . , pm such that v is a maximum subject to a11p1 + a21p2 + … + am1pm – v ≥ 0 a12p1 + a22p2 + … + am2pm – v ≥ 0 . . . . . . a1np1 + a2np2 + … + amnpm – v ≥ 0 p1 + p2 + … + pm = 1 p1 ≥ 0, p2 ≥ 0, …, pm ≥ 0, v ≥0 pi Assuming that v > 0, since all entries of A are positive, and letting yi = v , we 1 get y1 + y2 +…+ ym = Thus v is a maximum only if y1 + y2 +…+ ym is a v minimum. The problem is restated as Minimize y1 + y2 + … + ym subject to a11y1 + a21y2 + … + am1ym ≥ 1 a12y1 + a22y2 + … + am2ym ≥ 1 . . . . . . . . . a1ny1 + a2ny2 + … + amnym . . . ≥1 y1 ≥ 0, y2 ≥ 0, …, ym ≥ 0, These constraints are used to find the Player R’s optimal strategy and the value of the game. Alternatively, Player C’s strategy is found by doing the reverse, which is as follows Matrices in Game Strategy Page 13 Maximize x1 + x2 + … + xn subject to a11x1 + a12x2 + … + a1nxn ≥ 1 a21x1 + a22x2 + … + a2nxn ≥ 1 . . . . . . . . . . . . am1x1 + am2x2 + … + amnxn ≥ 1 x1 ≥ 0, x2 ≥ 0, …, xn ≥ 0 Large m X n matrices can also be simplified and then solved by eliminating dominant/recessive rows and columns. If each element of the rth row of A is ≤ the corresponding element of the sth row of A, then the rth row is recessive to the sth row, and the sth row is said to dominate the rth row. And if each element of the rth column of A ≥ the corresponding element in the sth column of A, then the rth column is called recessive and the sth column is said to dominate the rth column. The recessive columns and rows can be removed to reduce the size of the matrix. A note on the types of games: Games where a payoff matrix is involved that is based on the moves of two players R and C are known as two-person games or matrix games. A second matrix representing payoffs of Player C can be constructed, but in the class of games called constant-sum games, the sum of the payoff to R and the payoff to C is constant for all mn pairs of RC moves. Thus a special kind of constantsum game is the zero-sum game, where the amount won by one player is exactly the amount lost by the other player, and it is sufficient to study only the payoff matrix for R. The fundamental theorem of matrix games is that every matrix game has a solution (i.e. there are optimal strategies for R and C, and moreover, v = v'). Matrices in Game Strategy Page 14 Procedure of Investigations ♦ We realized that Bridge was too complex to investigate within the time frame that we had. Instead, we came up with several simplified number games that retained a few of the rules of bridge, as stated in the objectives. ♦ Our first investigation involved starting out with a small sample of 3 cards per player. To simplify the game, we assumed a so-called ‘telepathy’ between the partners, where they would be able to discuss which cards they were going to play. This allowed for the strategy, which we planned to investigate and find an optimal solution to, to be the cards that the partners should pair up and play. ♦ After Investigation I was completed, we decided to investigate another game model, which had randomly chosen payoffs, resulting in more variation in the payoff matrix. In Investigations II and III, each player has 4 cards, and as we found it difficult to retain the 13-cards-within-a-suit property of card games, we modified them into number games. ♦ In Investigation II, the ‘telepathy’ has been removed and thus the game is quite different from that in Investigation I, as the objective is changed to finding the optimal strategy for the starting 2 cards. ♦ Investigation III was carried out at the same time as Investigation II. It was approached the same way as Investigation I, but it involved the kind of varied payoff matrix of Investigation II. ♦ Various forms of matrices were used to solve the examples we came up with for each game model. The optimal strategies for investigations I and III yielded patterns or generalizations. However, there was insufficient time to come up with a generalization for Investigation II. Matrices in Game Strategy Page 15 Findings of Investigations Investigation (I) In the first of our investigations, we dealt three cards (within a deck of 3 to Ace) to each of the four players, as this number was easier to work with within the grounds of one suit. East and West pair up to play against North and South. Each player was to play one card for each round; should the value of his card be higher than all other cards played, he would win that trick for his team. The following example was extracted from our portfolio, trial-played with the following cards: North – Q, 8, 4 South – K, J, 6 East – A, 10, 3 West – 9, 7, 5 To simplify the game, we assumed that partners could discuss their strategy, thus incorporating a type of ‘telepathy’. This allowed us to look into the pairing of each team’s cards. We mapped out in a table how the cards could be distributed and the chances of winning of each possible pair against every possible move of the opponent. This was with the hypothesis that the number of tricks each team can win is related to the way the cards are distributed and paired up. The first trick possibilities are as follows; scoring was 1 point for each trick won and -1 point if the team loses a trick (the table below shows scoring from East-West’s point of view. This zero-sum scoring is equivalent to scoring {win +1, lose -1}, then netting off both teams’ scores East-West Card Pairs at the end of each game: A9 A7 A5 10 9 10 7 10 5 39 37 35 QK QJ 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 3 North-South Card Pairs Q6 8K 8J 86 4K 4J 46 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 3 3 3 -5 3 3 9 9 9 -5 -5 -5 -5 -7 -9 -7 Figure 2.1 The expected value for payoffs for all given openings are tabulated in a Microsoft Excel spreadsheet below. Matrices in Game Strategy Page 16 E-W N-S 1 -1 9 -1 -2 0 -10 -3 -4 -2 -12 -5 -6 -4 -14 Figure 2.2 At first it was felt that the sum of net wins would indicate a pattern, so we formed the small table above. We deducted net wins of the North-South team from those of EastWest, as the first table reflecting first trick possibilities presents the game from East-West’s point of view. It appears that the saddle point of this (in blue), when the reference headings (in green) are compared with the document, it can be seen that the cards with the most frequent occurrence of these values actually form the optimal first-trick strategy. In this Microsoft Excel spreadsheet, we divided each net win by nine. This was to weight the net wins according to their probability of occurrence (only one card pair should be played out of the opponent’s 9 card choices). The expected values (EV) of the games (each beginning with different card pairs) were then compared. The largest EVs (indicated with a tick) were then recorded for further investigation. Matrices in Game Strategy Page 17 As it turned out, the optimal first-trick strategy for each team would be to pair and play the combination: E-W Team to play: N-S Team to play: Min [max(East), max(West)] Min [max(North), max(South)] Min of player holding Min of player holding {max [max(East), max(West)]} {max [max(North), max(South)]} In our example, E-W Team would open with Min[A,9]=9 (the latter card being West’s highest card). East obviously holds the highest of all 6 original cards and is thus obliged to play Min{E hand=A,10,3}=3. In other words, this card trick would be made up of the lower of the two highest cards from the team’s two hands and the lowest from the second hand. Intuitively, this high-low combination is to be expected as it implies less wastage. The next best trick is achieved by playing the highest card of all eight and the lowest card from the second hand (E-W: A and 5). This is followed by playing the middle-valued card of each hand (E-W: 10 and 7). 1. The table below shows the original “cost matrix” for the possible plays, reflecting the number of tricks (total, not netted off) that are possible for EastWest: W plays 5 W plays 7 W plays 9 E plays 3 0 -1 -2 E plays 10 -2 -2 -2 E plays A -9 -9 -9 Figure 2.3 2. Subtract minimum of each row from respective row – subtract -9 from Row 1, subtract -9 from Row 2, subtract -0 from Row 3: W plays 5 W plays 7 W plays 9 E plays 3 9 8 7 E plays 10 7 7 7 E plays A 0 0 0 Figure 2.4 3. Since Column 3 fully contains zeros, it is settled for the time being. We subtract the minimum of each column from respective column – subtract 7 from Column 1, subtract 7 from Column 2: W plays 5 W plays 7 W plays 9 E plays 3 2 1 0 E plays 10 0 0 0 E plays A 0 0 0 Figure 2.5 Matrices in Game Strategy Page 18 4. Minimum number of lines to cover all null entries is 3; optimal assignment of zeros is possible, and reflected as follows: E plays 3 2 1 0 W plays 5 W plays 7 W plays 9 E plays 10 0 0 0 E plays A 0 0 0 Figure 2.6 5. Therefore, when we refer to the original table, it follows that this: E plays 3 0 -1 -2 W plays 5 W plays 7 W plays 9 E plays 10 -2 -2 -2 E plays A -9 -9 -9 Figure 2.7 is the optimal strategy for the original cost matrix. Note that our hypothesized strategy for the first card (in this case East’s 3 and West’s 9) is also sustained here. To put this information in a diagram (where separate rows are of separate players’ cards arranged from the lowest-valued to the largest): 3 10 A 4 8 Q 5 7 9 6 J K 3-card Hands East-West Card Pairs North-South Card Pairs Figure 2.8 We then did the same for 4 cards and 5 cards per player, attempting to find a generalization. It was successful for both cases (provided the deck is labeled 1-16 and 1-20 respectively, in accordance to card value). Here are 2 examples: 1 5 12 13 2 7 11 1 4 8 9 16 3 6 10 15 4-card Hands East-West Card Pairs North-South Card Pairs Figure 2.9 Matrices in Game Strategy Page 19 2 6 7 14 17 1 3 13 10 18 5 9 11 15 20 4 8 12 16 19 5-card Hands East-West Card Pairs North-South Card Pairs Figure 2.10 So far, we have assumed a simple game in which each team member knows whether his partner is playing his high, medium or low card, and the opposing team exhibits random behaviour. There is a rational strategy to be derived. However, over a large enough number of games, either team is as likely to draw a given hand. The EV of the game is therefore 0 (“fair” game). [We could go one step further to look at the 2ndand 3rd-trick plays, which involve 4 possible combinations from each team.] In the next section, we will modify the rules to explore more complex game scenarios. Matrices in Game Strategy Page 20 Findings of Investigation Investigation (II) In this second game model, we decided to come up with a varied payment that would allow for more variation in the payoff matrices. We also adopted a different approach from Investigation I by doing away with assumed collaboration between partners. Value North East South West 1 1 2 3 4 2 8 7 6 5 3 9 10 11 12 4 16 15 14 13 Figure 3.1 One random example of a distribution The game is created such that the winning pair gains a basic $0.30 from the losing pair for every play. They then gain extra money from the losing pair based on the summed value of the numbers they have been dealt: Value Payment 2 $1.80 3 $1.50 4 $1.20 5 $0.90 6 $0.60 7 $0.30 8 $0 Figure 3.2 Thus, the players strive to win each ‘trick’ with as small a summed up value as possible. North always plays his card first, followed by East, South and then West. We decided to define the strategy for this game as the cards which North and East decided to play at the very beginning of each game, as the strategy in Investigation I (how the partners should pair up their cards and play) would not work here without ‘telepathy’. We then mapped out every single way of playing a single distribution of hand, e.g. Figure 3.4, and the average was taken for all the ways of playing for each set, i.e. each way that North and East could start. Matrices in Game Strategy Page 21 Hand val Payoff Basic 03 2 1.8 2.1 3 1.5 1.8 4 1.2 1.5 5 0.9 1.2 6 0.6 0.9 7 0.3 0.6 8 0 0.3 Figure 3.3 Payoff system based on hand value E 2 7 10 15 S 3 6 11 14 W 4 5 12 13 NS Largest Won 4 0 8 1 12 0 16 1 EW Won NS Val 1 0 0 4 1 0 0 8 Net EW Val NS Pts 2 0 0 1.5 6 0 0 0.3 Total 1.8 -1.2 Figure 3.4 The average of each set was written in a payoff matrix, figure 3.5, and we checked for a saddle point. No saddle point was found so there was no pure optimal strategy and we used the Simplex Method as described in the theoretical background to solve this 4x4 payoff matrix. Starting cards of East Starting cards of North N 1 8 9 16 2 7 10 15 1 0.198 -0.64 -0.002 0.110 8 0.331 0.499 -0.022 -0.189 9 0.255 0.408 -0.007 -0.020 16 -0.163 -0.151 0.206 0.713 Figure 3.5 Payoff matrix Maximize p = x1 + x2 + x3 + x4 subject to 1.198x1 + 0.936x2 + 0.998x3 + 1.110x4 + s <= 1 1.331x1 + 1.499x2 + 0.978x3 + 0.811x4 + t <= 1 1.255x1 + 1.408x2 + 0.993x3 + 0.980x4 + u <= 1 0.837x1 + 0.849x2 + 1.206x3 + 1.713x4 + v <= 1 Which yields p = 190/207; x1 = 20/69, x2 = 0, x3 = 130/207, x4 = 0 1 p = x1 + x2 + x3 + x4 = v v = 1 / (190 / 207) = 207 / 190 q1 = x1v = (207 / 190)(20 / 69) = 6 / 19 q2 = x2v = (207 / 190)(0) = 0 q3 = x3v = (207 / 190)(130 / 207) = 13 / 19 q4 = x4v = (207 / 190)(0) = 0 Matrices in Game Strategy Page 22 EW Pts -2.1 0 -0.9 0 -0.3 Therefore EW’s optimal strategy is 1 ≈ 0.089 (3 sig fig). 6/19 0 13/19 0 and the value of the game is 17/190 – For Player R – Minimize p = y1 + y2 + y3 + y4 subject to 1.198y1 + 1.331y2 + 1.255y3 + 0.837y4 + s >= 1 0.936y1 + 1.499y2 + 1.408y3 + 0.849y4 + t >= 1 0.998y1 + 0.978y2 + 0.993y3 + 1.206y4 + u >= 1 1.110y1 + 0.811y2 + 0.980y3 + 1.713y4 + v >= 1 Which yields p = 190/207, y1 = 0, y2 = 205/437, y3 = 0, y4 = 346/771 p = y1 + y2 + y + y4 = 1 v = 1 / (190 / 207) = 207 / 190 v p1 = y1v = (207 / 190)(0) = 0 p2 = y2v = (207 / 190)(205 / 437) = 369/722 p3 = y3v = (207 / 190)(0) = 0 p4 = y4v = (207 / 190)(346 / 771) = 353/722 Therefore NS’s optimal strategy is 0 369/722 0 353/722 We applied the same method to another distribution of cards, figure 3.6. The optimal strategy was solved using the Simplex Method as well, and the answer is shown below. North East South West 1 2 5 1 4 2 7 6 3 10 3 9 8 12 11 4 16 15 13 14 Figure 3.6 Starting cards of East 5 Starting cards of North Value 6 8 15 -0.212 2 -0.304 -0.224 0.001 7 -0.011 -0.334 -0.398 9 -0.195 -0.158 0.022 0.011 -0.376 16 -0.206 -0.364 -0.400 0.263 Figure 3.7 Payoff matrix v ≈ -0.180 (3 sig fig) NS [109/399 511/2000 1417/6251 4687/19152] EW 654/3629 787/2500 2437/10000 4687/17396 We intended to investigate similar examples further, in order to propose a generalization or pattern in the optimal strategies based on our findings. However, due to time constraints, we only managed to solve two such examples. Matrices in Game Strategy Page 23 Findings of Investigation Investigation (III) As a continuation with our investigations, we furthered Investigation I and tested our generalization (reflected in the diagram in Investigation I), by combining it with the payoffs involved in Investigation II. The payoffs follow the same system as in Investigation II but are different exponents of 10. However, upon application of the same ranking style used in Investigation II, we found that it yielded tables like this N,S / E,W 3, 15 9, 10 11, 5 16, 4 2, 14 -120 120 120 -120 7, 8 -120 -120 -120 -120 12, 6 -120 120 120 -120 13, 1 -120 120 120 -120 Figure 4.1 which were equivalent to what we already had and brought us nowhere. So we applied a different ranking system, with the numbers 1-4 as Rank 1, 5-8 as Rank 2 etc. N E S W 2 3 1 4 7 9 6 5 12 11 8 10 13 16 14 15 Figure 4.2 ∑ 1620 1650 90 -1920 90 270 450 -960 90 270 450 -960 -1920 -1440 -960 -480 ∑ NS/EW 3,4 3,5 3,10 3,15 9,4 9,5 9,10 9,15 11,4 11,5 11,10 11,15 16,4 16,5 16,10 16,15 -1800 2, 1 -210 -180 -150 -120 -150 -120 -90 -60 -150 -120 -90 -60 -120 -90 -60 -30 -1050 2, 6 180 180 -150 -120 -150 -120 -90 -60 -150 -120 -90 -60 -120 -90 -60 -30 -1050 2, 8 180 180 -150 -120 -150 -120 -90 -60 -150 -120 -90 -60 -120 -90 -60 -30 540 2, 14 120 120 120 -120 120 120 120 -60 120 120 120 -60 -120 -90 -60 -30 -1050 7, 1 180 180 -150 -120 -150 -120 -90 -60 -150 -120 -90 -60 -120 -90 -60 -30 -1110 7, 6 150 150 -150 -120 -150 -120 -90 -60 -150 -120 -90 -60 -120 -90 -60 -30 -1110 7, 8 150 150 -150 -120 -150 -120 -90 -60 -150 -120 -90 -60 -120 -90 -60 -30 270 7, 14 90 90 90 -120 90 90 90 -60 90 90 90 -60 -120 -90 -60 -30 810 12, 1 150 150 150 -120 150 150 150 -60 150 150 150 -60 -120 -90 -60 -30 540 12, 6 120 120 120 -120 120 120 120 -60 120 120 120 -60 -120 -90 -60 -30 540 12, 8 120 120 120 -120 120 120 120 -60 120 120 120 -60 -120 -90 -60 -30 0 12, 14 60 60 60 -120 60 60 60 -60 60 60 60 -60 -120 -90 -60 -30 540 13, 1 120 120 120 -120 120 120 120 -60 120 120 120 -60 -120 -90 -60 -30 270 13, 6 90 90 90 -120 90 90 90 -60 90 90 90 -60 -120 -90 -60 -30 270 13, 8 90 90 90 -120 90 90 90 -60 90 90 90 -60 -120 -90 -60 -30 -270 13, 14 30 30 30 -120 30 30 30 -60 30 30 30 -60 -120 -90 -60 -30 Figure 4.3 Table constructed from given hand in figure 4.1 Matrices in Game Strategy Page 24 The optimal strategy in this case would be to find the four pairs of cards each team should play, such that they gain the maximum payoff. By observing the total payoff for all ways of using a pair, and taking into account that each card could only be played once, we found that by applying the generalization for Investigation I, we were still able to deduce the optimal strategy for both players. Thus, the pairs of cards N&S would play are 2,14; 7,8; 12,6; 13,1 and for E&W they would play 3,15; 9,10; 11,5; 16,4. These strategies intersected to give the table below. NS/EW 3,15 9,10 11,5 16,4 2, 14 -120 120 120 -120 7, 8 -120 -90 -120 -120 12, 6 -120 120 120 -120 13, 1 -120 120 120 -120 Figure 4.4 The eight pairs of cards had 24 different ways of being played in all (order not being taken into account), which was found by taking 4! = 4 X 3 X 2 X 1 = 24. We then created a payoff matrix, which showed the average outcome when starting with a certain pair (once again, the order was not taken into account). It looked as such – NS/EW 3,15 9,10 11,5 16,4 2, 14 -150 -80 -70 -150 7, 8 0 -210 -240 0 12, 6 -150 -80 -70 -150 13, 1 -150 -80 -70 -150 Figure 4.5 Using recessive and dominant rows and columns, the matrix can be reduced to NS/EW 3, 15 9, 10 11, 5 2, 14 -150 -80 -70 7, 8 0 -210 -240 Figure 4.6 The pairs 2, 14 and 3, 15 are free to be changed with the eliminated rows and column respectively, as they are actually equal. Applying the Simplex Method, we arrived at NS’s strategy of [275/518 0 15/32 275/518] and EW’s strategy of where the identical rows and columns had equal proportions and it sufficed to look at one. ¾ , ¼ ¾ ¾ The value of this game is –112.5. Looking at NS’s strategy more closely, we discovered that 275/518 and 15/32 did not add up to one, but instead 0.99963803. By Matrices in Game Strategy Page 25 going back to the Simplex applet and solving the matrix again, but using decimals instead of fractions for the tableaus, we found that the slight inaccuracy was attributed to the rounding done during the conversion from decimal to fraction. More accurately, NS’s strategy would be [17/32 0 15/32 17/32]. We managed to tabulate the strategies of six other randomly distributed hands, which are as follow. N E S W N E S W N E S W 3 5 2 1 5 1 4 2 1 4 3 8 2 6 5 11 6 10 4 7 8 7 6 3 11 9 8 9 10 11 12 13 14 15 15 16 14 13 10 9 7 12 12 16 13 14 15 16 v = -30 v = 97.5 NS [¼ ½ ½ ¼ ] EW NS [335/1192 335/714 ¼ 0 ] EW ¼ ¼ ½ ½ N E S W 8 1 12 5 11 4 9 7 13 6 3 14 15 10 2 16 v = 45 ¼ ¼ ½ ½ NS [0 130/513 5/18 15/32] EW ¼ ½ ½ ¼ ½ ½ ¼ ¼ N E S W N E S W 3 5 1 2 6 2 5 1 11 10 4 6 10 4 8 3 12 14 7 9 12 7 9 11 15 16 8 13 13 14 16 15 v = -120 NS [½ ¼ ½ ¼] EW v = -90 NS [70/249 0 15/32 ¼] EW ½ ¼ ½ ¼ v=0 NS [160/569 ¼ 160/341 0] EW ¼ ¼ ½ 0 Figure 4.7 Note: The same problem as stated above occurred in some of our hands, but we were unable to correct them by looking at the decimals. However, they are all within an accuracy of 0.0005. From the examples we created, we saw that whenever a team had matching rows/columns, the strategy would be to the effect of the non-matching rows/columns being ¼ each, while the matching ones would all get the same value such that only adding one of them would give the correct value of 1. However, our first hand contradicted this, so a general assumption would be that for most cases where a team Matrices in Game Strategy Page 26 sees matching rows/columns, a strategy can be applied as above, though it is not always true. Another interesting pattern observed was that the total payoff of each row and column was always the same. Furthermore, Value of Game = Average of payoffs in matrix = Average of 24 ways of play = 4 X Average of payoffs in 2nd table. We found that this was both an easy and a quick way of enabling the players to know the eventual outcome of their game and whose side it leaned towards. Matrices in Game Strategy Page 27 Conclusion Generalizations could be found for Investigation I and III but not completely for Investigation II due to time constraints. In Investigation I, common number sense (backed slightly by saddle points and the Hungarian Method) showed the general optimal strategy for that game model: the EW team played the cards Min [max(East), max(West)] and Min of player holding {max [max(East), max(West)]}, while the N-S team used the same strategy, playing Min [max(North), max(South)] and Min of player holding {max [max(North), max(South)]}. This high-low combination can be reasoned out logically as it implies less wastage. In Investigation II, the simplex method was applied to two hands that we mapped out in order to obtain the payoff matrices. Due to a lack of time, we did not manage to map out more distributions of hands to come up with more examples of optimal strategies for this particular game model. However, given more time, we would have tried out more examples to come up with a generalization or pattern for the optimal strategy as in Investigation I and Investigation III. In Investigation III, we came up with several examples and distributions, and using the Simplex Method to solve them, we saw that for 6 out of the 7 cases, whenever a team had matching rows/columns, the strategy would be to the effect of the nonmatching rows/columns being ¼ each, while the matching ones would all get the same value such that only adding one of them would give the correct value of 1. Thus a general assumption would be that for most cases where a team sees matching rows/columns, a strategy can be applied as above, though it is not always true. From our project, it is possible to see that the optimal strategies to most game models can be solved using matrices. We can also conclude that, once enough examples have been worked out, one can usually find a pattern or general assumption about the optimal strategy of that game model. Matrices in Game Strategy Page 28 References Anton, Howard & Chris Rorres. (2000). Elementary Linear Algebra Applications Version. Canada: Von Hoffman Press, Inc. Eric Weissten’s World of Mathematics. (1999-2002). Matrix - from MathWorld. http://mathworld.wolfram.com/Matrix.html http://people.hofstra.edu/faculty/Stefan_Waner/RealWorld/tutorialsf4/frames4_ 4.html http://people.hofstra.edu/faculty/Stefan_Waner/RealWorld/tutorialsf4/frames4_3.html Acknowledgements ♥ Our teacher-in-charge, Mrs. Sia Wai Leng, for her guidance and support. ♥ Our other teacher advisor, Mr. Kenneth Lui, for his suggestions of related literature. Matrices in Game Strategy Page 29