Archive for the ‘Math’ Category.

The Game of SET for Groups (Part 1), jointly with Andrey Khesin

The deck for the game of SET consists of 81 cards. Each card has 1, 2, or 3 identical objects. Each object is an oval, a diamond, or a squiggly, colored in red, green, or purple, and the shading can be solid, striped, or empty. Three cards form a set if, for each feature (number, shape, color, shading), all three are either the same or all different. For example, one red striped squiggly, two red striped ovals, and three red striped diamonds form a set. The numbers are all different (1, 2, and 3); the shapes are all different (squiggly, oval, diamond); the color is the same (red), and the shading is the same (stripped). Another example of a set with all features different is shown in the picture.

A set in the game of SET

For every feature, we can assign values of 0, 1, 2, modulo 3. The fact that the values are the same or all different is equivalent to saying that the values sum up to zero modulo 3. Thus, we can view the cards as points in a 4D vector space over the field F3, namely F34. Three cards form a set if and only if the corresponding vectors sum up to the zero vector. Sets have a very useful property: for any two cards in a deck, there exists a third card that completes the given two cards to a set.

Before we generalize the game of SET, let’s talk about notation. Above, we looked at the values we assign for one feature as the field F3. If we want to talk about vectors, since technically a vector space must be over a field, we could use this definition. However we do not use its multiplicative properties, so we can say that values for one attribute are in Z3. If we want to forget about the exact values, and just use the group structure, we can use notation C3.

Let’s see in what ways we can extend this definition. People have tried to generalize the game of SET to a group. Suppose each card corresponds to an element in a group. Then, we want to arrange three cards so that the corresponding three elements multiply to the identity. If the group is non-commutative, then the order matters. That means the players do not just pick out the three cards, they have to arrange them in a line so that the corresponding product is the identity. However, we still retain a useful property. If our card deck contains all possible elements of the group, then for any two cards in a given order, there exists a card that completes them to a set so that the product is the identity. However, another problem is that this card might be one of the cards we already have. On the plus side, we can rearrange the order of the cards, getting more options. We can also say that a set can consist of any number of cards, not just 3, as long as the product is the identity.

The Numberphile video The Game of Set (and some variations) shows examples of such games. One of the decks they show represents the group S3: permutations of 3 elements. The picture shows a screenshot from the video with a set in a different group, but if you ignore the blue beads, you will get a set in S3. The red dots at the bottom mark odd permutations. This helps see sets faster: each set has to have an even number of red dots. This deck is a toy example of what is possible with only 6 elements in the group.

The identity in the group SET

They also show a similar deck corresponding to group S4: permutations of 4 elements. Thus, the deck size is 24. Despite the size not being very big, the video claims that the game is tough to play. One more deck represents two permutations of 3 elements, and one must get to the identity on both of them. Thus, the deck size is 36, and the underlying group is S32. These games are sometimes called Non-abelian sets. A third deck is a deck with three crossing lines with beads. The crossing lines correspond to permutations of three elements, and each string either has a bead or not. To get to the identity, you need an even number of beads on each line. Thus, the deck size is 48 and corresponds to the group that is called the wreath product of S3 and C2, where Cn is the cyclic group with n elements. The wreath product is used because a copy of C2, each of the beads, is associated with each of the three lines that the first group, S3, is acting on.

The screenshot from the video we mentioned corresponds to this group, showing four cards forming a set. The red dot at the bottom signals the parity of a permutation, and there has to be an even number of them, but you can ignore them. However, the meaningful dots are small blue dots on some lines, and there has to be an even number of them on each line.

In practice, one card in each deck will contain the group identity, so this card is typically removed from such games. Leaving it in would allow anyone to add it to any other set they found, getting a free point (if the score is the number of cards for each set). Thus, the actual deck size contains 1 fewer card than the corresponding group.

One famous example of such an extension of SET that wasn’t shown in the Numberfile video is often called “ProSet” (short for Projective Set). It is usually marketed under other names, for example, “Socks”. It is played on the group F26 with the identity card removed, making the deck 63 cards. The cards each contain some non-empty subset of 6 colored dots/socks. A set is any group of cards where each color appears an even number of times. This is equivalent to adding vectors in F26 and having them add to the identity: the zero vector. Since the group operation is addition, which is commutative, the sets found do not need to be in a particular order. The picture shows a set in the game of Socks.

The identity in the game of Socks

