ebook img

Nice Neighbors: A brief adventure in mathematical gamification PDF

0.39 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Nice Neighbors: A brief adventure in mathematical gamification

Nice Neighbors: A brief adventure in mathematical gamification P. Christopher Staecker∗ 6 1 February 11, 2016 0 2 n Last year I came across a strange graph theory we will think of as a set of 38 points. (Pappy was a problem in digital topology and decided to turn it named with help from my young daughters, because J intoalittlevideogame,tohelpwrapmymindaround he’s purple and happy.) 3 1 it. It turned out to be pretty fun, so I made it into a Digital images like this don’t exactly obey the tra- web game that other people could play. I took 3500 ditional laws of Euclidean geometry and topology. O] specificmathproblemsandmadeeachoneintoalevel For instance we can have two points of Pappy which of the game, and I waited to see if people would play arerightnexttoeachotherwithnopointinbetween, H the game and solve my problems for me. Within 2 which is impossible for points in R2. . months a lot of people and at least one non-person h Today is an interesting time for digital topology. t did play the game, and they did solve my problems a The mathematical field is still in its infancy, despite for me. I’ll try to describe the mathematics behind m thefactthatdigitalimageanalysishasbeengoingon it as well as some of the surprises along the way that [ for decades in industry. It’s a theme in the history still have me scratching my head a bit. of mathematics: useful ideas tend to appear in the 1 “real world” before we mathematicians describe and v define their theoretical foundations. Math historian 2 9 Judith Grabiner said this about calculus, “First the 3 derivative was used, then discovered, explored and 3 developed, and only then, defined.” 0 . Today there are a few different approaches to dig- 2 ital toplogy which are actively being pursued. We’re 0 going to focus on a digital model that closely resem- 6 1 bles graph theory, which seems to have its origins in : the work of Rosenfeld in the 1970s. The basic idea v Figure 1: Pappy, a friendly digital image. Fabulous is that the topological information in a digital image Xi pixel art by the author. is entirely expressed by which pixels are adjacent to r eachother. Sinceallwecareaboutarethepixelsand a their connections, we may as well think of a digital A little digital topology imageasagraphwithavertexforeachpixel,andan edge for each adjacency. My game is based on a mathematical question from What exactly do we mean by “adjacent”? In the the fairly new field of digital topology, which is about planetherearetwostandardschemes: “4-adjacency” topology for spaces made up of discrete pixels. Con- which allows no diagonals, or “8-adjacency” which sider Pappy, the digital character in Figure 1, which does allow diagonals. Our friend Pappy, for exam- ∗DepartmentofMathematics,FairfieldUniversity,Fairfield ple, would be represented by the graphs in Figure CT06824,USA,[email protected] 2, which look like two versions of Pappy’s skeleton. 1 Figure 3: Minimal reductions of Pappy using either 4- or 8-adjacency. Figure 2: Two graphs modeling Pappy. On the left using4-adjacency,andontherightusing8-adjacency. irreducible. You should think of f as rearranging the (Says one daughter: “That’s what Pappy will look vertices of the graph. Then the three conditions say likewhenhe’sdead.” Theotheradds, “Hestilllooks that: onevertexspotmustbevacantafterthemove, happy.”) As you can see, the topological structure each vertex can only move to an adjacent spot, and of the image is pretty different depending on which any adjacent vertices must still be adjacent after the adjacency we use. This is a bit of a contrast with move. theseveralstandardmetricsonR2 whichallgivethe OurlittlebuddyPappyisreducibleinseveralways: same topology. we can chop off the ends of his arms or feet, for ex- ample. If we keep on reducing Pappy as much as Reducible images possible, we obtain the irreducible graphs in Figure IntheSummerof2014IwasadvisinganREUproject 3. at Fairfield University with my students Jason Haar- One major question that we tackled in our REU mann, Meg Fields, and Casey Peters. The idea we project was: which graphs are reducible, and which stumbled upon has to do with “reducing” a digi- are not? Lacking any really big ideas, we started tal image by removing pixels which don’t affect the small: we managed to determine the complete list of topology. Just like in ordinary topology, we consider connectedirreduciblegraphshavingatmost7points. information about length or angle as not so impor- The result is Figure 4. This involved proving that tant, while information about holes or connectivity these particular graphs are irreducible, and that all is what we really care about. For example the pixels other graphs of 7 points or less are reducible. (Note on the ends of Pappy’s hands should be removable that we are considering any graphs at all, not just without changing the topology. ones which come from 4- or 8-adjacency digital im- Here’s the formal idea that we settled on: When ages in the plane. The question: “given a graph, two pixels x and y are adjacent or equal, let’s write decide efficiently whether or not it is realizable as x y. We say a digital image X is reducible if there the graph of a 4- or 8-adjacency digital image in the is(cid:45)some function f :X →X such that: plane” is itself an open problem that we didn’t want to get into.) • f is not onto, Westoppedat7pointsbecausethingsgottoocom- • x f(x) for every pixel x, plicated: wehadtouseacomputersearchtoruleout (cid:45) thousands of graphs, and then had to check 15 spe- • f(x) f(y) whenever x y. (cid:45) (cid:45) cialcasesbyhandthatthecomputercouldn’thandle. (Indigitaltopologyjargon,f givesahomotopyequiv- For8pointsthenumberofspecialcaseswas160,and alence.) If no such f exists, then we call the image for 9 points it was 3251. 2 In my game you are given a graph, and you win by dragging the vertices around onto one another so that: • one spot is vacant, • eachvertexendsupadjacenttowhereitstarted, • any vertices adjacent at the beginning are still adjacent at the end. These three conditions correspond exactly to our 3 Figure 4: Catalog of all irreducible graphs up to 7 conditions for a reduction, so winning the game con- points. stitutes a proof that the graph is reducible. I was a bit surprised to find that the game was prettyfun,andthatitwaspossibletogetbetterwith practice. ThismeantthatIwasdevelopingnewintu- ition about my math problem, though it was usually hard to articulate exactly what I was learning. Around this time it occured to me that I could Figure 5: There is a reduction for this graph, but it code in all our thousands of special cases for 8 and had our research group stumped for a while. 9 points and crowd-source the whole thing. I’d orig- inally thought of the game as just being for myself, but it seemed natural to open it up. So I came up The game withthedeeplyunsatisfyingname“NiceNeighbors”, and cleaned up the interface a bit. Deciding whether or not a given graph is reducible MarketingthegamewaseasierthanI’dexpected. I can be hard– try Figure 5. I tried to visualize the managedtoconvincesomehigh-profilemathtweeters problem like one of those little board games where tomentionit,andwithinacoupleofweeksIhadbeen you have pegs that can only move between adjacent written up on some blogs and I had all the traffic I holes. But I couldn’t ever think of a physical repre- needed. sentation that matched the three rules for the reduc- Pretty quickly I was getting feedback about the ing function f. Plus I’m terrible at those peg games. game, either directly from people who emailed me, orfromreadingtweetsandblogcomments. Ilearned Afewmonthslater,itoccuredtomeintheshower thatmostpeoplewon’treadtheinstructions,andalso (where I get most of my good mathematical ideas) that people will figure out how to cheat (especially thatthiscouldworkasacomputergame. Iimagined whenthegamecodeisopen). Ialsosawthatmostof a game which keeps track of the original graph, but thelevelsweresolvedbyasmallgroupof“hard-core” allows you to move the vertices around like pegs in Nice Neighbors enthusiasts. holes. Thegamewouldonlyletyoumovepegsincer- The biggest surprise of all was a particular player tain ways to make sure your rearrangement satisfies who I’ll call User 87. (Full name: User 8709884216. the 3 properties. Igaveallusersarandom10-digitidentifiersoIcould I’m a decent programmer, and winter break was track how many were coming from each person, and just starting, so I got to work. A few weeks later I when.) Over the course of a day and a half, User 87 hadaworkingwebgamewhichgaveasatisfyingway solved about one level per minute, until there were tophysicallymanipulatethesegraphstogetafeelfor no more levels to solve. One level per minute, es- them. Figure 6 shows a typical game level. pecially on the 9-point graphs, is quite a bit faster 3 Figure 6: At left, a typical game level before any moves are made. At the middle, the player has dragged one vertex across to another spot. The red edge indicates that two vertices which should be adjacent are no longer adjacent, so this is not a winning position. The dotted blue line reminds the player where each vertex started. At right is a winning position for this level. than I could consistently beat these levels, and User thing. It’s satisfying for me to have the answers, but 87 wasn’t stopping to sleep. Ican’tescapethefeelingthatIstilldon’tunderstand why these answers are true. The only explanation I have for this is that User 87wasacomputeralgorithmwhichhadbypassedthe Hopefullysomebodywillfigureitalloutsomeday. game’s front-end to submit the solutions directly to Maybe you? Maybe me? Or maybe I’ll just play my my database. Had I been trolled? Was User 87 try- fun little game some more... ing to humiliate me? Or maybe just trying to help? And why didn’t they ever contact me? I still don’t References and further reading know. Just to be safe, I wrote my own algorithms to reproduce User 87’s solutions and make sure they A good place to start reading about Rosenfeld-style were all correct (they were). digital topology is Rosenfeld’s original paper [4], or some later important papers by Boxer, e.g. [2]. An- In any event, within about 2 months from the other important (and completely different) model of game’s launch, I had a complete catalog of irre- digital topology is based on the work of Khalimsky, ducible graphs up through 9 points. I was even which is covered nicely in the textbook by Adams able to fulfill one of my career dreams– some se- and Franzosa [1]. Our REU team published a paper quences in the great Online Encyclopedia of Integer aboutreducibilityandhomotopyequivalence[3],and Sequences. OEISsequenceA248571isthenumberof you can read more about my algorithms in [6]. irreducible graphs on n points (starting with n=1): Nice Neighbors is still up and running for your en- 1,0,0,0,1,1,3,28,547. The last two terms come from joyment [5], as is the great Planarity [7] which was the game. But how should I feel about all this? The my major design inspiration. takeaway is: if you ask the internet to solve a few thousand math puzzles, it probably will. But did I [1] C.AdamsandR.Franzosa.IntroductiontoTopol- really learn anything, or gain new insight into my ogy: Pure and Applied. Pearson, 2007. problem? Not exactly– I just have all the answers now. [2] L.Boxer. Digitallycontinuousfunctions. Pattern Good mathematics isn’t just about finding an- Recognition Letters, 15:833–839, 1994. swers, but about explaining things. There’s a big difference between answers and explanation– these [3] J. Haarmann, M. Murphy, C. Peters, and P. C. crowd-provided answers don’t really illuminate any- Staecker. Homotopy equivalence of finite digital 4 images.JournalofMathematicalImagingandVi- sion, 53:288–302, 2015. arxiv eprint 1408.2584. [4] A. Rosenfeld. Digital topology. American Math- ematical Monthly, 86:621–630, 1979. [5] P. C. Staecker. Nice Neighbors. http: //cstaecker.fairfield.edu/~cstaecker/ neighbors/. [6] P. C. Staecker. Some enumerations of digital im- ages. 2015. arxiv eprint 1502.06236 [7] J. Tantalo. Planarity. http://www.planarity. net. Author bio Chris Staecker is Associate Professor in the Mathe- matics Department at Fairfield University, where he alsoteachessomecomputerprogramming. Heenjoys boring movies and mechanical calculating machines. Reducing Figure 5 To reduce the graph in Figure 5, move each of the outer5points“counterclockwise”by1position,and move the center point to the top. We proved in the REU paper that any reduction of this graph must move all of its points, which answered an open ques- tion posed by Boxer. 5

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.