The Classification of Magic SET Squares
Eric Chen, William Du, Tanmay Gupta, Tanya Khovanova, Alicia Li, Srikar Mallajosyula, Rohith Raghavan, Arkajyoti Sinha, Maya Smith, Matthew Qian, Samuel Wang
TThe Classification of Magic SET Squares
Eric Chen William Du Tanmay Gupta Alicia LiSrikar Mallajosyula Rohith Raghavan Arkajyoti SinhaMaya Smith Matthew Qian Samuel WangPRIMES STEPTanya KhovanovaMITJune 9, 2020
Abstract
A magic SET square is a 3 by 3 table of SET cards such that each row, column,diagonal, and anti-diagonal is a set. We allow the following transformations of thesquare: shuffling features, shuffling values within the features, rotations and reflectionsof the square. Under these transformations, there are 21 types of magic SET squares.We calculate the number of squares of each type. In addition, we discuss a game ofSET tic-tac-toe.
The game of SET is one of the most mathematical games. To play it you need a deck ofspecial cards. Each card has one, two, or three identical objects drawn on it. The objectscould be of three different colors: red, green, or purple. The object can have three differentshapes: oval, diamond, and squiggly. The cards can also differ in shading. There are threetypes of shading: empty, full, and striped.Overall, there are four features: number, shape, color, and shading. And there are threepossibilities for each feature. The total number of cards in the deck is 81. Each card has aunique choice for one of the four features.Three cards can form a set if and only if for every feature all three cards are either thesame or all different. Figure 1 shows an example of a set.All three cards have the same number of objects—1, all the cards have the same shading—striped. All the cards have different colors and different shapes.1 a r X i v : . [ m a t h . HO ] J un igure 1: An example of a set.We say that set A is of order k if there are exactly k features that are different. Theabove example is a set of order 2. For many people, sets of order 1 are easier to see, and setsof order 4 are way more difficult to see.Figure 2 shows a set of order 1, while Figure 3 shows a set of order 4.Figure 2: A set of order 1. Figure 3: A set of order 4.In this paper, we are not interested in the game’s rules, which can be easily found on theInternet. Suffice it to say, that the player who is the fastest to find sets among given cardswins.This game is very mathematical and provides a fun introduction to combinatorics, numbertheory, and linear algebra. One can read about this game in a wonderful book “The Joy ofSET” published in 2016 [1].We can assign a value 0, 1, and 2 to different shapes, numbers, colors, and shadings. Theneach card is represented as a set of four digits. In our internal numbering, we used the digitsto represent features in the order we mentioned: shapes, numbers, colors, and shadings.Also, we assigned 0/1/2 for oval/diamond/squiggle shape; 0/1/2 for number 1/2/3; 0/1/2for red/green/purple for color; 0/1/2 for empty/striped/filled shading. For example, thestring 0000 represents a card with one empty red oval.We can view each digit as a coordinate. Our set of cards becomes a four-dimensionalvector space. As we have only values 0, 1, 2, this four-dimensional vector space has valuesin a field of three elements F and can be denoted as F .What is the value of adding linear algebra to some cards? The beauty of the vectorspace is that we can add vectors. In terms of cards, adding two cards means adding eachcoordinate modulo 3. Now we have a way fancier definition of a set. Three cards form a setif and only if, their sum is 0.We can check that three numbers from the set 0, 1, and 2 sum to zero modulo three ifand only if they are all the same or all different. That means three cards sum up to zero,if and only if, their value in each coordinate is either the same or different. This was thedefinition of a set from the start.In this paper, we are not interested in the game itself, but rather in the magic SETsquares. 2 Magic squares and magic SET squares
Magic squares are squares made out of numbers so that each row, column, and diagonal sumup to the same number. Figure 4 shows an example of a 3 by 3 magic square using digits 1through 9. The common sum in this square is 15.Figure 4: 3 by 3 magic square.We define a magic SET square as a 3 by 3 table of SET cards, so that each row, column,and diagonal forms a set. Figure 5 shows an example of a magic SET square.Figure 5: A magic SET square.A magic SET square can be built starting with three cards, a , b , and c , that do not forma set. We place a in the bottom left corner, b in the bottom right corner and c in the centerof the square. We can calculate all the other cards in this square uniquely. The result is inTable 1. − b − c a + b − c − a − c − a + b + c c a − b + ca − a − b b Table 1: A magic SET square calculated from three cards a , b , and c The reader can check that indeed every row, column, and diagonal forms a set. Forexample, let us see that the cards in the first row form a set. If we sum them up, we get − c which is zero in our addition. 3f you play with magic SET squares you can notice that you can always find some moresets. The total number of sets in a magic SET square is always 12: three sets that form rows,three sets that form columns, three sets that form a diagonal and two broken diagonals, andthree sets that form an anti-diagonal and two broken anti-diagonals. We call each groupa triplet . We have row, column, diagonal and anti-diagonal triplets. Figure 6 shows thepositions of triplets. (a) Columns (b) Rows (c) Diagonals (d) Anti-diagonals Figure 6: Triplets of sets in a magic SET square.Similar to a set, we say that the order of a magic SET square is the number of featuresthat are different in the square. For example, the square in Figure 5 is of order 4 as we havecards of different colors, shapes, shadings, and numbers.The reader might notice that in our example of a magic SET square all the sets in onetriplet have the same order. Is this always the case? Yes, it is always the case.In each triplet the sets are parallel. Two sets A and A (cid:48) are parallel if they differ by avector. That is A (cid:48) = A + d . For example the bottom row in Table 1 is vector { a, − a − b, b } ,while the middle row is {− a + b + c, c, a − b + c } . Subtracting the middle row from the bottomrow we get { a − b − c, − a − b − c, − a + 2 b − c } = {− a − b − c, − a − b − c, − a − b − c } .Parallel sets have the same type for any feature. That is, all of them have either the samevalue or a different value for the same feature. The important conclusion is that parallel setsare of the same order. It follows that each triplet consists of three sets of the same order.You can read more about this in [1].We would like to differentiate squares of the same order. For this purpose, we introducethe notion of diversity. The diversity of a magic SET square is the average order of all itssets. In the example in Figure 5 the rows are order 2: they differ in color and shape. Thecolumns are order 2: they differ in number and shading. The diagonals and anti-diagonalsare order 4. Thus the diversity of this square is 3.Rows and columns are perceived differently. Thus, we introduce the row-column diversity,which we call rc-diversity for short. The rc-diversity of a magic SET square is the averageorder of the sets that form rows and columns of the square. In Figure 5 the rc-diversity is 2.4 The number of sets
The number of sets in the deck is 1080. Now, we count sets of order k . First, we countordered sets. There are (cid:0) k (cid:1) ways to choose features for which the cards are different in thisset. There are 3 ways to choose a value for each feature that is the same, resulting in 3 − k total ways. For each feature that is different, there are 3 ways to choose the value for thefirst card and 2 ways for the second card. Thus, we need to multiply by 6 k . The number ofordered sets is (cid:0) k (cid:1) − k k . Then, for unordered sets, we can shuffle the cards in the set in 6ways. The final answer is (cid:18) k (cid:19) − k k − . Thus we have 4 · · = 108 sets of order 1. Also, 6 · · = 324 sets of order 2.Continuing, we have 4 · · = 432 sets of order 3. And, finally, we have 1 · · = 216sets of order 4.We put these numbers into Table 2.Order Number of sets1 1082 3243 4324 216total 1080Table 2: Number of sets of different orders. We can calculate the total number of magic SET squares as follows. We can pick any twocards for the bottom left and right corners in 81 ·
80 ways. Then there are 78 ways for thecenter card as it shouldn’t form a set with the bottom two cards. The total is: 505440.The magic SET squares of order 1 do not exist. Indeed, if we fix the values for threefeatures, then there are only three cards in a deck with these values. You can’t form a 3 by3 square out of three cards! Thus the magic SET square can only be of orders 2, 3, and 4.Now we calculate the total number of squares of order 2. There are 2 characteristics thatare the same. That means there are (cid:0) (cid:1) = 6 ways to pick these characteristics and nine waysto pick specific values for them. That means there are 6 · · · · − − Given a magic SET square, we can rearrange the cards to make another magic square. Howmany different squares can we make? First, we notice that for any two cards in a square,the card that completes them to a set is also in the square. That means we can pick any twocards for the bottom corners. There are 9 × × Consider the orders of triplets of a magic SET square ( r, c, d, a ), where r/c/d/a represent theorders of rows/columns/diagonals/anti-diagonals correspondingly. We denote the number ofsuch squares as N ( r, c, d, a ). We showed that there are transformations that can shufflefeatures. Suppose s is such a transformation. As such shuffles are one-to-one, we have N ( s ( r ) , s ( c ) , s ( d ) , s ( a )) = N ( r, c, d, a ).We consider magic SET squares with the same set of orders to be of the same type. Wealso consider two magic SET squares of the same type if one can be moved to another by ageometric transformation of the square, that is, by a rotation or reflection.We consider two magic SET squares with triplet orders ( r , c , d , a ) and ( r , c , d , a ) tobe of the same type if the sets { r , c } and { r , c } are the same as well as the sets { d , a } and { d , a } are the same. The reason is that we can swap row and column triplets by reflectingthe square with respect to a diagonal or an anti-diagonal. This transformation keeps thediagonal and anti-diagonal triplets in place. We can swap the diagonal anti-diagonal tripleswith the reflection along the middle row or the middle column. This reflection keeps rowand column triplets in place.Thus we can represent the type of a square by four numbers ( x - y ; z - w ), where x ≤ y and z ≤ w . The numbers x and y represent orders of rows and columns and it doesn’tmatter in which order we use them. The numbers z and w represent orders of diagonals andanti-diagonals and it doesn’t matter in which order we use them. We denote the number ofsquares of type ( x - y ; z - w ) as N ( x - y ; z - w ).What is the connection between the numbers N ( x, y, z, w ) and N ( x - y ; z - w )? The answer:it depends. If x = y and z = w , then both numbers count the same squares and we have8 ( x, y, z, w ) = N ( x - y ; z - w ). If only one equality is true, that is, either x = y or z = w ,then 2 N ( x, y, z, w ) = N ( x - y ; z - w ). Indeed, suppose x = y and z (cid:54) = w , then N ( x - y ; z - w ) = N ( x, y, z, w ) + N ( x, y, w, z ) = 2 N ( x, y, z, w ). If both equalities are false, that is, x (cid:54) = y and z (cid:54) = w , then 4 N ( x, y, z, w ) = N ( x - y ; z - w ). Indeed, N ( x - y ; z - w ) = N ( x, y, z, w ) + N ( y, x, z, w ) + N ( x, y, w, z ) + N ( y, x, w, z ).There is also symmetry between ( x - y ; z - w ) and ( z - w ; x - y ). We already showed how toswap columns and diagonals. In the same way, we can also swap rows and anti-diagonals.If we do both swaps, we have swapped the columns and rows with the diagonals and anti-diagonals correspondingly. Thus the number of magic SET squares of type ( x - y ; z - w ) is thesame as the number of squares of type ( z - w ; x - y ). We start by studying magic SET squares that have 9 cards with two features the same inall of them. We call such squares order-2 squares. This set of cards is uniquely defined bythe values of these two features that are the same. Looking at such nine cards one might seethat the orders or triplets have to be (1 , , ,
2) up to a permutation.All the squares we can make out of these cards have diversity 1.5, and there are threetypes of such squares: (1 −
1; 2 − −
2; 1 − −
2; 1 − · · · · /
432 = 54 different ways to pick a set of cards for the magicSET square of order 2. Suppose we have the cards for the second-order square. Among thesecards, we have 6 first-order sets. Suppose we pick one of the sets for the bottom row andthen shuffle the cards for a particular order in the bottom row. Thus, there are 36 ways topick the bottom row. Now we pick the card in the top left corner. The only condition isthat it has to form a set of the first order with the bottom left card. There are 2 cards likethis. Thus there are 54 · · , , , N (1 −
2; 1 − N (1 −
2; 1 −
2) = 4 N (1 , , ,
2) = 4 N (1 , , ,
2) = 4 N (1 −
1; 2 −
2) = 4 · . Magic squares of order 2 all have diversity 1.5. But there are three types of such squaresand they all have different rc-diversity. The number of the squares of each type are summa-rized in Table 8. Type rc-diversity
We noticed that all magic SET squares of order 2 have the same diversity. Is there a reasonfor that? It is often a great idea to look at each feature separately. Consider a magic SETsquare. What can we say about how one feature can be distributed? Obviously, all the cards10an be the same in this feature. If not, what can we say about the triplets? Suppose ninecards in the square have different shapes. It means there are three diamonds, three squiggles,and three ovals in the square. It means in terms of this feature only one triplet is the sameand three triplets are different. This feature contributes to the diversity of the square.Thus, each feature in which not all cards in the square are the same contributes to thediversity of the square. Remember that a square of order k has k features that are different.That means such a square has diversity k . Table 9 shows the explicit value for the diversityof a square depending on the order. Order diversity2 1.53 2.254 3Table 9: Order and diversity.Now we can go back and see how the orders of triplets must be distributed in each square.The order of a triplet in a square of order k must be between 1 and k inclusive.So, in a square of order 2, the orders of triplets must be either 1 or 2 and have to sumup to 6. The only possibility is 1, 1, 2, and 2.Consider a square of order 3. Each triplet can have order 1, 2, or 3, and the sum of ordersmust be 9. There are two possibilities: { , , , } and { , , , } . For squares of order 4,the sum must be 12. Thus we have the following options: { , , , } , { , , , } , { , , , } ,and { , , , } . We showed that for magic SET squares of order 3, the orders of triplets are either { , , , } or { , , , } .For the sake of practice and example, we show directly that if a square of order 3 has atriplet of order 1, then the orders of triplets must be { , , , } . Without loss of generality,we can assume that rows have order one.Suppose the columns have order 2. The features that are different in row/column tripletshave to be complementary, or the square will not be of order 3. Suppose we take two cardsfrom different rows and columns. They have to differ in all three features. That means thediagonals and anti-diagonals are of order 3.Suppose the columns have order 3. Denote by a the feature that is different in bothcolumns and rows, and by b and c the features that are different in the columns but thesame in the rows. If we pick any two cards that are neither in the same column nor in thesame row, they have to differ in both b and c . But they might be either the same of differentin feature a . That means the other two triplets must be of orders 2 and 3. We proved that if11here is a set of order 1 in a square of order 3, then the orders of triplets must be 1, 2, 3, and3. Looking for each feature separately and using the diversity to find possible distributionswas a simpler way to do this.Thus, if there is a set of order one, the orders of triplets must be 1, 2, 3, 3, and the oneswith orders 1 and 2 must have to be different on complementary features. The diversity ofsuch a square is 2.25. Such squares are of four types: (1-2;3-3), (1-3;2-3), (2-3;1-2) and (3-3;1-2). Examples of such squares are shown in Figure 10, Figure 11, Figure 12, and Figure 13correspondingly.Figure 10: Type (1-2;3-3). Figure 11: Type (3-3;1-2).Figure 12: Type (1-3;2-3). Figure 13: Type (2-3;1-3).First, we calculate the number of magic SET squares of order 3 so that rows are of order1 and columns are of order 2. There are 81 ways to choose the bottom left card. After that,there are 8 ways to choose the bottom right corner: 4 ways to choose the feature that changesin the set and 2 more ways to pick the card from the set for the corner. After that, we needto pick 2 features that differ for the column. They can’t include the feature that is differentfor the row, as otherwise the square will be of order 2. So there are 3 ways to pick thesefeatures. And there are four more ways to pick the values of the features for the top left card.Hence there are 12 ways to pick the top left card, so we have: N (1 , , ,
3) = 81 · ·
12 = 7776.From here we get N (1 −
2; 3 −
3) = N (3 −
3; 1 −
2) = 2 N (1 , , ,
3) = 15552and N (1 −
3; 2 −
3) = N (2 −
3; 1 −
3) = 4 N (1 , , ,
3) = 31104 . Now we consider squares of order 3 that do not contain a set of order 1. We found thatthere are squares where the orders in the groups are 2, 2, 2, and 3. Such squares are of12wo types: (2-2;2-3) and (2-3;2-2). Examples of such squares are shown in Figure 14 andFigure 15 correspondingly.Figure 14: Type (2-2;2-3). Figure 15: Type (2-3;2-2).First, we calculate the number of squares where rows are order 3, and columns are order2. We can pick a set of order 3 for the bottom row in 432 ways, then we can shuffle the cardsin the set in 6 ways. Then, we choose the card in the center of the square. It differs fromthe bottom center card in two features. We can choose these two features out of all threefeatures available in 3 ways. After that, we can choose the specific values for these features in4 ways. Thus we have 432 · · · N (3 , , ,
2) = 15552. Fromhere we have N (2 −
3; 2 −
2) = N (2 −
2; 2 −
3) = 2 N (3 , , ,
2) = 31104 . We summarize the results in Table 10.Type rc-diversity · ·
10 Sharing features between triplets
Now we want to discuss how different triplets share different features.Suppose one triplet has order a and another triplet has order b , and the order of thesquare is k . If both triplets are the same in one feature, then the whole square will have thefixed value in this feature. That means the number of features that are different in at leastone of the triplets is the order of the square. Thus, the number of features that are differentin both triplets must be a + b − k . We call the corresponding features both-different features for the pair of triplets.For one feature that is different in a square, exactly three pairs of triplets are both-different. Moreover, if triplets A and B are both-different in this feature as well as triplets A and C , then B and C are also both different and triplet D has to be the same in thisfeature.For example, consider a magic SET square of order 3 with orders of triplets a , b , c , and d of orders 2, 2, 2, and 3 correspondingly. Then two triplets a and b of order 2 must beboth-different in one feature, say x . But the set of order 3 has to be different in x too. Thatmeans that the triplet c is the same in feature x . We can have a similar argument for otherpairs of triplets of order 2. It follows that three pairs of triplets of order 2 are both-differentin three different features. Let us denote the three features that are different in this squareof order 3 as x , y , and z . Then the following is the distribution of how the features aredifferent in the triplets: xy , xz , yz , and xyz .In Table 11 we show the distribution of features for all types of squares. This is done byusing two principles: a) each feature is either the same in all triplets or is different in exactlythree triplets out of four and b) for any two triplets the size of the union of all features thatare different has to equal to the order of the square.Square order Order dist. Feature dist.2 1, 1, 2, 2 x , y , xy , xy x , yz , xyz , xyz xy , xz , yz , xyz x , yzw , xyzw , xyzw xy , zw , xyzw , xyzw xy , xzw , yzw , xyzw xyz , xyw , xzw , yzw Table 11: Feature distribution.14
We have four cases for distribution of orders between all four triplets: { , , , } , { , , , } , { , , , } , and { , , , } . Now we give examples and calculate the number of sets of eachtype. Figure 16, Figure 17, Figure 18, and Figure 19 show examples of magic SET squares of type(1-3;4-4), (4-4;1-3), (1-4;3-4), and (3-4;1-4) correspondingly.Figure 16: Type (1-3;4-4). Figure 17: Type (4-4;1-3).Figure 18: Type (1-4;3-4). Figure 19: Type (3-4;1-4).First, we calculate the number of squares where each row is order 1, and each column isorder 3. There are 108 ways to choose a set of order 1 for the bottom row and 6 ways ofordering the cards in the set. To choose an order 3 column, the one common feature in thecolumn must be the feature that is different in the order 1 row. That means that there are2 · · Figure 20, Figure 21, and Figure 22 show examples of magic SET squares of type (2-2;4-4),(4-4;2-2), and (2-4;2-4).To start off, we calculate the number of squares where the rows and columns are order 2.We can choose an order 2 set for the bottom row in 324 ways, and there are 6 ways to order15ype rc-diversity · Figure 23, Figure 24, Figure 25, and Figure 26 show examples of magic SET squares of type(2-3;3-4), (3-4;2-3), (2-4;3-3), and (3-3;2-4) correspondingly.To start off, we calculate the number of such squares with rows of order 2 and columns oforder 4. We can choose an order 2 set for the bottom row in 324 ways, and there are 6 waysto order the cards. The card in the center needs to have all features different from the centercard in the bottom row. There are 2 = 16 cards that can go in the center. Multiplying this16igure 23: Type (2-3;3-4). Figure 24: Type (3-4;2-3).Figure 25: Type (2-4;3-3). Figure 26: Type (3-3;2-4).all together, we get 31104. These squares include squares with orders (2,4,2,4) and (2,4,4,2).The number of such squares is a half of the number of squares of type (2-4;2-4). Thus, thetotal number of squares with orders (2,4,3,3) is 31104 − = 15552. From here we get thesummary in Table 14, Type rc-diversity Figure 27 shows an example of a magic SET square of type (3-3;3-3).Suppose the bottom row has feature x the same and other features different. Now weare choosing the center card of the square. It must be different in feature y from the bottomrow to make the square of order 4. Suppose it is the same with the bottom left card infeature z that is different from y and x . Then the center card is the same with the bottomright card in feature w that is different from x , y , and w . There are 6 ways to choose thefeatures for y , z , and w . After that, there are 2 ways to choose the value of the center card17igure 27: Type (3-3;3-3).for feature z . The values for features y , z , and w are uniquely defined. Overall, there are 12ways to choose the center card, after the bottom row of order 3 is placed, for which thereare 432 · ·
12 = 31104, see Table 15.Type rc-diversity .
12 SET tic-tac-toe
Everyone knows how to play tic-tac-toe. But what is its connection to magic squares? If youlook at the magic square in Figure 4, you can see that the straight lines in the square arein one-to-one correspondence with sets of three integers from 1 to 9 that sum to 15. Thatmeans that the game of tic-tac-toe is equivalent to the following game: Players start with apool of nine cards that have the digits from 1 to 9 on them. They take turns taking cardsfrom the pool. The first player who owns three cards that sum up to 15 wins.Now we can define SET tic-tac-toe. Clearly, it should be played using a magic SETsquare as the pool of cards. Similarly to the game of 15, the players take turns picking acard from the pool. The first player who has a SET wins. Equivalently, we can look at it astic-tac-toe where broken diagonals and anti-diagonals are considered a line.Because broken diagonals and anti-diagonals are not valid in the game of 15, SET tic-tac-toe is not the same as the game of 15. Unlike regular tic-tac-toe, SET tic-tac-toe neverends in a draw. Indeed, if all the cards are drawn, the first player has five cards. But it isknown that the largest number of cards in a magic SET square that do not contain a set is4. Thus, the first player must have a set. 18ow we show that the first player can always win after taking not more than 4 cards.Let us call the first player Alice, and the second player Bob. After each of them makes twoturns, each player has two cards. If Alice can choose the card that completes her two cardsto a set, then she wins on her third card. Suppose this is not the case. Then Alice, on herthird turn, has to pick the card that completes the set for the second player, if this card isavailable. Otherwise, Alice can pick any card. Now Alice has three cards that do not forma set, and Bob can’t complete a set on the next move, as Alice has that card.Any two cards have a third card in the square that completes them to a set. As Alicehas three cards not forming a set, there are three cards that can allow Alice to have a set,one per each pair. What is left to show is that Bob can’t have all of these three cards.Let Alice’s cards be a , b , and b , where a is the card that we know completes a set withtwo of Bob’s cards. Let those be c and c . We know that a , c , and c make a set, so a and b cannot form a set with c or c . The same is true for b . Thus, Bob has only one card leftto block a set, and Alice has two ways to create a set using a with b or a with b . Thus awinning card for Alice is available, and she wins on her fourth move.
13 Our classification using groups
Now we use the notion of groups to explain what we are doing. See, for example, [2] formore a comprehensive introduction to group theory.We start with a formal definition.A group is a set, G , together with an operation · which is called multiplication. That is,we can multiply two elements of a group a and b to form another element, denoted a · b or ab . The set and operation, ( G, · ), must satisfy four group axioms: • Closure.
For all a , b in G , the result of the operation, a · b , is also in G . • Associativity.
For all a , b and c in G , ( a · b ) · c = a · ( b · c ). • Identity element.
There exists an element e in G such that, for every element a in G , the equation e · a = a · e = a holds. Such an element is unique and is called theidentity element . • Inverse element.
For each a in G , there exists an element b in G , denoted a − , suchthat a · b = b · a = e , where e is the identity element.We are interested in the following group G that acts on the cards; we want to shufflefeatures and values within one feature. The features can be shuffled in 24 ways. For eachfeature, we can shuffle the values in 6 ways. Thus, the size of our group G is24 · = 31104 . We can use group G to transform any card to any other card. As mathematicians say,all cards are in the same orbit of the group action. Given a card, the subgroup of G that19eeps this card in place is called a stabilizer subgroup of this card. What is the number ofelements, often referred to as the order, of the stabilizer subgroup? Suppose we have one redempty oval on the card. Then, we can make any shuffle of the features. For example, if weswap color and shading as long as empty is swapped with oval, the card stays in place. Inaddition, if the features stay in place, for each feature we can swap two values that are noton the card. For example, we can swap green and purple. That means the stabilizer grouphas order 24 · = 384.Now we use a famous theorem from group theory that states that the number of elementsin an orbit is equal to the size of the group divided by the size of the stabilizer subgroup ofany of the elements in the orbit. As all cards in the deck are in the same orbit, the numberof cards must be 31104 /
384 = 81. We already knew that, but these calculations provide anexample of how group theory might help us.
Now we want to calculate a stabilizer of a set. We start with a set of order 1. As an example,we use the set in Figure 2. In this set the color, the shading, and the shape are the same:the color is purple, the shading is solid, and the shape is diamonds. For each feature thathas the same value for all the cards, we can swap the two values that do not occur, making2 ways in total. In our particular example, we can swap green with red, empty with striped,and ovals with squiggles. We can also shuffle these features as long as we keep the value weneed. For example, we can swap color with shading as long as purple is swapped with solid.There 3! = 6 ways to shuffle the features that are the same. Also, we can shuffle the values ofthe feature that is different in the set, in 3! ways. This is equivalent to reordering the cardsthemselves. So the stabilizer is 2 · ·
3! = 288. Then by dividing we get 31104 /
288 = 108,the number of order 1 sets.We can generalize the example above to calculate the stabilizer of a set of order k . Recallthat k is the number of features that are different in the set. Correspondingly, 4 − k is thenumber of features that are the same in the set. We can swap values that do not appear forfeatures that are the same in the set in two ways for each feature for the total of 2 − k . Wecan swap features that are the same in the set with each other for the total of (4 − k )!. Wecan swap features that are different in the set with each other for the total of k !. Finally, wecan shuffle the cards in the set 3! = 6 ways. Thus, the order of the stabilizer is6 · − k (4 − k )! k ! . Now we explain why all the sets of the same order belong to the same orbit of the group.The cards of an order-1 set can always be written as 0000, 0001, 0002, by assigning differentnumber values to different values of features. This is equivalent to saying that any set oforder 1 belongs to the same orbit as the set written as 0000, 0001, 0002. Thus, two order 1sets belong to the same orbit. The same can be said about order 2, 3, and 4 sets. Order 2sets can always be written as 0000, 0011, 0022, order 3 sets can always be written as 0000,0111, 0222, and order 4 sets can always be written as 0000, 1111, 2222.20s all the sets of the same order belong to the same orbit, the number of different setsof order k is the order of the group divided by the order of the stabilizer. That is, we divide31104 = 24 · by 6 · − k (4 − k )! k !. The result is (cid:18) k (cid:19) − k k − . Not surprisingly, this is the same answer we got before.
When we use an element of this group acting on the cards, the order of each set doesn’tchange. That means when the group acts on the magic square the order of each tripletdoesn’t change.We can also transform any set to any other set of the same order. Can we transform anymagic SET square with the given orders of triplets to any other set square with the sameorders of triplets? Yes, we can. We show it using an example. Suppose the squares havetype 1, 2, 3, 3. From Table 11, the first square has feature distribution x , y z , x y z , and x y z , while the second square has feature distribution x , y z , x y z , and x y z . Ourtransformation should send features x , y , z , and w to x , y , z , and w . After that,we can pick the values of each feature in such a way that the transformation sends the firstsquare to the second square. We can do it for a square of any type in a similar manner.Now we want to find the subgroups of the group that keep a particular magic SET squarefixed. The group can’t change the order of each triple. That means if rows and columns areof different orders we can’t swap them.Consider a magic SET square of order 2. Consider a square of type (1-1;2-2) as inFigure 7. What elements of the group keep it in place? First, we check if we can shufflefeatures. Columns differ only by number, so the number feature together with the values hasto stay in place. Similarly, shape has to be in place. Color and shading have unique valuesin the square, so we can swap them as long as red is swapped with empty. In addition, whilekeeping features in place we can swap green and purple, and also, solid and striped. Thatmeans the stabilizer has order 8. That means the orbit is of size 3888.In general, the procedure is as follows. Suppose a , b , c , and d are the values of the tripletsfor our square of order 4. We can swap features that are the same in (4 − k )! ways. Also, wecan swap the values that are not present in the squares for the features that are the samein 2 − k ways. Now we look at features that are different through the square. We can swapfeatures that are different in the same set of triplets. As each feature is different in exactlythree triplets, it is equivalent to swapping features that are the same in one triplet. Thiscontributes (4 − a )!(4 − b )!(4 − c )!(4 − d )! for the total of2 − k (4 − k )!(4 − a )!(4 − b )!(4 − c )!(4 − d )! . N ( a, b, c, d ) = 3888 · k (4 − k )!(4 − a )!(4 − b )!(4 − c )!(4 − d )! . Not surprisingly, these are the same numbers we got before. Group theory helps to do itfaster and neater.
14 Acknowledgments
This project was done as part of MIT PRIMES STEP, a program that allows students ingrades 6 through 9 to try research in mathematics. Tanya Khovanova is the mentor of thisproject. We are grateful to PRIMES STEP and to its director, Slava Gerovitch, for thisopportunity.
References [1] Liz McMahon, Gary Gordon, Hannah Gordon, and Rebecca Gordon,
The Joy of SET:The Many Mathematical Dimensions of a Seemingly Simple Card Game , Princeton Uni-versity Press, 2016.[2] Nathan C. Carter,