However, there is a fundamental difference between the classic game of SET and the extensions we have talked about. No card in the SET deck obviously corresponded to the identity and had to be removed. It is almost as if the SET group “forgot” about its identity element. A group that has “forgotten” about its identity can be informally called a torsor. A torsor has a more sophisticated definition, but this casual one will do for our purposes. We also note that SET sets always contain exactly three cards. The sets have the following property: if we had chosen a particular assignment of the values of 0, 1, and 2 to each property, as in the Numberphile video, we would find that changing this assignment would have the following effect: if the initial set has all attributes different, the set will not change; if the attributes are all the same, each value would be shifted by the same shift s. The sum would thus be shifted by 3s = 0, as we look at everything mod 3.

Another affine game is a game of EvenQuads played on a deck of size 64. Each card has 3 attributes with 4 values each. Each card has symbols of a color (red, yellow, green, or blue), a shape (spiral, polyhedron, circle, square), and a quantity (from 1 to 4). The set, called quad in this game, consists of four cards such that for each feature, one of three things is true: 1) all of the cards are the same, 2) all of the cards are different, and 3) the card’s values are divided fifty-fifty. The picture shows the set in this game.

The set in EvenQuads

Can we extend the notion of a torsor to ProSet? The answer is yes! EvenQuads is almost equivalent to the game of ProSet: you just need to pick the card corresponding to the origin and only allow sets with four cards. The four values of each attribute in EvenQuads represent all possible values of 2 different socks in ProSet/Socks. With 3 attributes, we can express all possible values of 6 dots/socks. This is more restrictive than the set that we could choose in ProSet, but the advantage is that our deck is now completely free of a choice of a particular identity value. ProSet can be used to play EvenQuads and vice versa (with the exception of the identity card); the “torsor-ness” of EvenQuads makes the definition of a set cleaner. Indeed, a set in EvenQuads is not any set of cards that forms a set in ProSet. See more about how different famous card games are equivalent to each other in the paper Card Games Unveiled: Exploring the Underlying Linear Algebra.

At this point, it is worth noting that nothing about the games of SET, ProSet, or EvenQuads requires the exact dimension chosen. The game of SET uses C3 as an underlying group and chooses to use 4 copies of it. Both ProSet and EvenQuads use 6 copies of C2. The choice of dimension, the number of copies, is usually made with practical considerations in mind to make the number of cards in the deck, 81 and 64, respectively, to be of a reasonable quantity. However, to design a new game, we only have to verify that the underlying group is satisfactory, and only then do we need to fix a dimension.

So, how would we generalize further? If each attribute was an element of Z4 instead of Z22, would that work? Recall that in the game of SET, we require three cards to sum to zero in Z32. In ProSet and EvenQuads, we also require the cards to sum to zero in Z26, where in ProSet, we use any number of cards, and in EvenQuads, we use four cards. Coming back to Z4, suppose we announce that x cards form a set if their sum is zero. If we want the cards that are all the same in each feature to form a set, we need x to be divisible by 4. If we choose x to be 4, we will lose the ability to select “all different” as a valid combination of attributes since 0+1+2+3 = 2 mod 4. Any other x that is divisible by 4 is too big to play. And in any case, we lose symmetry between different values. For example, when the attributes are divided fifty-fifty, sometimes they sum to zero, as in 1+1+3+3, and sometimes not, as in 1+1+2+2.

Is this it? Should we stop there? Let’s not. Let’s check Z5. To allow all cards to be the same, we will claim that sets must have 5 cards. The good news is that 0+1+2+3+4 = 0 mod 5. Suppose we define the set as 5 cards that sum to zero modulo 5. The big question is, can we define the rule without assigning the exact values to each attribute? Let’s look at an example of a set: 0,0,0,2,3. We can’t claim a set to be three of the same values, and two others are different. However, if we specify a relative order of our elements and allow 0,0,0,2,3 to be a set, then together with it, all shifted sequences correspond to a set; for example, shifting by 1 produces 1,1,1,3,4.

In particular, to make a game based on Z5, we can demand that our sets consist of 5 cards that add to the identity. The fact that each set has 5 cards means that we can use a torsor and do not need to explicitly specify the identity. If we represent our 5 attributes as points on a pentagon or lines pointing in one of 5 directions, we observe a remarkable pattern: the 5 values add to 0 exactly when there is a line of symmetry in the chosen attributes! Below, we see all possible ways to add 5 values mod 5 and arrive at 0, up to rotations. As an example, if we chose 3+2+1+2+2=0 mod 5, we would see that this corresponds to the second symmetry in the picture, which we can view as drawing an axis of symmetry “through the 2”.

Set modulo 5

This is a property unique to the number 5, and also for numbers smaller than 4. This is not true for larger sizes of groups; for example, 0+0+0+1+2+3=6 has no symmetries in Z6. Number 4 represents an interesting case. If we represent our 4 attributes as points on a square or lines pointing in one of 4 directions, we observe that when the 4 values add to 0, there is a line of symmetry in the chosen attributes. However, in the case of values 0, 0, 3, 3, or, 0, 1, 2, 3, there is a line of symmetry, but the values do not sum to zero.

So we have shown that a torsor of C5, the cyclic group of 5 elements, might make for a convenient group on which to play a variant of SET. A reasonable choice of dimension might be 3, making a deck of size 125. This game would then be played on a C53-torsor. This inspired the name of this game as, this has been shortened to C53T, pronounced “C-Set”. To illustrate a card, we use pentagons with an indicated vertex to denote an element of C5. We need 3 pentagons, one for each dimension. To help players work around the fact that cards often get turned around, each direction on each pentagon is assigned a color to help players tell them apart better. Additionally, the three pentagons are shaded to clarify which pentagon corresponds to each dimension. In the image below, we see a C53T set, where the symmetric axes in each of the three dimensions go through the red, orange, and “any” axes from top to bottom.

A set in C53T

This and many other games can be found on tsetse website. The website has a description, and also allows for a solitaire play.

Finding sets in C53T is extremely hard, so this is not a game for casual players, but it does serve to illustrate what really makes a set a set. In everything discussed in this blog post, we either used a group with a clear identity (such as in the Numberphile video) or a commutative operation (such as in C53T). Is there any way to have a non-abelian group torsor to play a variant of SET? The answer is yes, but that is a story for another day.


Share:Facebooktwitterredditpinterestlinkedinmail

Foams Made out of Felt

A foam is a finite 2-dimensional CW-complex with extra properties. This one opening sentence is already more advanced than any of my usual blog posts. Let me define a finite 2-dimensional CW-complex in layman’s terms.

To construct such a CW-complex, we can start with a bunch of discrete points. This will be the 0-dimensional part of our future CW-complex. To continue, we glue-in segments between some pairs of points, making the whole thing into a 1-dimensional CW-complex. We can view such a complex as a graph. Now, what we have left to do is glue some disks in. There are two ways to do it. First, we can take the disk’s border and attach it to one of the points. Second, we can glue the border of the disc to a cycle in a graph.

The previous paragraph explained how to construct a finite 2-dimensional CW-complex. Foams have additional properties. Given a point in the CW-complex, its neighborhood needs to be homeomorphic to one of three objects:

  1. An open disc. Such points are called regular points. These are any points from inside of the discs.
  2. The product of a tripod and an open interval. Such points are called seam points. These are any points from inside of the segments. To meet the tripod condition, all the segments have to attach themselves to three discs.
  3. The cone over the 1-skeleton of a tetrahedron. Such points are called singular vertices. This means our starting vertices can’t remain unattached. The underlying 1-skeleton of our complex has to be a 4-regular graph (each vertex has to have degree 4). Moreover, any two edges coming from the same vertex must be on a disc’s border.

Some of the coolest foams are tricolorable. A foam is called tricolorable if it is possible to color its faces each in its own color by using three colors total so that at the seams, the faces of all three colors meet.

I first heard about foams during my brother Mikhail Khovanov’s lecture. He made a fascinating claim about tricolorable foams. If you remove regular points of a particular color from a foam, then the neighborhood of each point is an open disc. I was so curious, I decided to make a physical model. My readers know I hate crocheting, so I thought making a model out of felt would be easier. Thus, I made a tricolored neighborhood of a singular point. The two pictures show the same model from different angles.

Foam
Same foam

Then, I needed to check my brother’s statement and made the same model with one color attached to the foam by zippers. This way, I can actually unzip one color and see the result. This color in real life is neon-green but looks yellowish in the pictures.

Foam with zippers
Foam with one color removed

Guess what? The result was a smooth neighborhood isomorphic to an open disc. My brother was right!


Share:Facebooktwitterredditpinterestlinkedinmail

Fibonometry

The term fibonometry was coined by John Conway and Alex Ryba in their paper titled, you guessed it, “Fibonometry”. The term describes a freaky parallel between trigonometric formulas and formulas with Fibonacci (Fn) and Lucas (Ln) numbers. For example, the formula sin(2a) = 2sin(a)cos(a) is very similar to the formula F2n = FnLn. The rule is simple: replace angles with indices, replace sin with F (Fibonacci) and cosine with L (Lucas), and adjust coefficients according to some other rule, which is not too complicated, but I am too lazy to reproduce it. For example, the Pythegorian identity sin2a + cos2a = 1 corresponds to the famous identity Ln2 – 5Fn2 = 4(-1)n.

My last year’s PRIMES STEP senior group, students in grades 7 to 9, decided to generalize fibonometry to general Lucas sequences for their research. When the paper was almost ready, we discovered that this generalization is known. Our paper was well-written, and we decided to rearrange it as an expository paper, Fibonometry and Beyond. We posted it at the arXiv and submitted it to a journal. I hope the journal likes it too.


Share:Facebooktwitterredditpinterestlinkedinmail

Fibonacci Tricks

Consider the following Fibonacci trick. Ask your friends to choose any two integers, a and b, and then, starting with a and b, ask them to write down 10 terms of a Fibonacci-like sequence by summing up the previous two terms. To start, the next (third) term will be a+b, followed by a+2b. Before your friends even finish, shout out the sum of the ten terms, impressing them with your lightning-fast addition skills. The secret is that the seventh term is 5a+8b, and the sum of the ten terms is 55a+88b. Thus, to calculate the sum, you just need to multiply the 7th term of their sequence by 11.

If you remember, I run a program for students in grades 7 through 9 called PRIMES STEP, where we do research in mathematics. Last year, my STEP senior group decided to generalize the Fibonacci trick for their research and were able to extend it. If n=4k+2, then the sum of the first n terms of any Fibonacci-like sequence is divisible by the term number 2k+3, and the result of this division is the Lucas number with index 2k+1. For example, the sum of the first 10 terms is the 7th term times 11. Wait, this is the original trick. Okay, something else: the sum of the first 6 terms is the 5th term times 4. For a more difficult example, the sum of the first 14 terms of a Fibonacci-like sequence is the 9th term times 29.

My students decided to look at the sum of the first n Fibonacci numbers and find the largest Fibonacci number that divides the sum. We know that the sum of the first n Fibonacci numbers is Fn+2 – 1. Finding a Fibonacci number that divides the sum is easy. There are tons of cute formulas to help. For example, we have a famous inequality F4k+3 – 1 = F2k+2L2k+1. Thus, the sum of the first 4k+1 Fibonacci numbers is divisible by F2k+2. The difficult part was to prove that this was the largest Fibonacci number that divides the sum. My students found the largest Fibonacci number that divides the sum of the first n Fibonacci numbers for any n. Then, they showed that the divisibility can be extended to any Fibonacci-like sequence if and only if n = 3 or n has remainder 2 when divided by 4. The case of n=3 is trivial; the rest corresponds to the abovementioned trick.

They also studied other Lucas sequences. For example, they showed that a common trick for all Jacobsthal-like sequences does not exist. However, there is a trick for Pell-like sequences: the sum of the first 4k terms (starting from index 1) of such a sequence is the (2k + 1)st term times 2P2k, where Pn denotes an nth Pell number.

You can check out all the tricks in our paper Fibonacci Partial Sums Tricks posted at the arXiv.

Share:Facebooktwitterredditpinterestlinkedinmail

The 5-Card Trick, the 4-Card Trick, and the 3-Card Trick

The famous 5-card trick begins with the audience choosing 5 cards from a standard deck. The magician’s assistant then hides one of the chosen cards and arranges the remaining four cards in a row, face up. Upon entering the room, the magician can deduce the hidden card by inspecting the arrangement. To eliminate the possibility of any secret signals between the assistant and the magician, the magician doesn’t even have to enter the room — an audience member read out the row of cards.

The trick was introduced by Fitch Cheney in 1950. Here is the strategy. With five cards, you are guaranteed to have at least two of the same suit. Suppose this suit is spades. The assistant then hides one of the spades and starts the row with the other one, thus signaling that the suit of the hidden card is spades. Now, the assistant needs to signal the value of the card. The assistant has three other cards than can be arranged in 6 different ways. So, the magician and the assistant can agree on how to signal any number from 1 to 6. This is not enough to signal any random card.

But wait! There is another beautiful idea in this strategy — the assistant can choose which spade to hide. Suppose the two spades have values X and Y. We can assume that these are distinct numbers from 1 to 13. Suppose, for example, Y = X+5. In that case, the assistant hides card Y and signals the number 5, meaning that the magician needs to add 5 to the value of the leftmost card X. To ensure that this method always works, we assume that the cards’ values wrap around. For example, king (number 13) plus 1 is ace. You can check that given any two spades, we can always find one that is at most 6 away from the other. Say, the assistant gets a queen of spades and a 3 of spades. The 3 of spades is 4 away from the queen (king, ace, two, three). So the assistant would hide the 3 and use the remaining three cards to signal the number 4.

I skipped some details about how permutations of three cards correspond to numbers. But it doesn’t matter — the assistant and the magician just need to agree on some correspondence. Magically, the standard deck of cards is the largest deck with which one can perform this trick with the above strategy.

Later, a more advanced strategy for the same trick was introduced by Michael Kleber in his paper The Best Card Trick. The new strategy allows the magician and the assistant to perform this trick with a much larger deck, namely a deck of 124 cards. But this particular essay is not about the best strategy, it is about the Cheney strategy. So I won’t discuss the advanced strategy, but I will redirect you to my essay The 5-Card Trick and Information, jointly with Alexey Radul.

Mathematical Card Magic: Fifty-Two New Effects

63 years later, the 4-card trick appeared in Colm Mulcahy’s book Mathematical Card Magic: Fifty-Two New Effects. Here the audience chooses not 5 but 4 cards from the standard deck and gives them to the magician’s assistant. The assistant hides one of them and arranges the rest in a row. Unlike in the 5-card trick, in the 4-card trick, the assistant is allowed to put some cards face down. As before, the magician uses the description of how the cards are placed in a row to guess the hidden card.

The strategy for this trick is similar to Cheney’s strategy. First, we assign one particular card that the magician would guess if all the cards are face down. We now can assume that the deck consists of 51 cards and at least one of the cards in the row is face up. We can imagine that our 51-card deck consists of three suits with 17 cards in each suit. Then, the assistant is guaranteed to receive at least two cards of the same imaginary suit. Similar to Cheney’s strategy, the leftmost face-up card will signal the imaginary suit, and the rest of the cards will signal a number. I will leave it to the reader to check that signaling a number from 1 to 8 is possible. Similar to Cheney’s strategy, the assistant has an extra choice: which card of the two cards of the same imaginary suit to hide. As before, the assistant chooses to hide the card so that the value of the hidden card is not more than the value of the leftmost face-up card plus 8. It follows that the maximum number of cards the imaginary suit can have is 17. Magically, the largest possible deck size for performing this trick is 52, the standard deck of cards.

Last academic year, my PRIMES STEP junior group decided to dive deeper into these tricks. We invented many new tricks and calculated their maximum deck sizes. Our cutest trick is a 3-card trick. It is similar to both the 5-card trick and the 4-card trick. In our trick, the audience chooses not 5, not 4, but 3 cards from the standard deck and gives them to the magician’s assistant. The assistant hides one of them and arranges the other two in a row. The assistant is allowed to put some cards face down, as in the 4-card trick, and, on top of that, is also allowed to rotate the cards in two ways: by putting each card vertically or horizontally.

We calculated the maximum deck size for the 3-card trick, which is not 52, as for the 5- and 4-card trick, but rather 54. Still, this means the 3-card trick can be performed with the standard deck. The details of this trick and other tricks, as well as some theory, can be found in our paper Card Tricks and Information.


Share:Facebooktwitterredditpinterestlinkedinmail

The 5-Card Trick and Information, jointly with Alexey Radul

The famous 5-card trick begins with the audience choosing 5 cards from a standard deck. The magician’s assistant then hides one of these cards and arranges the remaining four cards in a row, face up. On entering the room, the magician can deduce the hidden card by inspecting the arrangement. To eliminate the possibility of secret signals between the assistant and the magician, the magician needn’t even enter the room — an audience member can call them and read out the row of cards.

We will not delve into the mechanics of the trick, which are widely available online. Instead, we will explore the information theory underlying it. Michael Kleber’s paper, The Best Card Trick, provides an information-theoretic argument that works as follows:

For a deck of N cards, the number of different messages the magician can receive is N(N-1)(N-2)(N-3). The magician must guess the hidden card, which is equivalent to determining the set of five cards chosen by the audience. The number of such sets is N choose 5. For the trick to work, the number of messages must not exceed the number of possible answers, leading to the inequality: (N choose 5) ≤ N(N-1)(N-2)(N-3). After some manipulation, we get that (N-4)/120 doesn’t exceed 1. This implies that the deck can have at most 124 cards. The bound turns out to be tight: as discussed in Kleber’s paper, the trick can still be performed with such a huge deck. The paper expands this argument to a trick with K instead of 5 cards and shows that the maximum deck size for such a trick is K! + K – 1.

Here, we want to present a more direct, intuitive argument. We will make the argument for the 5-card trick, which is easily generalizable to the K-card trick. The assistant has 5 ways to choose which card to hide and 24 ways to arrange the remaining four cards, so they only have 120 actions in any given situation. Ergo, the magician should only be able to extract 120 alternatives’ worth of information from knowing what action the assistant would take.

This is a bit fishy, because of course even with N > 120, the trick could happen to work sometimes. That is, if the magician tells the assistant the strategy by which they will guess the missing card, the assistant may, for some sets of 5 cards drawn even from a large deck, manage to show an arrangement of four that will lead the magician to guess correctly.

The crux of formalizing the argument is to move to the global view, but we can do that without additional computations. Consider the space of all states reachable by any strategy of the assistant. In our case, this is equivalent to ordered sequences of five cards, with the last face down. There are obviously (N-4)M of these, where M is the number of states the magician observes (four-card sequences, in our case), however many of those there are. When the assistant and the magician choose a strategy for the assistant, they make most of these impossible. Indeed, since the assistant always has exactly 120 options, after they have chosen one to take in each situation, we have exactly (N-4)M/120 states that remain possible with that strategy. For the trick to always work, this last expression must be no more than M; M cancels, saving us the trouble of computing it, and we are left with N-4 ≤ 120 as desired.

By the way, one of the authors of this essay, Tanya Khovanova, taught this trick to her PRIMES STEP students, who were students in grades 7 through 9. They found and studied interesting generalizations of this trick and wrote the paper Card Tricks and Information available at the arXiv. They studied many variations of the trick, including the ones where the assistant is allowed to put the cards face down. This interesting variation is outside the scope of this essay.

We would like to use as an example one of the tricks described in the paper: the K-card trick, where the assistant hides one card and arranges the rest in a circle. The implication is that when the audience member describes the arrangement to the magician, they describe the circle clockwise in any order. Our argument works here as follows. We count the number of the assistant’s actions: K ways to choose the hidden card and (K-2)! ways to arrange the cards in different circles up to rotation. Thus, the number of different actions is K(K-2)!. Hence, the deck size doesn’t exceed K(K-2)! + K – 1, as we can exclude the K-1 cards in the circle, as they aren’t hidden. Not surprisingly, this is the same formula as in the paper.


Share:Facebooktwitterredditpinterestlinkedinmail

Fractal Word Search

The puzzle In the Details by Derek Kisman is one of my favorite MIT Mystery Hunt puzzles of all times. I even wrote a blog post advertising it and another post with comments on the solution. This puzzle type became known as fractal word search.

In the standard word search, you have a grid of letters and a list of words. You need to find the words written in the grid in all eight directions. The unused letters provide the answer, or a clue to the answer, of the word search puzzle.

In the fractal word search, you have a grid of letters and a list of words. It looks like a regular word search, but you will not find all the words inside the given grid. The given grid is only a snapshot of the whole grid on some particular level k. To go to level k+1, you have to use replacement rules: each letter is replaced by a 2-by-2 block of letters. This creates a much bigger grid where you might find more words from the given list.

An interesting question is, where do you find the replacement rules? In Derek’s puzzle, the rules were not given, but the initial grid was level 2. So you could notice that this grid can be decomposed into 2-by-2 squares, and there are only 26 different squares, implying that each square corresponds to a letter. Assuming that replacing the 2-by-2 squares with correct letters will allow you to find more words from the list, you can decipher the replacement rules. This will allow you to get to level 1 as well as any other level. Small levels are easy to search, but on large levels, the grid gets so huge that it might not fit in the memory of a computer, or a million computers. That is why this puzzle was presented at the MIT mystery hunt, but not at any other puzzle hunt. It is quite difficult: one of the given words is hiding on level 86.

I liked the puzzle so much, I included it in one of my lectures. After I gave my talk at Brown University, a student, Klára Churá, approached me. She got as fascinated with the puzzle as I was. We ended up collaborating on the paper Fractal Word Search: How Deep to Delve. As the title suggests, we focused on finding the upper bound of the level where we could find a word of a given length. We had two parameters: the size of the alphabet n and the block size b used in the replacement rules.

For different reasons, the most interesting case is words of length 3. I will leave it to the reader to figure out why this is the most interesting case, or the reader can check our paper. We showed that any word of length 3 appears no later than level n3 + n2 + 1.

When we posted the paper, I sent the link to Derek. He immediately wrote a program and showed that our bound is fairly tight. His code is available at GitHub. He created a configuration that puts a 3-letter word at depth LCM(a,b,c)+1, where a,b,c ≤ n-3. If n is even, this gives us a lower bound of (n-3)(n-4)(n-5) + 1. If n is odd, this gives us a lower bound of (n-4)(n-5)(n-6) + 1. In any case, asymptotically, it is very close to our upper bound.

Share:Facebooktwitterredditpinterestlinkedinmail

Tesseracts and Foams

Foams are a recent craze in homology theory. I want to explain what a foam is using a tesseract as an example. Specifically, the 2D skeleton of a tesseract is a foam.

We can view a tesseract as a convex hull of 16 points in 4D space with coordinates that are either 0 or 1. The edges connect two vertices with the same three out of four coordinates. Faces are squares with corners being four vertices that all share two out of four coordinates.

Foam definition. A foam is a finite 2-dimensional CW-complex. Each point’s neighborhood must be homeomorphic to one of the three objects below.

  1. An open disc. Such points are called regular points.
  2. The product of a tripod and an open interval. Such points are called seam points.
  3. The cone over the 1D-skeleton of a tetrahedron. Such points are called singular vertices.

My favorite example of a foam is a tesseract. Or, more precisely, the set of tesseract’s vertices, edges, and faces form a foam.

  1. The regular points are the insides of the tesseract’s faces. Their neighborhoods are obviously open discs.
  2. The seam points are the insides of the tesseract’s edges. Each edge is incident to three faces, and the projection of its neighborhood to a plane perpendicular to the edge is a tripod.
  3. The singular vertices are the tesseract’s vertices. Each vertex is incident to four edges and six faces. We can view this neighborhood as a cone cover of a tetrahedron formed by this vertex’s neighbors.

Some of the coolest foams are tricolorable. A foam is called tricolorable if we can color it using three colors in such a way that each face has its own color, and any three faces that meet at a seam are three distinct colors.

Tesseract

Not surprisingly, I chose a tricolorable foam for our example. Let me prove that the tesseract’s 2D skeleton is tricolorable. We start by coloring the edges in four colors depending on the direction: red, green, blue, or gray, as in the first picture (source: Wikipedia). Each face has two pairs of edges of two different colors. We can color the faces in the following manner: if none of the edges are gray, then the face color is the complementary non-gray color (For example, if the edges are red and blue, the face is green). If the edges are gray and one other color, then the face color matches the non-gray color (For example, if the edges are red and gray, the face is red). I leave it to the reader to prove that this coloring means that each edge is the meeting point of three different face colors.

Here is an interesting property of tricolorable foams. It is Proposition 2.2 in the paper Foam Evaluation and Kronheimer-Mrowka Theories, by Mikhail Khovanov and Louis-Hardien Robert.

Proposition. If we remove the regular points of one particular color from a tricolored foam, we will get a closed compact surface containing all the seam points and singular vertices.

Torus of 2 colors
Torus of 2 colors

In our example, the result is a torus, which you can recognize in the second picture. Here, I use the Schlegel diagram as a model for a tesseract, shown on the right (source: Wikipedia). The exercise for the reader is to explain where the eight green faces of the torus were before they were removed.

The following lemma from the aforementioned paper describes another cool property of a tricolorable foam.

Lemma. If a foam is tricolorable, its 1D skeleton (the graph formed by seams and singular points) is bipartite.

And, surely, I am leaving it up to the reader to check that the tesseract’s 1D skeleton forms a bipartite graph.


Share:Facebooktwitterredditpinterestlinkedinmail

SOS

My PRIMES STEP program consists of two groups of ten students each: the senior group and the junior group. The senior group is usually stronger, and they were especially productive last academic year. We wrote four papers, which I described in the post EvenQuads at PRIMES STEP. The junior group wrote one paper related to the game SOS. The game was introduced in the following 1999 USAMO problem.

Problem. The game is played on a 1-by-2000 grid. Two players take turns writing an S or an O in an empty square. The first player who produces three consecutive squares that spell SOS wins. The game is a draw if all squares are filled without producing SOS. Prove that the second player has a winning strategy.

The solution is quite pretty, so I do not want to spoil it. If my readers want it, the solution for this grid, and, more generally, for any grid of size 1-by-n, is posted in many places.

My students studied generalizations of this game, and the results are posted at the arXiv: SOS. We tried different target strings and showed that:

  • The SOO game is always a draw.
  • The SSS game is always a draw.
  • The SOSO game is always a draw.

Then, we tried a version where the winner needed to spell one of two target strings. We showed that:

  • The SSSS-OOOO game is always a draw.

We tried several more elaborate variations, but I want to keep this post short.

Share:Facebooktwitterredditpinterestlinkedinmail

EvenQuads at PRIMES STEP

I love the game of SET, where you have a specialized deck of 81 cards. The image on each card has four features: color, shape, shading, and the number of objects. Each feature can have three possible values. Three cards form a set if, for every feature, the values on the cards are either all the same or all different. One of the best properties of the sets is that, given any two cards, we can calculate the third card that would complete a set.

If we look at the game mathematically, we can assign a number 0, 1, or 2 for every feature value. For example, green could be 0, purple could be 1, and red could be 2. Then, the condition that, given a feature, three cards are either all the same or all different is equivalent to saying that the sum of the values modulo 3 is zero.

A mathematician would wonder, can we make a new game where we take values modulo 4? Each feature value should correspond to 0, 1, 2, or 3. For example, we can add a yellow color corresponding to number 3. The new “set” should be four cards such that the sum of the values modulo 4 is 0. This condition guarantees that any three cards could be uniquely completed into a “set”. But such a game is inelegant. For example, one green, two purple, and one red card will form a set. But one green, one purple, and two red will not. The symmetry between colors is lost.

I decided that there is no good analog for the game of SET that is played modulo 4. I was wrong. Here is a new game called EvenQuads. I heard about it at the 2022 MOVES conference.

The deck consists of 64 cards with three features: color, shape, and the number of objects. There are four values for each feature. Four cards form a quad if, for every feature, the values are all the same, all different, or half-and-half.

Quad Example

For example, the figure above shows a quad where, for each feature, all values are different. To get familiar with quads, here is a puzzle for you. How many quads can you find in the picture below?

Find Quads

The game proceeds in a similar way to the game of SET. You can find out more about EvenQuads at the EvenQuads website.

I picked this game as a research project for my senior STEP group. As many of you know, I have a program where we conduct mathematical research with students in grades 7 through 9. The group started in the fall of 2022 and was extremely productive. We wrote FOUR papers in an academic year, which is obviously our record. The papers can be found at the arXiv.

  • In Card Games Unveiled: Exploring the Underlying Linear Algebra, we analyze four games related to linear algebra: SET, EvenQuads, Socks, and Spot It!. The games are so connected to each other that sometimes it is even possible to play one game using the cards from another game.
  • In Quad Squares, we study semimagic, magic, and strongly magic quad squares made out of EvenQuads cards. A semimagic quad square is a 4-by-4 square in which each row and column form a quad. You can guess what a magic quad square is. The idea was inspired by magic SET squares: 3-by-3 squares where each row, column, and diagonal form a set. A magic SET square has an additional property: there are always four more sets in such a square located on broken diagonals. In other words, consider three cards and their coordinates in a square. These cards form a set if and only if the values of each coordinate are either all the same or all different. This property is stronger than the definition of a magic SET square. In the case of the game of SET, these two definitions are the same. However, for EvenQuads, we get two different definitions. This is how we ended up defining strongly magic quad squares. You can find the details in the paper.
  • In EvenQuads Game and Error-Correcting Codes, we describe error-correcting codes based on a set of EvenQuads cards.
  • In Maximum Number of Quads, we calculate the maximum possible number of quads, given n cards from an EvenQuads deck. For example, the puzzle pictured above is actually an example of the maximum possible number of quads among 7 cards. We generalize this idea to decks of any size. Unfortunately, our formula is based on a conjecture. Though, we strongly believe that our formula is correct.

My students did a great job.


Share:Facebooktwitterredditpinterestlinkedinmail