tag:blogger.com,1999:blog-50088791052957711592019-03-07T01:44:50.003-08:00mathrecreationDan MacKinnonnoreply@blogger.comBlogger284125tag:blogger.com,1999:blog-5008879105295771159.post-32948505939954226062019-02-14T12:05:00.000-08:002019-02-20T08:42:39.480-08:00of words and frogs<div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Uafd9rxRKPQ/XFx0azQuQyI/AAAAAAAAFN4/59-OzGJJ_qIs9PKte0G79PPSAZRkutB1ACLcBGAs/s1600/frogs2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="429" data-original-width="477" height="179" src="https://1.bp.blogspot.com/-Uafd9rxRKPQ/XFx0azQuQyI/AAAAAAAAFN4/59-OzGJJ_qIs9PKte0G79PPSAZRkutB1ACLcBGAs/s200/frogs2.PNG" width="200" /></a></div><br />Inspired by Lillian Ho's article on using origami with adult ESL learners (see references below), I decided to build a lesson for high school ESL students around the <a href="https://origamiusa.org/diagrams/jumping-frog">hopping frog</a> model.<br /><br />The basic activity went like this:<br /><blockquote class="tr_bq">1. Students were shown how to fold the model without being given any verbal instructions. </blockquote><blockquote class="tr_bq">2. Students were given <a href="https://docs.google.com/document/d/1ifsm7YeoiZFjwkeniPVeheEXOxovWjsQSc1e4UenXCE/edit?usp=sharing">a version of the instructions</a> with all written instructions removed. </blockquote><blockquote class="tr_bq">3. In groups of 3 or 4, students were asked to provide written instructions on chart paper to go along with the diagrams. </blockquote><blockquote class="tr_bq">4. The written instructions were shared by placing the chart papers up around the class, and students were asked to identify the important words that were used in the instructions. </blockquote><blockquote class="tr_bq">5. As a whole class, we folded the frog again, noting the mathematical ways we could describe each step.</blockquote><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-CW-Ha07k_BE/XGW49630zAI/AAAAAAAAFQM/fqakGiI3rugjd9cFGqVLJPkx6AvG6ZohQCLcBGAs/s1600/cut%2Binstructions.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="334" data-original-width="922" height="115" src="https://4.bp.blogspot.com/-CW-Ha07k_BE/XGW49630zAI/AAAAAAAAFQM/fqakGiI3rugjd9cFGqVLJPkx6AvG6ZohQCLcBGAs/s320/cut%2Binstructions.PNG" width="320" /></a></div><br />If you try an activity along these lines, I expect that should be split over two or three sessions. We did step 1 at the end of another lesson, steps 2 and 3 on a second day, and steps 4 and 5 on a third day.<br /><br />In thinking about the sort of descriptions that the students should be guided towards, it's helpful to note some of the observations provided in an article by Koichi Tateishi (see references): (1) the written words are not a replacement for the diagrams, but should be thought of as complementary, and (2) we should avoid technical origami terms (mountain fold, squash fold, etc.).<br /><br />When one group of students uncovered a useful word, it would get written up on the board for all groups to share, so as we went we developed a list of helpful words. With reference to the steps on the <a href="https://docs.google.com/document/d/1ifsm7YeoiZFjwkeniPVeheEXOxovWjsQSc1e4UenXCE/edit?usp=sharing">instruction page</a>, some words that the students used included or discussed at each step were:<br /><br /><b>step 1</b>: paper, card, square, rectangle, fold, half, long, short, side, middle, open, line;<br /><b>step 2</b>: diagonal, top, side, edge;<br /><b>step 3</b>: do again, repeat, other side;<br /><b>step 4</b>: turn over, flip, corners, intersection, lines crossing;<br /><b>step 5</b>: push, pinch, squash, together, peak;<br /><b>step 6</b>: tip, up;<br /><b>step 7</b>: center, in, inwards;<br /><b>step 8</b>: flaps, outside, inside, arms;<br /><b>step 9</b>: bottom, nose, legs;<br /><b>step 10</b>: down, knees;<br /><br />These words were used in the context of providing instructions and directions - a very important type of speech act that students are routinely confronted with.<br /><br />In the appendix to her article on the benefits of origami lessons for middle school students, Norma Boakes (see references below) provides a great sample mathematical dialog for the jumping frog model (step 5 of our lesson plan). Like Boakes suggests, in our mathematical discussion we talked about rectangles, squares, quadrilaterals, right angles, bisectors, 45 degree angles, triangles, pentagons, right-triangles, parallel and perpendicular lines. Each (now very familiar) step of the frog construction providing a concrete model for the concept we were talking about.<br /><br />Through this lesson, we learned and reviewed a lot of everyday language around the giving and receiving of instructions that involve everyday spacial terms, and were also able to then apply a mathematical lens to deepen our understanding of what we were doing.<br /><br /><b>References</b><br /><br />Boakes, N.J. (2009). "The Impact of Origami-Mathematics Lessons on Achievement and Spacial Ability of Middle-School Students." In Lang, R.J. (Ed) <i>Origami 4: Fourth International Meeting of Origami Science, Mathematics and Education</i>. Natick, MA: A K Peters Ltd.<br /><br />Ho, L.Y. (2002). "Origami and the Adult ESL Learner." In Hull, T. (Ed.) <i>Origami 3: Third International Meeting of Origami Science, Mathematics and Education</i>. Natick, MA: A K Peters Ltd.<br /><br />Tateishi, K. (2009). "Redundancy of Verbal Instructions in Origami Diagrams." In Lang, R.J. (Ed) <i>Origami 4: Fourth International Meeting of Origami Science, Mathematics and Education</i>. Natick, MA: A K Peters Ltd.<img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/13z8VtiUGXQ" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2019/02/of-words-and-frogs.htmltag:blogger.com,1999:blog-5008879105295771159.post-61238405173840051382019-02-12T06:08:00.000-08:002019-02-12T06:08:00.558-08:00card puzzlesIn these puzzles, each suit is given a value. The value of the card is the face value of the card multiplied by its suit value. Aces may be low (face value 1) or high (face value 11). Face cards (Jack, Queen, King) have face value 10. Other cards have face value equal to their number.<br /><br /><b>Puzzle 1 (warm up)</b><br />In this puzzle, black cards (spades and clubs) have suit value 2 and red cards (diamonds and hearts) have suit value 3. What is the card value of each card shown?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-uZek-4sJIBg/XGLNR1qa3AI/AAAAAAAAFOg/2JcTl6TTT_45_k-S3wg-RlalQi4hcz6HACLcBGAs/s1600/cp1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="320" data-original-width="309" src="https://2.bp.blogspot.com/-uZek-4sJIBg/XGLNR1qa3AI/AAAAAAAAFOg/2JcTl6TTT_45_k-S3wg-RlalQi4hcz6HACLcBGAs/s1600/cp1.PNG" /></a></div><br /><b>Puzzle 2 (introducing sets)</b><br />When cards are put next to each other, we add their values. In this puzzle, spades have suit value 1, clubs have suit value 2, diamonds have suit value 3, and hearts a have suit value 4. Aces are high. What is the total value of each set?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-2X8QrpFQISY/XGLNiQd9erI/AAAAAAAAFOo/EU_rxZ5hX8or22SwUzKmTcCuHhs02pkGQCLcBGAs/s1600/cp2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="345" data-original-width="434" height="254" src="https://3.bp.blogspot.com/-2X8QrpFQISY/XGLNiQd9erI/AAAAAAAAFOo/EU_rxZ5hX8or22SwUzKmTcCuHhs02pkGQCLcBGAs/s320/cp2.PNG" width="320" /></a></div><b><br /></b><b>Puzzle 3</b><br />In this puzzle, spades are worth 2. Each set is worth 20. What are the values of the other suits?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-YiHu5XedRFY/XGLOm_TdY2I/AAAAAAAAFO8/ZQ2pUfmS7eAlNOK_glNE8rfMLLri4i3LQCLcBGAs/s1600/cp3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="408" data-original-width="295" height="320" src="https://4.bp.blogspot.com/-YiHu5XedRFY/XGLOm_TdY2I/AAAAAAAAFO8/ZQ2pUfmS7eAlNOK_glNE8rfMLLri4i3LQCLcBGAs/s320/cp3.PNG" width="231" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br /><b>Puzzle 4</b><br />In this puzzle, Aces are low. The value of each set is shown below it. What is the value of each suit?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-tY7NKzFwQPw/XGLPRbU8ZlI/AAAAAAAAFPE/0OURjHg9-toJCaIAyUWOySGKza7DqtFogCLcBGAs/s1600/cp4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="296" data-original-width="365" height="259" src="https://2.bp.blogspot.com/-tY7NKzFwQPw/XGLPRbU8ZlI/AAAAAAAAFPE/0OURjHg9-toJCaIAyUWOySGKza7DqtFogCLcBGAs/s320/cp4.PNG" width="320" /></a></div><b><br /></b><b>Puzzle 5</b><br />In this puzzle, Aces are high. The value of each set is shown below it. What is the value of each suit?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-8ACMAOxUbd8/XGLQEo3h6bI/AAAAAAAAFPU/CGk9_H0xQ_4QmYB71Q1Sy0JcyXTFTzGzwCLcBGAs/s1600/cp5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="292" data-original-width="383" height="243" src="https://3.bp.blogspot.com/-8ACMAOxUbd8/XGLQEo3h6bI/AAAAAAAAFPU/CGk9_H0xQ_4QmYB71Q1Sy0JcyXTFTzGzwCLcBGAs/s320/cp5.PNG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><b><br /></b><b>Puzzle 6</b><br />In this puzzle, Aces are low. The value of each set is shown below it. What is the value of each suit?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-aKCN3zF-lys/XGLQUYHoKEI/AAAAAAAAFPY/37t2z0NIww0GyYPy_pJKY74saUztjPL1ACLcBGAs/s1600/cp6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="287" data-original-width="378" height="242" src="https://1.bp.blogspot.com/-aKCN3zF-lys/XGLQUYHoKEI/AAAAAAAAFPY/37t2z0NIww0GyYPy_pJKY74saUztjPL1ACLcBGAs/s320/cp6.PNG" width="320" /></a></div><br /><br /><b>Solutions</b><br />These puzzles can be solved by modeling the cards algebraically and then solving by substituting in known values.<br /><br />The first two puzzles require you to evaluate by substituting in the known value of the suits. The five of diamonds is represented by 5<i>d</i>. We know that <i>d</i> = 3, so our card is worth 5(3)=15. Puzzle 3 tells you the value of spades (s), and requires you to find the other values by substituting in known values and solving for unknown values. The remaining puzzles require you to find the value of one of the suits by solving a one-step equation, then find the others by repeated substitution and solving.<br /><br /><i>puzzle 1</i>: 15, 30, 20, 30.<br /><i>puzzle 2</i>: 45, 64, 36.<br /><i>puzzle 3</i>: <i>h </i>= 1, <i>c </i>= 3, <i>d </i>= 1.<br /><i>puzzle 4</i>: <i>s</i> = 1, <i>h</i> = 5, <i>c</i> = 7, <i>d</i> = 4.<br /><i>puzzle 5</i>: <i>s</i> = 2, <i>h</i> = 6, <i>c</i> = 10, <i>d</i> = 5.<br /><i>puzzle 6</i>: <i>s</i> = 11, <i>h</i> = 7, <i>c</i> = 5, <i>d</i> = 2.<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/0JN29MgbaYk" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2019/02/card-puzzles.htmltag:blogger.com,1999:blog-5008879105295771159.post-24364669669119085122019-01-31T10:26:00.000-08:002019-01-31T10:26:12.321-08:00Farey Sequences and Ford Circles in JavaScript<br />Like the <a href="http://www.mathrecreation.com/2017/12/hello-phyllotaxis.html">phyllotaxis spiral</a>, a nice mathematical figure to draw in code is the sequence of <a href="https://en.wikipedia.org/wiki/Ford_circle">Ford Circles</a>.<br /><br />A while back I tried generating these using <a href="http://www.mathrecreation.com/2009/02/farey-ford-fathom.html">Fathom</a> and <a href="http://www.mathrecreation.com/2009/02/farey-definition-property-and-algorithm.html">Processing</a> - now for fun I've tried them in JavaScript. A page to play with them is <a href="https://dmackinnon1.github.io/fareyford/">here</a>, and the source code is in a <a href="https://github.com/dmackinnon1/fareyford">Github repo</a>.<br /><br />On the <a href="https://dmackinnon1.github.io/fareyford/">page</a>, you can control the level of the Farey sequence used to generate the circles - you start off with just 0 and 1:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-aj_tDR5Bgok/XFM0kqQo5rI/AAAAAAAAFLc/AELxZsxk7N0CECZP1wDO8K8RPhlSups_wCLcBGAs/s1600/level1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="457" data-original-width="757" height="240" src="https://4.bp.blogspot.com/-aj_tDR5Bgok/XFM0kqQo5rI/AAAAAAAAFLc/AELxZsxk7N0CECZP1wDO8K8RPhlSups_wCLcBGAs/s400/level1.png" width="400" /></a></div><br />Using the buttons provided, you can increase the number of terms in the sequence and the corresponding number of circles.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/--HMY1QdvVwY/XFM4h2IzctI/AAAAAAAAFLo/uPzNGrdrQUYBzaENVsmL3kNj2dhVzggyQCLcBGAs/s1600/level3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="460" data-original-width="757" height="242" src="https://4.bp.blogspot.com/--HMY1QdvVwY/XFM4h2IzctI/AAAAAAAAFLo/uPzNGrdrQUYBzaENVsmL3kNj2dhVzggyQCLcBGAs/s400/level3.png" width="400" /></a></div><br />After a certain point, the page does not list the entire sequence associated with the circles.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-IVu4E-DYM0M/XFM4wcO0qdI/AAAAAAAAFLs/rUYQPWDJEA0dgHxDHe7G8K-DevHMUMqTwCLcBGAs/s1600/level19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="461" data-original-width="765" height="240" src="https://4.bp.blogspot.com/-IVu4E-DYM0M/XFM4wcO0qdI/AAAAAAAAFLs/rUYQPWDJEA0dgHxDHe7G8K-DevHMUMqTwCLcBGAs/s400/level19.png" width="400" /></a></div><br /><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/3kc4UmyYpGA" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2019/01/farey-sequences-and-ford-circles-in.htmltag:blogger.com,1999:blog-5008879105295771159.post-60302420152564225762019-01-30T18:57:00.001-08:002019-01-30T18:57:02.789-08:00an origami surpriseFor a recent origami-based math activity, I gave students printed instructions for two origami models: a <a href="https://origamiusa.org/diagrams/multiform">pinwheel</a>, and an open-top <a href="https://origamiusa.org/diagrams/masu">masu box</a> (both from <a href="https://origamiusa.org/diagrams">Origami USA</a>).<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-SR5I--f9-44/XFJcegbEufI/AAAAAAAAFKo/IAYZ3j7RvSEkpAziZuBT9A3VwWToxak3wCLcBGAs/s1600/box_and_wheel.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="300" data-original-width="360" height="266" src="https://1.bp.blogspot.com/-SR5I--f9-44/XFJcegbEufI/AAAAAAAAFKo/IAYZ3j7RvSEkpAziZuBT9A3VwWToxak3wCLcBGAs/s320/box_and_wheel.PNG" width="320" /></a></div><br />They were to learn how to fold the models and answer some questions about the results:<br /><blockquote class="tr_bq"><i>Assuming that the paper has length of one unit, without measuring can you determine the perimeter and area of the pinwheel, and the volume and surface area of the box? </i></blockquote>I could honestly tell them: I did not know the answers, so they would have to explain to me how they found the results.<br /><br />Opening up the finished models to reveal the pattern of folds provided a good strategy for getting to the answers. Considering how the folds divided the paper (into sixteen squares) and using the Pythagorean Theorem to calculate the lengths of diagonal folds allows you to get all the lengths you need.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-G3hIcg3n7q4/XFJeDyXDY7I/AAAAAAAAFK0/onS2ciHsUxMIwx7ZtlUuOrTIoM2Mc--XwCLcBGAs/s1600/calculation1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="328" data-original-width="877" height="148" src="https://1.bp.blogspot.com/-G3hIcg3n7q4/XFJeDyXDY7I/AAAAAAAAFK0/onS2ciHsUxMIwx7ZtlUuOrTIoM2Mc--XwCLcBGAs/s400/calculation1.PNG" width="400" /></a></div><br />The multiform pinwheel has a crease pattern like this:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-AmxXrr_Tl5g/XFJeOE_kOrI/AAAAAAAAFK4/Fw0uT55AQ5ApwMmuQtH0-V9_DmQxIozhgCLcBGAs/s1600/pinwheel_calc1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="569" data-original-width="429" height="400" src="https://3.bp.blogspot.com/-AmxXrr_Tl5g/XFJeOE_kOrI/AAAAAAAAFK4/Fw0uT55AQ5ApwMmuQtH0-V9_DmQxIozhgCLcBGAs/s400/pinwheel_calc1.PNG" width="301" /></a></div>And the masu box has the following crease pattern:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Wk-olg2-_XI/XFJeSRem2vI/AAAAAAAAFK8/HoSN5-4J1tUKxkcQHI6GKkErrigZyiXHACLcBGAs/s1600/masu_calc1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="584" data-original-width="420" height="400" src="https://1.bp.blogspot.com/-Wk-olg2-_XI/XFJeSRem2vI/AAAAAAAAFK8/HoSN5-4J1tUKxkcQHI6GKkErrigZyiXHACLcBGAs/s400/masu_calc1.PNG" width="287" /></a></div><br />When it came time for the answers to the math problems I had posed, I had a mild surprise: two of the quantities that I had asked for came out to the same value - <i>the area of the pinwheel and the outside surface area of the box were identical</i> (3/8 units - interestingly just under half of the paper is exposed, the rest is folded in).<br /><br />Taking another look at the crease patterns, you can see how the image of the box can be transformed into the pinwheel, demonstrating without calculations that the areas are the same:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-30wJhvzE_aw/XFJfwSf5ZqI/AAAAAAAAFLQ/TY2-4lOJHXoHQ16BFGAlKQtIrsTPB_nQACLcBGAs/s1600/crease_transformation.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="501" data-original-width="173" height="640" src="https://2.bp.blogspot.com/-30wJhvzE_aw/XFJfwSf5ZqI/AAAAAAAAFLQ/TY2-4lOJHXoHQ16BFGAlKQtIrsTPB_nQACLcBGAs/s640/crease_transformation.PNG" width="219" /></a></div><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/77ns9bhNbHk" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2019/01/an-origami-surprise.htmltag:blogger.com,1999:blog-5008879105295771159.post-84904917292504293952018-12-19T12:16:00.001-08:002018-12-19T15:58:25.352-08:00Tweedledee and Tweedledum<div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-jK1Ct2uKQek/XBqj354BrZI/AAAAAAAAFHE/QHczHbtHSFgt-wm1XQ9mRtbJOlokvO57QCLcBGAs/s1600/john_tenniel.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1059" data-original-width="1357" height="249" src="https://4.bp.blogspot.com/-jK1Ct2uKQek/XBqj354BrZI/AAAAAAAAFHE/QHczHbtHSFgt-wm1XQ9mRtbJOlokvO57QCLcBGAs/s320/john_tenniel.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Illustration by <a href="https://en.wikipedia.org/wiki/John_Tenniel">John Tenniel</a></i></div><br /><br />Here is another logic puzzle by Raymond Smullyan, this time from his book <i>Alice in Puzzle-Land</i>:<br /><blockquote class="tr_bq"><i>Just then Alice practically stumbled on Tweedledum and<br />Tweedledee, who were grinning under a tree right by their house.<br />Alice looked carefully at their collars to see which was marked<br />"Dum" and which was marked "Dee," but neither collar was<br />embroidered. </i></blockquote><blockquote class="tr_bq"><i>"I'm afraid I can't very well tell you apart without your embroidered<br />collars," remarked Alice. </i></blockquote><blockquote class="tr_bq"><i>"You'll have to use logic," said one of the brothers, giving the<br />other an affectionate hug. "We were expecting you to come around<br />these parts, and we have prepared some nice logic games for you.<br />Would you like to play?" </i></blockquote><blockquote class="tr_bq"><i>"As you see, this is a red card. Now, a red card signifies that the<br />one carrying it is telling the truth, whereas a black card signifies that<br />the speaker is telling a lie. Now, my brother there [he pointed to the<br />other one] is also carrying either a red card or a black card in his<br />pocket. He is about to make a statement. If his card is red, he will<br />make a true statement, but if his card is black, he will make a false<br />statement. Then your job is to figure out whether he is Tweedledee<br />or Tweedledum." </i></blockquote><blockquote class="tr_bq"><i>"Oh, that sounds like fun!" said Alice. "I'd like to play!" </i></blockquote><blockquote class="tr_bq"><i>...Well, Tweedledee [and Tweedledum] went into the house, and both<br />brothers came out shortly after. They look more alike than ever! thought<br />Alice. Well, one of them—call him the first one—stood to Alice's left,<br />and the other—call him the second one—stood to Alice's right. They<br />then made the following statements: </i></blockquote><blockquote class="tr_bq"><i>FIRST ONE: My brother is Tweedledee, and he is carrying a black card. </i></blockquote><blockquote class="tr_bq"><i>SECOND ONE: My brother is Tweedledum, and he is carrying a red card. </i> </blockquote><blockquote class="tr_bq"><i>Which one is which?</i></blockquote><br />If you think you may have a solution, you can try it out against the online version <a href="https://dmackinnon1.github.io/deeDum/?id=24">here</a>.<br /><br />After solving a puzzle (or reading the solution) in one of Smullyan's books, I am often left wishing there were more like it. Why not try generating some more?<br /><br />Let's say there are 8 simple statements each brother could make.<br /><ul><li>My name is [Tweedledee|Tweedledum]. </li><li>I am carrying a [red|black] card.</li><li>My brother's name is [Tweedledee|Tweedledum].</li><li>My brother is carrying a [red|black] card.</li></ul>And 16 more compound statements:<br /><ul><li>My name is [Tweedledee|Tweedledum] [and|or] I am carrying a [red|black] card.</li><li>My brother's name is [Tweedledee|Tweedledum] [and|or] he is carrying a [red|black] card.</li></ul>This gives us 24 possible statements each brother could make, so a total of 24^2 = 576 possible puzzles.<br /><br />But some of these puzzles will lead to contradictions. For example, if either brother makes the statement "I am carrying a black card." We end up with the liars paradox: the brother must be lying, but if he is, he is telling the truth (and vice versa). Some of these also lead to multiple solutions.<br /><br />A good puzzle must have a unique solution, and running these through a logic-puzzle solver yields 168 good puzzles (you can check out a Python notebook that generates and verifies the puzzles <a href="https://github.com/dmackinnon1/pynotes/blob/master/dee_and_dum.ipynb">here</a>). Really, only half of these puzzles are unique, as having the anonymous brothers "first one" and "second one" switch statements gives us essentially the same puzzle. So, ignoring the order of the statements/brothers there are 168/2 = 84 unique puzzles based on these statements.<br /><br />The distribution of names and cards is uniform in these 84 puzzles (the brothers are as likely to be telling the truth as they are to be lying). In the graphs below the brothers are referred to as <b>bro0</b> and <b>bro1</b>, and the counts are based on the set of 168 puzzles where the 'reverse' of each puzzle is also included.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-H1852PujcQw/XBqkycclRxI/AAAAAAAAFHQ/ByfxIix2jcI9ogK70HhhoWLO_LtjsIQJgCLcBGAs/s1600/image2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="254" data-original-width="455" height="178" src="https://4.bp.blogspot.com/-H1852PujcQw/XBqkycclRxI/AAAAAAAAFHQ/ByfxIix2jcI9ogK70HhhoWLO_LtjsIQJgCLcBGAs/s320/image2.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>cards held by both brothers</i></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-T37bci9TAkg/XBqkyU_I7iI/AAAAAAAAFHM/iA62DaUfEVMnmftdUL7tkQBmNLbjoWz-QCLcBGAs/s1600/image1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="251" data-original-width="427" height="188" src="https://2.bp.blogspot.com/-T37bci9TAkg/XBqkyU_I7iI/AAAAAAAAFHM/iA62DaUfEVMnmftdUL7tkQBmNLbjoWz-QCLcBGAs/s320/image1.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>cards held by each brother</i></div><div class="separator" style="clear: both; text-align: center;"><br /></div>Try your puzzle solving skills against the brothers <a href="https://dmackinnon1.github.io/deeDum/">here</a>. Other Smullyan-inspired puzzles can be found on the <a href="http://www.mathrecreation.com/p/puzzles.html">puzzle page of this blog</a>.<br /><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/C13xTCaPC_A" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/12/tweedledee-and-tweedledum.htmltag:blogger.com,1999:blog-5008879105295771159.post-13925360930292327312018-11-29T10:21:00.001-08:002018-11-29T10:21:26.604-08:00algorithms for drawing celtic knots<div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-LRRkCN9RbOw/W_8EpSdPfbI/AAAAAAAAE6w/N-dxD6QJPl4h2RjiMCqbGfTbDs1HF0VKgCLcBGAs/s1600/3_patterns.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="664" data-original-width="287" src="https://2.bp.blogspot.com/-LRRkCN9RbOw/W_8EpSdPfbI/AAAAAAAAE6w/N-dxD6QJPl4h2RjiMCqbGfTbDs1HF0VKgCLcBGAs/s1600/3_patterns.png" /></a></div><br />The images above are the same celtic knot pattern (other examples <a href="https://www.mathrecreation.com/2018/09/some-knots-and-not-knots.html">here</a>) shown in three slightly different styles. You can try creating your own knots and seeing how they look in the different styles using <a href="https://dmackinnon1.github.io/celtic/">this online editor</a>. All the examples above are based on the same grid:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-YGLMeGPy4eg/W_8FEOo0OXI/AAAAAAAAE64/v9NC1XVhn60LdtSxkqKId74jVMC9tKJVACLcBGAs/s1600/pattern.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="280" data-original-width="355" height="252" src="https://4.bp.blogspot.com/-YGLMeGPy4eg/W_8FEOo0OXI/AAAAAAAAE64/v9NC1XVhn60LdtSxkqKId74jVMC9tKJVACLcBGAs/s320/pattern.png" width="320" /></a></div><br />The grid has primary points (shown in grey) and secondary points (shown in black). Breaks in the pattern are created by connecting secondary points following a few rules. The ribbon pattern is then drawn on the grid. The three styles shown are the result of three different approaches to drawing the ribbon once the grid is established.<br /><br /><ul><li>The top image is created by filling in the spaces between the "ribbon" of the pattern.</li><li>The middle image is created by following rules that create sections of ribbon around the <i>secondary</i> grid points.</li><li>The bottom image is created by following some rules to create sections of the ribbon around the <i>primary</i> grid points.</li></ul><br />All three use the idea of primary and secondary grid points, and creating the structure that defines the patterns by joining up the secondary grid points. So the first steps of all three approaches involves setting up this basic structure. Here are those steps, adapted from <a href="https://www.mathrecreation.com/2018/09/generating-celtic-knot-patterns.html">this earlier post</a>.<br /><br /><span style="font-size: large;">Setting up the grid and pattern structure</span><br /><br /><b>1) define primary grid points</b><br />A knot pattern is laid out on a square coordinate system using a set of "primary" points that are set at one unit distances in the horizontal and vertical directions. We'll say that (0,0) is the top left corner of the grid, and the positive <i>x</i> direction is towards the right and positive <i>y</i> direction is down. The dimensions of the primary grid must be odd (there must be a total odd number of dots in both the <i>x</i> and <i>y</i> directions). Because we are starting with (0,0) in the top left, the top right point (<i>x</i>, 0) must have x even (4 in the example below), and the bottom left point (0,<i>y</i>) must have y even (6 in the example below).<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-y34mxxvpzV4/W3jo0AZGwxI/AAAAAAAAEps/cu4LMR9-lCwxLEEZylF8kQRdG-aF368fACLcBGAs/s1600/primaryGrid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="390" data-original-width="325" height="320" src="https://1.bp.blogspot.com/-y34mxxvpzV4/W3jo0AZGwxI/AAAAAAAAEps/cu4LMR9-lCwxLEEZylF8kQRdG-aF368fACLcBGAs/s320/primaryGrid.png" width="266" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>the primary grid</i></div><div class="separator" style="clear: both; text-align: center;"></div><br /><br /><b>2) identify secondary grid points</b><br />Some of the points on the grid are special - these form a secondary grid. The special secondary grid points are those where both <i>x</i> and <i>y</i> values are even, or both are odd.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-_as6VLcVf2Q/W3juJ6Rc97I/AAAAAAAAEqE/R8zNfSQTLdEQwqbHXtO_x_yK6AuEvSZXgCLcBGAs/s1600/secondaryGrid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="389" data-original-width="319" height="320" src="https://1.bp.blogspot.com/-_as6VLcVf2Q/W3juJ6Rc97I/AAAAAAAAEqE/R8zNfSQTLdEQwqbHXtO_x_yK6AuEvSZXgCLcBGAs/s320/secondaryGrid.png" width="262" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>the secondary grid</i></div><div class="separator" style="clear: both; text-align: center;"></div><br />The secondary grid points where both <i>x</i> and <i>y</i> are even will be referred to as <i>even nodes</i>, and those that have both <i>x</i> and <i>y</i> odd will be referred to as <i>odd nodes</i>. The requirement to have the primary grid have odd dimensions (step 1) was needed to ensure that the corners of the pattern are all secondary points.<br /><br /><b>3)<i> </i>place boundaries</b><br />To create an edge-boundary for the pattern, and to create more interesting twists and turns, we follow some rules for drawing boundaries on the grid.<br /><br /><i>boundary rule 1</i>: A boundary can connect any two non-diagonally adjacent secondary points, as long as rule 2 is not violated. The midpoint of a boundary segment will be a primary point.<br /><br /><i>boundary rule 2</i>: A primary point cannot have more than one boundary going through it.<br /><br />The example below shows boundaries drawn along the edge of the image, as well as some internal boundaries.<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-XDC8Vzno7ag/W5FX3GvDtEI/AAAAAAAAEss/9aZ6blad8QsVf20U8GizQpuyCtBXwvoNACLcBGAs/s1600/boundaries_drawn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="493" data-original-width="375" height="320" src="https://4.bp.blogspot.com/-XDC8Vzno7ag/W5FX3GvDtEI/AAAAAAAAEss/9aZ6blad8QsVf20U8GizQpuyCtBXwvoNACLcBGAs/s320/boundaries_drawn.png" width="243" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>legal boundary examples, showing<br />primary and secondary points </i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><span style="font-size: large;">Three ways to draw the "knot"</span></div><div class="separator" style="clear: both; text-align: left;">Now that the grid is drawn with primary and secondary points, there are different approaches to actually creating the celtic knot pattern from the grid.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>method 1: Negative space around the secondary points</b></div><div class="separator" style="clear: both; text-align: left;">To create an intertwined ribbon we can fill in the spaces around the ribbon - in addition to the boundaries already drawn, the secondary grid points are built up into polygons, and the "weaving effect" is created by drawing filaments that extend out of the secondary grid polygons, in one direction for even secondary points, the opposite for odd secondary points. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-zKOgNlz1N10/W5FT9rVXZfI/AAAAAAAAEsc/Lcw5uLabe6kMScPD4DEzjDDzsbJViq2CQCPcBGAYYCw/s1600/even_odd2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="340" data-original-width="681" height="159" src="https://1.bp.blogspot.com/-zKOgNlz1N10/W5FT9rVXZfI/AAAAAAAAEsc/Lcw5uLabe6kMScPD4DEzjDDzsbJViq2CQCPcBGAYYCw/s320/even_odd2.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">If an adjacent primary point has a boundary through it, the line extending from the secondary point in the direction of that primary point is simply not drawn, and the corner of the polygon without a line extending from it is truncated.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-L9mi8Yh-s1E/W5FYSMhfGbI/AAAAAAAAEs4/7_n9TlBplE0oudtKI9UarRQ6cuQt-6xqACPcBGAYYCw/s1600/lines_adjusted.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="490" data-original-width="372" height="320" src="https://2.bp.blogspot.com/-L9mi8Yh-s1E/W5FYSMhfGbI/AAAAAAAAEs4/7_n9TlBplE0oudtKI9UarRQ6cuQt-6xqACPcBGAYYCw/s320/lines_adjusted.png" width="242" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>A square is drawn around each secondary point, and<br />where there is no barrier, lines are extended based on the<br />even-odd rules.</i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-ygiFmXyjcUs/W5FZpkRqmNI/AAAAAAAAEtE/PD6YK8XQo_4-u-nULPxbD--MgSqL7p0MACPcBGAYYCw/s1600/truncated_nodes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="489" data-original-width="369" height="320" src="https://3.bp.blogspot.com/-ygiFmXyjcUs/W5FZpkRqmNI/AAAAAAAAEtE/PD6YK8XQo_4-u-nULPxbD--MgSqL7p0MACPcBGAYYCw/s320/truncated_nodes.png" width="241" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Squares with missing lines can be<br />truncated into polygons to improve<br />the ribbon effect.</i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">(Note: <a href="https://www.mathrecreation.com/2018/09/generating-celtic-knot-patterns.html">This post</a> offers a slightly different description of method 1.)</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>method 2: Ribbon sections around the secondary points</b></div><div class="separator" style="clear: both; text-align: left;">Let's forget about the method above, and go back to the grid. Instead of filling in the spaces between the ribbon, we can draw the ribbon itself by drawing sections of the ribbon around the secondary points. Again, there is an even/odd rule in order to allow for the ribbons to pass over each other. For the node in the center, the following patterns are followed:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-p7efkD68AoY/XAAgfyqzS5I/AAAAAAAAE7E/66Krol-hq3E-ga0zAH4Wx8pyV9vCg5b5wCLcBGAs/s1600/postive_around_node.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="211" data-original-width="360" height="187" src="https://4.bp.blogspot.com/-p7efkD68AoY/XAAgfyqzS5I/AAAAAAAAE7E/66Krol-hq3E-ga0zAH4Wx8pyV9vCg5b5wCLcBGAs/s320/postive_around_node.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Adding partial paths around a secondary<br />node following even-odd rules</i></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">When these are joined together, the ribbon fragments form a set of continuous paths, and weave over and under each other:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-g199VX32g_Q/XAAhJD5fGvI/AAAAAAAAE7M/iRvu7vjQlc4b0J14XrwBzqH_9z_j-SjuACLcBGAs/s1600/postive_weaving.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="289" data-original-width="164" src="https://3.bp.blogspot.com/-g199VX32g_Q/XAAhJD5fGvI/AAAAAAAAE7M/iRvu7vjQlc4b0J14XrwBzqH_9z_j-SjuACLcBGAs/s1600/postive_weaving.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>portions of ribbon either join <br />together or appear to pass over and under</i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">If one of the primary points surrounding the secondary point has a boundary through it, the fragments are bent and joined:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-RyzYDEwr5Qo/XAAh4stLpII/AAAAAAAAE7Y/OhFPIxKpa68fKZpVRDLHGwP5DjNI7WGawCLcBGAs/s1600/bent_even_positive.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="163" data-original-width="169" src="https://3.bp.blogspot.com/-RyzYDEwr5Qo/XAAh4stLpII/AAAAAAAAE7Y/OhFPIxKpa68fKZpVRDLHGwP5DjNI7WGawCLcBGAs/s1600/bent_even_positive.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>An even secondary point with a<br />boundary through its bottom primary neighbour.</i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Connecting all the lines and erasing the points and boundaries, we get something like the image below.</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-Jy36GcReSGo/XAAikKe_iuI/AAAAAAAAE7g/t_5Hpdy3ilkakNzWlWx3p2bwF1puIZKhwCLcBGAs/s1600/positive_secondary.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="306" data-original-width="228" src="https://2.bp.blogspot.com/-Jy36GcReSGo/XAAikKe_iuI/AAAAAAAAE7g/t_5Hpdy3ilkakNzWlWx3p2bwF1puIZKhwCLcBGAs/s1600/positive_secondary.png" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>method 3: Ribbon sections around primary points</b></div><div class="separator" style="clear: both; text-align: left;">One final time, let's go back to the blank grid and re-draw the ribbon in a different way.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">For this method, we look only at primary points that are not part of the secondary grid. This includes primary points that have (<i>x</i>,<i>y</i>) values where <i>x</i> is even and <i>y</i> is odd, or where <i>x</i> is odd and <i>y</i> is even (remember, secondary points have both x and y values even or both <i>x</i> and <i>y</i> values odd).</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Like method 2, ribbon fragments are drawn, but this time the focus is on the primary nodes. again, what is drawn is different based on an "even vs odd" rule:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-eM0uvH2d_68/XAAlhVWWoMI/AAAAAAAAE7s/LkxJAiZqZgscVgpujttXZs6KZyHNaHl0QCLcBGAs/s1600/primary_positive1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="357" height="179" src="https://3.bp.blogspot.com/-eM0uvH2d_68/XAAlhVWWoMI/AAAAAAAAE7s/LkxJAiZqZgscVgpujttXZs6KZyHNaHl0QCLcBGAs/s320/primary_positive1.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Lines across the primary points are drawn<br />using even vs odd rules</i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Dealing with boundaries is easier with this method, there are only two cases to consider - a vertical boundary or a horizontal boundary.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-sc2L4KC_Vdc/XAAnSOZR7VI/AAAAAAAAE74/PUOql3IFPEwbLMUxyUua6SMDf98mKKBzgCLcBGAs/s1600/secondry_boundaries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="168" data-original-width="352" height="152" src="https://2.bp.blogspot.com/-sc2L4KC_Vdc/XAAnSOZR7VI/AAAAAAAAE74/PUOql3IFPEwbLMUxyUua6SMDf98mKKBzgCLcBGAs/s320/secondry_boundaries.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>There are two cases for handling boundaries<br />with this method.</i></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Any ribbon fragment that would lie outside the boundary of the grid is not drawn. Connecting all the lines and erasing the points and boundaries, we get something like the image below.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-ncKU8JUOAWs/XAAn3YpU_RI/AAAAAAAAE8A/caN9Ug6s-ycLRZBnrNDeLAiqCxUH41kMACLcBGAs/s1600/primary_method_example.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="315" data-original-width="236" src="https://1.bp.blogspot.com/-ncKU8JUOAWs/XAAn3YpU_RI/AAAAAAAAE8A/caN9Ug6s-ycLRZBnrNDeLAiqCxUH41kMACLcBGAs/s1600/primary_method_example.png" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">These three methods are pretty equivalent - small style alterations in any one of them can make the resulting knot look identical to one drawn using another method. When drawing knots by hand, I find that something along the lines of method 1 is easiest to use; however, from implementing each of the above in simple programs, I found that method 3 was the simplest to code.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><span style="font-size: large;">Other Knotty Things</span></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>Other posts: </b></div><div class="separator" style="clear: both; text-align: left;"><a href="https://www.mathrecreation.com/2018/09/generating-celtic-knot-patterns.html">Generating Celtic Knot Patterns</a></div><div class="separator" style="clear: both; text-align: left;"><a href="https://www.mathrecreation.com/2018/09/some-knots-and-not-knots.html">Some knots and not knots</a></div><div class="separator" style="clear: both; text-align: left;"><a href="https://www.mathrecreation.com/2008/07/knot-tiles.html">Knot tiles</a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>Online editor:</b> <a href="https://dmackinnon1.github.io/celtic/">https://dmackinnon1.github.io/celtic/</a></div><div class="separator" style="clear: both; text-align: left;"><b>Source:</b> <a href="https://github.com/dmackinnon1/celtic">https://github.com/dmackinnon1/celtic</a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/i5dS1Rp6N5c" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/11/algorithms-for-drawing-celtic-knots.htmltag:blogger.com,1999:blog-5008879105295771159.post-3525010929257535272018-10-27T05:14:00.003-07:002018-11-08T17:25:33.731-08:00The unreliable guardsHere is a new puzzle variety inspired by the <a href="https://dmackinnon1.github.io/forgetfulForest/">Forgetful Forest</a>, <a href="https://dmackinnon1.github.io/inspectorCraig/tiger.html">Tigers and Treasure,</a> and others by <a href="https://en.wikipedia.org/wiki/Raymond_Smullyan">Raymond Smullyan</a>.<br /><br />Here is the setup of the puzzle:<br /><br /><blockquote class="tr_bq"><i>Two guards are standing outside the entrance to a cave, guarding the treasure within. The treasure is one of copper, silver, gold, platinum, diamonds, or rubies. </i> </blockquote><blockquote class="tr_bq"><i><b>Guard 1</b> lies when guarding <b>copper</b>, <b>silver</b>, or <b>gold</b> and tells the truth when guarding other treasure. <b>Guard 2</b>, on the other hand, lies when guarding <b>platinum</b>, <b>diamonds</b>, or <b>rubies</b>, but tells the truth when guarding other treasure.</i> </blockquote><blockquote class="tr_bq"><i>In this land, copper is worth less than silver, which is worth less than gold, which is worth less than platinum, which is worth less than diamonds, which is worth less than rubies.</i></blockquote><br />This is very similar to the Forgetful Forest, where the Lion and Unicorn each lie on particular days of the week, or in Tigers and Treasure where the inscriptions on the doors will be true only when leading to particular contents.<br /><br />Just as with those puzzles, you are given clues, something like:<br /><blockquote class="tr_bq"><i>You meet the guards at the entrance to the treasure cave, and they make these statements: </i></blockquote><blockquote class="tr_bq"><i>Guard 1 says: The treasure is more valuable than copper.<br />Guard 2 says: The treasure is either diamonds or rubies. </i></blockquote><blockquote class="tr_bq"><i>If you determine the contents of the cave, the guards will let you pass and you can claim the treasure.</i></blockquote>If you think you can solve this particular puzzle, try it now right <a href="https://dmackinnon1.github.io/fickleSentries?id=38">here</a>. The interactive page for this puzzle type will set you up with 838 puzzles of this variety. It presents you with a list of the treasure types, and you can select the one you think is the correct answer.<br /><br />In this case, if Guard 1 says "the treasure is more valuable than copper" we can narrow down the list of possible treasures by considering two cases. In the first case, Guard 1 is telling the truth - so we know the treasure cannot be copper, silver or gold (their lying treasures); this leaves platinum, diamonds, or rubies, all of which are more valuable than copper, so the treasure could be any one of them. In the second case, Guard 1 is lying, so the treasure could be copper, silver, or gold; however, if the treasure was silver or gold, then Guard 1's statement would be true, contradicting the fact that Guard 1 is lying. So, if Guard 1 is lying, the treasure is copper, and if Guard 1 is telling the truth, the treasure is platinum, diamonds, or rubies.<br /><br />Guard 1's statements provide us with a list of possible treasures: copper, platinum, diamonds, or rubies. Guard 2's statement, "the treasure is either diamonds or rubies," should narrow things down. If Guard 2 is lying then the treasure must be platinum, diamonds, or rubies (their lying treasures). However, if they are lying their statement "the treasure is either diamonds or rubies" cannot be true, so the treasure must be platinum. Looking at Guard 2's statement, there is no way it can be true because both diamonds and rubies are on Guard 2's "lying list." So Guard 2 is lying, and the only option for the treasure is platinum.<br /><br />We could have solved the puzzle looking at Guard 2's statement alone: the treasure must be platinum. Because platinum is also in Guard 1's list, we can be confident that the puzzle is well-formed and that the clues are not contradicting each other.<br /><br />The set of puzzles that were generated has a 'solution space' that looks like this:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-4n-qf9rGmfA/W9RT9BfrsnI/AAAAAAAAE30/nhsIHPuk37sGUupDPvqzBOHN9UgA2q2OQCLcBGAs/s1600/treasure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="380" data-original-width="701" height="216" src="https://3.bp.blogspot.com/-4n-qf9rGmfA/W9RT9BfrsnI/AAAAAAAAE30/nhsIHPuk37sGUupDPvqzBOHN9UgA2q2OQCLcBGAs/s400/treasure.png" width="400" /></a></div>The distribution shape is due to the ordering of the value of treasure types, and that we included clues that had the phrases "more valuable than" and "less valuable than" - this gave us more treasure that sat in the middle of the value range, while the ones at the ends happened less frequently. Gold and platinum satisfy the phrases "more/less valuable than <i>x" </i>with a greater frequency than rubies or copper.<br /><br /><br />Give these puzzles a try <a href="https://dmackinnon1.github.io/fickleSentries/">here</a>. There is a Jupyter notebook <a href="https://github.com/dmackinnon1/pynotes/blob/master/unreliableGuards.ipynb">here</a> that shows how the puzzles were generated, full source for the puzzle page is <a href="https://github.com/dmackinnon1/fickleSentries">here</a>.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-uW_FSkLCcow/W9RU9o2XiPI/AAAAAAAAE38/2nmG9C0E5SAb72U8DeQWtOi-j_od5aR8ACLcBGAs/s1600/ares.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="468" data-original-width="212" height="320" src="https://2.bp.blogspot.com/-uW_FSkLCcow/W9RU9o2XiPI/AAAAAAAAE38/2nmG9C0E5SAb72U8DeQWtOi-j_od5aR8ACLcBGAs/s320/ares.png" width="144" /></a></div><div class="separator" style="clear: both; text-align: center;"><em style="background-color: white; box-sizing: border-box; color: #333333; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">Illustration from <a href="https://en.wikipedia.org/wiki/Sarah_Amelia_Scull" style="background-color: transparent; box-sizing: border-box; color: #337ab7; text-decoration-line: none;">Sarah Amelia Scull,</a><br style="box-sizing: border-box;" />"Greek Mythology Systematized" (1880).</em></div><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/wDrTaCXoD8A" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/10/the-unreliable-guards.htmltag:blogger.com,1999:blog-5008879105295771159.post-58719752031905612902018-09-27T18:17:00.002-07:002018-10-09T06:31:29.260-07:00some knots and not knotsHere are some knot patterns made using the online tool mentioned <a href="http://www.mathrecreation.com/2018/09/generating-celtic-knot-patterns.html">a few posts back</a>. For each knot, the 'grid pattern' used to create the knot in the editor is also shown. First up, the simple <a href="https://en.wikipedia.org/wiki/Unknot">unknot</a>.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-I87mYOkakHw/W607Ff12JtI/AAAAAAAAE0M/-VeEztU9TkkAAJ__jRseIOgWz3Z4yYhOACLcBGAs/s1600/unknot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="163" data-original-width="311" height="104" src="https://2.bp.blogspot.com/-I87mYOkakHw/W607Ff12JtI/AAAAAAAAE0M/-VeEztU9TkkAAJ__jRseIOgWz3Z4yYhOACLcBGAs/s200/unknot.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>not a knot</i></div><br /><b>Solomon's Knot</b><br />Next to this, we have a nice motif that is not a knot at all: the <a href="https://en.wikipedia.org/wiki/Solomon%27s_knot">Solomon Knot</a> is the name given to this motif of interlocked chains.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-nY4BQE-1RbM/W606Rfq_GtI/AAAAAAAAE0E/vSfoGzFDCuQ5WRWjwuusCi8CyXhb8RVhACLcBGAs/s1600/solomon_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="578" data-original-width="295" height="320" src="https://4.bp.blogspot.com/-nY4BQE-1RbM/W606Rfq_GtI/AAAAAAAAE0E/vSfoGzFDCuQ5WRWjwuusCi8CyXhb8RVhACLcBGAs/s320/solomon_1.png" width="163" /></a></div><div style="text-align: center;"><i>solomon unknot</i></div><br /><i>BTW, you can make pattern that looks like a solomon knot using <a href="http://www.mathrecreation.com/2017/04/truchet-en-plus.html">truchet tiles</a>:</i><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-SWJaYZpNM3E/W609RuqM8OI/AAAAAAAAE0Y/s6mkixNOnaArIkzZ_r2PsF2AEBc6y-R2gCLcBGAs/s1600/solomon_truchet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="419" data-original-width="413" height="200" src="https://2.bp.blogspot.com/-SWJaYZpNM3E/W609RuqM8OI/AAAAAAAAE0Y/s6mkixNOnaArIkzZ_r2PsF2AEBc6y-R2gCLcBGAs/s200/solomon_truchet.png" width="196" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>truchet solomon unknot</i></div><br /><b>Trefoil Knot</b><br />The <a href="https://en.wikipedia.org/wiki/Trefoil_knot">trefoil</a> is the simplest actual knot we can draw, but there are several ways to draw visually different but essentially equivalent trefoils, the first is considered the 'foundational' celtic knot:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-AFjUgyVT_gA/W609xBvVdnI/AAAAAAAAE0g/NmbaN6mARksK9u3UYaBePQ6PLn_rmL9XQCLcBGAs/s1600/trefoil_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="571" data-original-width="299" height="320" src="https://4.bp.blogspot.com/-AFjUgyVT_gA/W609xBvVdnI/AAAAAAAAE0g/NmbaN6mARksK9u3UYaBePQ6PLn_rmL9XQCLcBGAs/s320/trefoil_1.png" width="167" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>trefoil 1</i></div><br />Here's another rendition:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-QqNmcgSsg8E/W60-EYvUX2I/AAAAAAAAE0o/saw5-UFwaAcHF56gMa9CO1IhvfG3MzomgCLcBGAs/s1600/trefoil_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="576" data-original-width="433" height="320" src="https://3.bp.blogspot.com/-QqNmcgSsg8E/W60-EYvUX2I/AAAAAAAAE0o/saw5-UFwaAcHF56gMa9CO1IhvfG3MzomgCLcBGAs/s320/trefoil_3.png" width="240" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>trefoil 2</i></div><br />And one that is less recognisable:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-ItCE2K5HpY0/W60-J2OdVVI/AAAAAAAAE0s/brExin7js-gcLv9O9ndb8lk0v2azH3afwCLcBGAs/s1600/trefoil2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="579" data-original-width="425" height="320" src="https://2.bp.blogspot.com/-ItCE2K5HpY0/W60-J2OdVVI/AAAAAAAAE0s/brExin7js-gcLv9O9ndb8lk0v2azH3afwCLcBGAs/s320/trefoil2.png" width="234" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>trefoil 3</i></div><br /><b>The Josephine Knot</b><br />Another non-knot (but very decorative), the Josephine consists of two interlaced links, and seems to be a favourite among crafters (who use it in belts, bracelets and macrame):<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-jlKkHFr9zL4/W60-e_I7lXI/AAAAAAAAE08/jZKxJhD7wCM_UhrfZF0HsMND2es55XoFwCLcBGAs/s1600/josephine.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="581" data-original-width="567" height="320" src="https://3.bp.blogspot.com/-jlKkHFr9zL4/W60-e_I7lXI/AAAAAAAAE08/jZKxJhD7wCM_UhrfZF0HsMND2es55XoFwCLcBGAs/s320/josephine.png" width="312" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>josephine link</i></div><br /><b>Figure Eight Knot</b><br />The Trefoil is the only mathematically distinct prime knot with 3 crossings in a minimal planar diagram, and the <a href="https://en.wikipedia.org/wiki/Figure-eight_knot_(mathematics)">figure 8</a> is the only one with 4. This version illustrates its name nicely:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-xWR0LTmXw48/W60_JFo1E_I/AAAAAAAAE1E/DkP712oaUdYbiyEXtEdrlbpFwdRVeXqNQCLcBGAs/s1600/figure8_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="573" data-original-width="433" height="320" src="https://2.bp.blogspot.com/-xWR0LTmXw48/W60_JFo1E_I/AAAAAAAAE1E/DkP712oaUdYbiyEXtEdrlbpFwdRVeXqNQCLcBGAs/s320/figure8_1.png" width="241" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>figure eight 1</i></div><br />And here it is, a little lopsided:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-q4MEWj4w2pQ/W61qXhKF-jI/AAAAAAAAE10/RzlaGLRO-E0ogn_reUzRQQt5U_4D4V_bgCLcBGAs/s1600/figure8_b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="488" data-original-width="353" height="320" src="https://4.bp.blogspot.com/-q4MEWj4w2pQ/W61qXhKF-jI/AAAAAAAAE10/RzlaGLRO-E0ogn_reUzRQQt5U_4D4V_bgCLcBGAs/s320/figure8_b.png" width="231" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><i>figure eight 2</i></div><br /><b>The Three-Twist</b><br />One of only two prime knots with five crossings, the three-twist (or <a href="http://katlas.org/wiki/5_2">5_2</a>) looks a lot like the figure 8. You can see how removing one of the lines in the grid pattern of the figure 8 allows for the additional twist that forms this knot.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-c6LuFrmpecQ/W61AnlLFuyI/AAAAAAAAE1Y/0ez-KbAwHCAtPHzIoKglQ2nLd5fuZg2wwCLcBGAs/s1600/5_2a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><i><img border="0" data-original-height="583" data-original-width="435" height="320" src="https://3.bp.blogspot.com/-c6LuFrmpecQ/W61AnlLFuyI/AAAAAAAAE1Y/0ez-KbAwHCAtPHzIoKglQ2nLd5fuZg2wwCLcBGAs/s320/5_2a.png" width="238" /></i></a></div><div class="separator" style="clear: both; text-align: center;"><i>the three-twist</i></div><br /><b>The eight-eighteen</b><br />I don't know of a common name for the <a href="http://katlas.org/wiki/8_18">8_18</a>, but it's a nice looking knot, so it should have one. Here are two presentations of it:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-rNxfecQ20Pw/W61BpsxIIyI/AAAAAAAAE1g/7PcfVaa7n-we7qKu1eL8KREyZNONivWkQCLcBGAs/s1600/8_1_a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="648" data-original-width="341" height="400" src="https://2.bp.blogspot.com/-rNxfecQ20Pw/W61BpsxIIyI/AAAAAAAAE1g/7PcfVaa7n-we7qKu1eL8KREyZNONivWkQCLcBGAs/s400/8_1_a.png" width="210" /></a></div><div style="text-align: center;"><i>eight-eighteen 1</i></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-mpSogtdxrxE/W61B09sqsrI/AAAAAAAAE1k/h_4XIq6YdeUTYdXvW-Zp72wkK5hXGB64ACLcBGAs/s1600/8_1b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="601" data-original-width="293" height="400" src="https://1.bp.blogspot.com/-mpSogtdxrxE/W61B09sqsrI/AAAAAAAAE1k/h_4XIq6YdeUTYdXvW-Zp72wkK5hXGB64ACLcBGAs/s400/8_1b.png" width="195" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>eight-eighteen 2</i></div><br /><br />Experiment with these and others <a href="https://dmackinnon1.github.io/celtic/">here</a>.<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/hZjvd0mul9c" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/09/some-knots-and-not-knots.htmltag:blogger.com,1999:blog-5008879105295771159.post-84180077193600931802018-09-26T18:29:00.001-07:002018-09-26T18:29:21.224-07:00polynomial division practice pageI've added a new polynomial division page that generates random questions and asks you to fill in the answer, one step at a time. The page is <a href="https://dmackinnon1.github.io/polygrid/practice">here</a>, along with its partners - a polynomial division <a href="https://dmackinnon1.github.io/polygrid/calc.html">calculator</a> and <a href="https://dmackinnon1.github.io/polygrid/">example generator</a>.<br /><br /><div>The page presents you with a randomly generated question, like this:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-r1jkQHsHmBA/W6wqwH6i2-I/AAAAAAAAEyk/_XE1_EPE9C8jkZyUhpLfn7DbJsI7CdeEQCLcBGAs/s1600/question_division.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="53" data-original-width="226" src="https://1.bp.blogspot.com/-r1jkQHsHmBA/W6wqwH6i2-I/AAAAAAAAEyk/_XE1_EPE9C8jkZyUhpLfn7DbJsI7CdeEQCLcBGAs/s1600/question_division.png" /></a></div><div><br /></div><div>An initial grid is set up, with the divisor written down in the first column on the left. Everything else is unknown.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-DIh2jwC9ATQ/W6wrNI_pHVI/AAAAAAAAEys/E-JGyKG_KT8d3WSjnee1ITNY2KwnnVizACLcBGAs/s1600/first_grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="213" data-original-width="139" src="https://1.bp.blogspot.com/-DIh2jwC9ATQ/W6wrNI_pHVI/AAAAAAAAEys/E-JGyKG_KT8d3WSjnee1ITNY2KwnnVizACLcBGAs/s1600/first_grid.png" /></a></div><div><br /></div><div>This is a grid for polynomial multiplication, but we only have one polynomial - we don't know what to put along the top for the other multiplicand. If we think of the division question as N/D = Q (numerator divided by denominator gives the quotient), the corresponding multiplication problem is DxQ = N, we have D (the denominator or divisor) and we want to find the Q to put along the top so that the contents of the grid give us N (the numerator or dividend). </div><div><br /></div><div>We start with the term with the highest degree in N. The page provides this prompt:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-hsMIJZwsDJk/W6ws4j79Y_I/AAAAAAAAEy4/x6EkohF-MZcXxYbPH6wojEY5ArPSYObkACLcBGAs/s1600/prompt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="191" data-original-width="259" src="https://2.bp.blogspot.com/-hsMIJZwsDJk/W6ws4j79Y_I/AAAAAAAAEy4/x6EkohF-MZcXxYbPH6wojEY5ArPSYObkACLcBGAs/s1600/prompt.png" /></a></div><div><br /></div><div>In terms of the grid, you are being asked for the coefficient for the term that will go in the leftmost empty cell in the top row.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-9tjS7DJphnE/W6wx6Nj-qgI/AAAAAAAAEz0/yGFc2umsi3YWsz9PPwrQ11BII4h1-A8dQCLcBGAs/s1600/data_in.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="104" data-original-width="228" src="https://1.bp.blogspot.com/-9tjS7DJphnE/W6wx6Nj-qgI/AAAAAAAAEz0/yGFc2umsi3YWsz9PPwrQ11BII4h1-A8dQCLcBGAs/s1600/data_in.png" /></a></div><div><br /></div><div>The correct entry is -2. This allows another column of the grid to be filled in:</div><div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-mcUl0znjBw4/W6wtUsNoS5I/AAAAAAAAEzA/bUp0YikqTCkITNj-ZKJL_DR0DPAtikPHwCLcBGAs/s1600/grid_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="249" data-original-width="168" src="https://2.bp.blogspot.com/-mcUl0znjBw4/W6wtUsNoS5I/AAAAAAAAEzA/bUp0YikqTCkITNj-ZKJL_DR0DPAtikPHwCLcBGAs/s1600/grid_2.png" /></a></div><div><br /></div><div>Now we look at the next term in N, following this prompt:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-A1aImn8obSE/W6wuJ7d2RmI/AAAAAAAAEzM/yleCV5sa7tYNmI4fpoS51xDbkugAbGT4QCLcBGAs/s1600/prompt_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="160" data-original-width="373" src="https://1.bp.blogspot.com/-A1aImn8obSE/W6wuJ7d2RmI/AAAAAAAAEzM/yleCV5sa7tYNmI4fpoS51xDbkugAbGT4QCLcBGAs/s1600/prompt_2.png" /></a></div><div><br /></div><div>It turns out that no degree 1 term is needed in the solution since we already have all we need in the grid. When doing these by hand, you can just move on to the constant term, but on this page you actually need to put a 0 in the degree 1 column.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Tbj7J7XpeH0/W6wvJF2ijyI/AAAAAAAAEzY/-f_x3DNxuPMclmax5Q3V8d2gsPRXe5IuQCLcBGAs/s1600/grid_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="249" data-original-width="163" src="https://4.bp.blogspot.com/-Tbj7J7XpeH0/W6wvJF2ijyI/AAAAAAAAEzY/-f_x3DNxuPMclmax5Q3V8d2gsPRXe5IuQCLcBGAs/s1600/grid_3.png" /></a></div><div><br /></div><div>Moving on to the next term in N, we get this prompt:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-C_4p-z175S8/W6wvgBzQkII/AAAAAAAAEzg/vvIh1v1Rzh4qr1BwAuBqHB-B7hVrMMZYQCLcBGAs/s1600/prompt_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="158" data-original-width="373" src="https://3.bp.blogspot.com/-C_4p-z175S8/W6wvgBzQkII/AAAAAAAAEzg/vvIh1v1Rzh4qr1BwAuBqHB-B7hVrMMZYQCLcBGAs/s1600/prompt_3.png" /></a></div><div><br /></div><div>Since there are no degree 2 terms in the table, the coefficient required is 4.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-kN_ZpQ99yh8/W6wwAe8ZG1I/AAAAAAAAEzo/Q46RJrqCVpMw3MYRdFIVBy_a9rzkVsmgQCLcBGAs/s1600/end.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="425" data-original-width="302" src="https://1.bp.blogspot.com/-kN_ZpQ99yh8/W6wwAe8ZG1I/AAAAAAAAEzo/Q46RJrqCVpMw3MYRdFIVBy_a9rzkVsmgQCLcBGAs/s1600/end.png" /></a></div><div><br /></div><div>... and it turns out that the linear term also works out, as there is no remainder in this case. </div><div><br /></div>Try out the polynomial division practice page <a href="https://dmackinnon1.github.io/polygrid/practice">here</a>, and visit <a href="http://www.mathrecreation.com/p/blog-page.html">this page</a> for links to other posts and resources on the topic.<br /><br /><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/CxX5ffZXIEc" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/09/polynomial-division-practice-page.htmltag:blogger.com,1999:blog-5008879105295771159.post-60915930030236492742018-09-25T12:42:00.000-07:002018-09-25T12:42:27.366-07:00what day is it, usually?In the Forest of Forgetfulness, Alice is trying to find out what day it is, and the unreliable denizens of the forest are not helping much. The Lion lies on Monday, Tuesday, and Wednesday and the Unicorn Lies on Thursday, Friday, and Saturday. What's more, each of them only makes one statement, and from that Alice must make her deduction.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-7-U1LlkPqLA/W6QRt0xIpqI/AAAAAAAAExw/3uS99it4lYwlGmK1ptpdoZRq1nTy6GWQACLcBGAs/s1600/lionandunicorn.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="604" data-original-width="824" height="234" src="https://3.bp.blogspot.com/-7-U1LlkPqLA/W6QRt0xIpqI/AAAAAAAAExw/3uS99it4lYwlGmK1ptpdoZRq1nTy6GWQACLcBGAs/s320/lionandunicorn.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><em style="background-color: white; box-sizing: border-box; color: #333333; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; text-align: start;">Illustration by <a href="https://en.wikipedia.org/wiki/John_Tenniel" style="background-color: transparent; box-sizing: border-box; color: #337ab7; text-decoration-line: none;">John Tenniel</a> (public domain)</em></div><br />You can try to solve some of these puzzles <a href="https://dmackinnon1.github.io/forgetfulForest/">here</a>, and read about how you might solve them <a href="http://www.mathrecreation.com/2018/09/solving-some-logic-puzzles-with-sets.html">here</a>.<br /><br />Inspired by the original puzzles in <i>What is the Name of this Book?</i> by Raymond Smullyan, the Lion and Unicorn will say things like: "I told truths yesterday," or "tomorrow is one of my lying days."<br /><br />If we generate a bunch of puzzles where X says "Y tells lies|truths yesterday|today|tomorrow" we end up with each creature being able to make 12 statements (after fixing the grammar a bit for verb tense). Two of those statements "I will tell truths today" (which can be said on any day), and "I will tell lies today" (which can never be said), can be thrown out, so we get 10 statements from each creature for a combined total of 100 possible puzzles. However, it turns out that only 43 of those combinations end up generating good puzzles (puzzles where the statements lead to a unique solution). What does the set of solutions look like? We know just from the number of solutions that the 7 days of the week are not equally represented. Here's what the frequencies look like:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Yt29pdF8pl0/W6QEY1x_4GI/AAAAAAAAExM/j07koIfgrgI4J-KYGVGa42d7UqkNfsa1ACLcBGAs/s1600/first_set.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="376" data-original-width="650" height="230" src="https://4.bp.blogspot.com/-Yt29pdF8pl0/W6QEY1x_4GI/AAAAAAAAExM/j07koIfgrgI4J-KYGVGa42d7UqkNfsa1ACLcBGAs/s400/first_set.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The first of Lion's lying days (Monday) and the last of the Unicorn's (Saturday) only occur once in the solution set, the last of the Lion's lying days (Wednesday) and the first of the Unicorns (Thursday) show up 10 times each. The most common day is the day where they are both honest, Sunday, with 21. In this forest, it is never Tuesday or Friday.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>Why not Tuesday or Friday?</b></div><div class="separator" style="clear: both; text-align: left;">This suggests a meta-puzzle: Why can Tuesday or Friday never be one of the puzzle solutions? If we look at what these days permit the Lion and Unicorn to say, we can see why this happens. Let's take Tuesday - this is a lying day for the Lion, and it happens right in the middle of Lion's lying day sequence (on Tuesday, yesterday, today, and tomorrow are all lying days). So this means the Lion can make the following statements (all lies):</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">I told truths today</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">I will tell truths tomorrow</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">I told truths yesterday</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Unicorn told lies today</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Unicorn told lies yesterday</span></div><div class="separator" style="clear: both; text-align: left;"></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Unicorn will tell lies tomorrow</span></div><div><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><br /></span></div><div><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">It is a truth-telling day for the Unicorn, who can say the following:</span></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">I told truths today</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">I will tell truths tomorrow</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">I told truths yesterday</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Lion told lies today</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Lion told lies yesterday</span></div><div class="separator" style="clear: both;"></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Lion will tell lies tomorrow</span></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">On Tuesday, the Lion and the Unicorn can all make exactly the same statements... and also make exactly the same statements on Friday. Consequently, there is no way to distinguish between Tuesday and Friday given any pair of these statements, or tell who is lying and who is telling the truth. So none of the 36 puzzles formed by these sets of statements (the ones that could possibly be about Tuesday or Friday) are well formed puzzles (that have a unique solution).</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b><a href="https://en.wikipedia.org/wiki/Everyday_Is_Like_Sunday">Everyday is, like, Sunday</a></b></div><div class="separator" style="clear: both; text-align: left;">Why is it that Sunday is so well represented in the set of puzzle solutions? Very close to half of our puzzles have Sunday as the solution (21/43). <a href="https://dmackinnon1.github.io/forgetfulForest/?id=4">Here's an example</a> of one of those puzzles, and <a href="https://dmackinnon1.github.io/forgetfulForest/?id=8">here is another</a>.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">We can see how Sunday gets 21 days by listing the possible statements that can be made on that day, and seeing how the statements interact with each other. In round brackets after each statement we list all the days on which it is possible for the statement to be made (Sunday, plus some other days in some cases)</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><b>Lion's Sunday statements (all true)</b></span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">I will tell lies tomorrow (Sunday, Wednesday) [5]</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">I told truths yesterday (Sunday, Tuesday, Wednesday, Friday) [3]</span></div><div class="separator" style="clear: both; text-align: left;"><b id="docs-internal-guid-b279c420-7fff-6622-6e62-5ab3514c2da5" style="font-weight: normal;"><br /></b></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Unicorn told truths today (Sunday) [5]</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Unicorn told lies yesterday (Sunday, Monday, Tuesday, Wednesday, Friday, Saturday) [3]</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Unicorn will tell truths tomorrow (Sunday, Wednesday) [5]</span></div><div class="separator" style="clear: both; text-align: left;"><b style="font-weight: normal;"><br /></b></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial;"><span style="font-size: 14.6667px; white-space: pre-wrap;"><b>Unicorn's Sunday statements (also all true)</b></span></span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">I will tell truths tomorrow (Sunday, Monday, Thursday, Friday)</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">I told lies yesterday (Sunday, Thursday)</span></div><div class="separator" style="clear: both; text-align: left;"><b style="font-weight: normal;"><br /></b></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Lion told truths today (Sunday)</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Lion told the truth yesterday (Sunday, Thursday)</span></div><div class="separator" style="clear: both; text-align: left;"></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Lion will tell lies tomorrow (Sunday, Monday, Tuesday, Thursday, Saturday)</span></div><div><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br /></span></div><div class="separator" style="clear: both; text-align: left;">Next to the Lion's statements, in square brackets we list the number of Unicorn statements that share no common days except Sunday. To Lion's statement "I will tell lies tomorrow," which can only be said on Sunday and Wednesday, all five of the Unicorn's statements can be paired to form a puzzle who's only solution is Sunday (none of the Unicorn's Sunday statements can also be made on a Wednesday). Counting up all the pairings from the list above we get 5 + 3 + 5 + 3 + 5 = 21.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>Filling in some gaps</b></div><pre style="background-color: white; border-radius: 0px; border: 0px; box-sizing: border-box; font-size: 14px; line-height: inherit; overflow-wrap: break-word; overflow: auto; padding: 1px 0px; vertical-align: baseline; white-space: pre-wrap; word-break: break-all;"></pre>We'd like to have more puzzles, have every day represented, and not have so many Sundays. For a start, we can get some more puzzles by allowing each creature to say simply "today is Monday" or one of the other days of the week. Adding these statements increases our valid puzzle count by 67 to 110 puzzles (out of a possible 17^2 = 289 statement combinations).<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-8jbi3ExcBv4/W6QGia5y2QI/AAAAAAAAExY/iz5OEJpxtPE5fVqQQptSyZIt0IHnO7KhACLcBGAs/s1600/more_days.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="378" data-original-width="648" height="232" src="https://1.bp.blogspot.com/-8jbi3ExcBv4/W6QGia5y2QI/AAAAAAAAExY/iz5OEJpxtPE5fVqQQptSyZIt0IHnO7KhACLcBGAs/s400/more_days.png" width="400" /></a></div>Sunday more than doubles its frequency, now at 47 occurrences, and Tuesday and Friday make it in with 6 occurrences each. Monday and Saturday get 10 more occurrences, and Wednesday and Thursday get 26.<br /><br />What else could we have the Lion and Unicorn say? We want them to be able to make a statement that provides a set of days as candidates for today. One example is to allow them to say "today is a weekday" or "today is the weekend." You can try out one of these puzzles <a href="https://dmackinnon1.github.io/forgetfulForest/?id=131">here</a> (The Lion says it is the weekend, the Unicorn says it is Friday).<br /><br />Adding these two statements extend the number of statement combinations to 19^2=361, and extends the number of valid puzzles to 132. Because the 'weekend' and 'weekday' sets do not line up with the Lion and Unicorn lying days (Unicorn lies on one of the weekend days), the solution distribution is no longer symmetrical.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-XknETO2Yq78/W6QKg0rklNI/AAAAAAAAExk/POHHWagMC84bHV_E-CyyoAtXsaHrmlH4QCLcBGAs/s1600/final_distribution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="368" data-original-width="638" height="230" src="https://3.bp.blogspot.com/-XknETO2Yq78/W6QKg0rklNI/AAAAAAAAExk/POHHWagMC84bHV_E-CyyoAtXsaHrmlH4QCLcBGAs/s400/final_distribution.png" width="400" /></a></div><br />Monday shows up 12 times, Tuesday 6, Wednesday 38, Thursday 42, Friday 10, Saturday 13, and Sunday 54 times (down to about 41% of the puzzles).<br /><br />Can we think of more statements for the Lion and the Unicorn? Sure. But with 132 puzzles to solve, let's stop here for now. Other interesting ways to change the number of solutions and their distribution is to change which days the are "truthful" for our forest friends - what if they are honest more often, and what if their lying days overlap? You can play with those questions by modifying the notebook <a href="https://gist.github.com/dmackinnon1/098dd90adf8312a1da2c02860798e496">here</a>.<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/hMjT8QCshJs" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/09/what-day-is-it-usually.htmltag:blogger.com,1999:blog-5008879105295771159.post-74195910201578142202018-09-15T19:03:00.000-07:002018-11-17T19:32:21.357-08:00Solving (some) Logic Puzzles with Sets<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">MathJax.Hub.Typeset(); </script><div>As you may have noticed, since <a href="http://www.mathrecreation.com/2017/11/the-island-of-knights-and-knaves.html">around this time last year</a>, I have been playing around with generating puzzles based on those found in some of Raymond Smullyan's books. This has included <a href="https://dmackinnon1.github.io/knaves/">Knights and Knaves</a>, <a href="https://dmackinnon1.github.io/portia/">Portia's Caskets</a>, <a href="https://dmackinnon1.github.io/inspectorCraig/">The Case Files of Inspector Craig</a>, <a href="https://dmackinnon1.github.io/inspectorCraig/tiger.html">Tigers and Treasure</a>, and <a href="https://dmackinnon1.github.io/inspectorCraig/dreamers.html">The Isle of Dreams</a>. Some of the differences between puzzles are superficial: A "Portia's Casket" puzzle can be recast as a "Knights and Knaves" puzzle, for example. Even though there is some common deep structure to these various puzzles, I've found that sometimes the puzzle types call out for different approaches when writing solvers or generators.<br /><br /></div><div>The latest puzzle type that I have been enjoying is based on some puzzles found in Smullyan's <i><a href="https://archive.org/details/WhatIsTheNameOfThisBook">What is the Name of This Book?</a>. </i>The "Lion and the Unicorn" puzzles are built around characters from Lewis Carroll's <a href="https://en.wikipedia.org/wiki/Through_the_Looking-Glass" style="font-style: italic;">Through the Looking-Glass, and What Alice Found There</a><i>, </i>and for this logic puzzle variation, I found that using <a href="https://en.wikipedia.org/wiki/Set_theory">sets</a> to model the puzzle (rather than, say, <a href="http://www.mathrecreation.com/2018/02/inspector-craig-logical-detective.html">propositions</a>, <a href="http://www.mathrecreation.com/2017/12/constructing-portias-caskets.html">truth tables</a>, or <a href="http://www.mathrecreation.com/2012/05/liar-truther-accusation-graphs.html">graphs</a>) seemed to make the most sense.</div><div><i><br /></i></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-6rRGBW_aU-A/W5v_RUleF-I/AAAAAAAAEuc/6sofCKRx63w2mk3qEV25VHPwqbtJvHQSwCLcBGAs/s1600/lion_unicorn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="424" data-original-width="660" height="205" src="https://1.bp.blogspot.com/-6rRGBW_aU-A/W5v_RUleF-I/AAAAAAAAEuc/6sofCKRx63w2mk3qEV25VHPwqbtJvHQSwCLcBGAs/s320/lion_unicorn.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>The Lion and the Unicorn, posing <br />at the <a href="https://en.wikipedia.org/wiki/East_Block">East Block</a> </i></div><div><br /></div><div>As described in the chapter 47 <i>Alice and the Forest of Forgetfulness</i>,</div><blockquote class="tr_bq"><i>When Alice entered the Forest of Forgetfulness, she did not forget everything, only certain things. She often forgot her name, and the one thing she was most likely to forget was the day of the week. Now, the Lion and the Unicorn were frequent visitors to the forest. These two are strange creatures. The Lion lies on Mondays, Tuesdays, and Wednesdays, and tells the truth on the other days of the week. The Unicorn, on the other hand, lies on Thursdays, Fridays, and Saturdays, but tells the truth on other days of the week.</i></blockquote><blockquote class="tr_bq"><i>One day, Alice met the Lion and the Unicorn resting under a tree. They made the following statements:</i> </blockquote><blockquote class="tr_bq"><i>Lion: Yesterday was one of my lying days.</i> </blockquote><blockquote class="tr_bq"><i>Unicorn: Yesterday was one of my lying days too.</i></blockquote><blockquote class="tr_bq"><i>Alice must know: What day is today? </i></blockquote>If you think you have a solution to this - test it out on <a href="https://dmackinnon1.github.io/forgetfulForest/?id=15">the interactive version of the puzzle</a>.<br /><br />If we model this using sets, our <a href="https://en.wikipedia.org/wiki/Domain_of_discourse">universe of discourse</a> for this problem is the days of the week.<br />$$ \begin{split} Days =& \{\textrm{Monday, Tuesday, Wednesday,} \\ & \textrm{Thursday, Friday, Saturday, Sunday} \} \end{split} $$ We consider the set <i>L</i> of days for which the lion is lying, and the set <i>U</i> of days for which the unicorn is lying.<br />$$ \begin{split} L =& \{ \textrm{Monday, Tuesday, Wednesday}\} \\ U =& \{ \textrm{Thursday, Friday, Saturday}\} \end{split} $$<br />The days that the animals are telling the truth are listed in the complements of each set.<br />$$ \begin{split} \overline{L} =&\{ \textrm{Thursday, Friday, Saturday, Sunday}\} \\ \overline{U} =& \{ \textrm{Sunday, Monday, Tuesday, Wednesday}\} \end{split} $$ These two sets have an empty intersection - the two characters never lie at the same time. The intersection of their truth-telling days is non empty, however: both tell the truth on the same day once a week.<br />$$ \begin{split} L \cap U =& \emptyset \\ \overline{L} \cap \overline{U} =& \{ \textrm{Sunday} \} \end{split} $$ The set <i>Days</i> is a set with structure, the days are an ordered set - the lion and the unicorn can talk about 'yesterday' and 'tomorrow.' For any set of days we can ask for its 'tomorrows' - the set of next days, or its set of 'yesterdays', the set of preceding days. When the lion says "I told lies yesterday" this can be translated as "today is a tomorrow for one of my lying days." The set of days covered by Lion's statement would be:<br />$$ S_L = t(L) = \{ \textrm{Tuesday, Wednesday, Thursday}\} $$ But do any of the days covered by Lion's statement coincide with a day that he is telling the truth? To believe his statement about what day it is, it must describe a day that he is actually speaking truthfully. If Lion is telling the truth, it must be a day in the intersection of the days in Lion's statement and the set of Lion's truthful days.<br />$$S_L \cap \overline{L} = \{ \textrm{Thursday}\}$$ But, Lion could be lying. If Lion is lying, then today is in the intersection of the days not in Lion's statement, and Lion's lying days.<br />$$\overline{S_L} \cap L = \{ \textrm{Monday} \}$$ Since we don't know whether the lion is telling the truth or lying, we have to consider both possibilities, so the set of days that it could be, based only on Lion's statement is: $$ \begin{split} D_L &= ( S_L \cap \overline{L} ) \cup ( \overline{S_L} \cap L ) \\ &= \{ \textrm{Monday, Thursday} \} \end{split} $$ Going through a similar process, we can get another set of days based on the Unicorn's statements.<br />$$ \begin{split} D_U &= ( S_U \cap \overline{U} ) \cup ( \overline{S_U} \cap U ) \\ &= \{ \textrm{Sunday, Thursday} \} \end{split} $$ Days that fall in both the set from the Lion <i>and</i> the set from the Unicorn are possible solutions for today's day - if the intersection is empty, then there is no solution, if there are several days in the intersection, then the puzzle is ambiguous, if there is a single day in the intersection, that is today:<br />$$ \begin{split} D &= D_L \cap D_U \\ &= [ (S_L \cap \overline{L} ) \cup ( \overline{S_L} \cap L)] \cap [ (S_U \cap \overline{U} ) \cup ( \overline{S_U} \cap U)] \\ &= \{ \textrm{Thursday} \} \end{split} $$ The notation might make this way of thinking seem difficult - here is the process stated a bit more plainly (see that it lines up with the formula above...):<br /><br />1. Consider the Lion. Which days does the Lion's statement refer to?<br />2. Of these days, which coincide with Lion's truthful days?<br />3. Which of the days are not covered by the Lion's statement? Do any of these coincide with Lion's lying days?<br />4. Combine these two lists of days from the Lion.<br />5. Follow steps 1 through 4 for the Unicorn to produce a list of possible days from the Unicorn.<br />6. If there is one day that that is in both the Lion's list and the Unicorn's list, that is the solution.<br /><br />We can come up with variations on this puzzle by varying the statements made by the Lion and the Unicorn. Instead of saying "I told lies yesterday," we could have them say things like "I will tell truths tomorrow" or "today is a week day", or even "today is Wednesday." Some of these will generate good puzzles (one element in the final set), others may not.<br /><br />A Jupyter notebook that generates 132 puzzles like this can be found <a href="https://gist.github.com/dmackinnon1/098dd90adf8312a1da2c02860798e496">here</a>, and you can the puzzles out <a href="https://dmackinnon1.github.io/forgetfulForest/">over here</a>.<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/KW7gw8ZK4DQ" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/09/solving-some-logic-puzzles-with-sets.htmltag:blogger.com,1999:blog-5008879105295771159.post-41930987375559270652018-09-06T11:13:00.000-07:002018-11-29T07:46:16.577-08:00generating celtic knot patternsThis post describes an algorithm for generating <a href="https://en.wikipedia.org/wiki/Celtic_knot">celtic knot patterns</a> - ornamental knots, links, and braids that are laid out in a grid, like the one below:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-7MzshhMqWPY/W144X-DdLvI/AAAAAAAAEoA/G4Wpg9Cbnd0rdtBFrbGKSXT9Jx_LLKU-ACLcBGAs/s1600/simple2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="408" data-original-width="266" height="320" src="https://2.bp.blogspot.com/-7MzshhMqWPY/W144X-DdLvI/AAAAAAAAEoA/G4Wpg9Cbnd0rdtBFrbGKSXT9Jx_LLKU-ACLcBGAs/s320/simple2.png" width="208" /></a></div><br />If you would rather skip reading about how these are generated and start playing around with creating patterns like the one above, please try out the <a href="https://dmackinnon1.github.io/celtic/">editor</a> and <a href="https://dmackinnon1.github.io/celtic/random.html">random knot-pattern generator</a> that I've posted on my <a href="https://github.com/dmackinnon1">github</a> <a href="https://dmackinnon1.github.io/">pages</a>.<br /><br />I have tried out various strategies for generating these patterns (for example, <a href="https://www.mathrecreation.com/2008/07/knot-tiles.html">using</a> <a href="https://dmackinnon1.github.io/quiltic/">tiles</a>), but the method described here is closest to how I like to draw them by hand, as described in the book by Aidan Meehan, <i>Celtic Design: Knotwork - The Secret Method of the Scribes.</i> The variation offered here is intended to suggest how to write a program to generate these patterns based on a simplified version of the techniques in Meehan's book.<br /><br />A knot pattern is made up of strands that represent string or chord, and the gaps between the woven strands. The technique described below actually involves drawing the gaps, with the strands emerging out of the negative space between the gaps. Essentially, a grid of dots are drawn, and lines are selectively drawn between adjacent dots - these become the gaps between the strands. Additional rules are applied to connect the dots to create a woven effect, and the dots are replaced with polygons to create a more stylised effect.<br /><br /><b>1. define primary grid points</b><br />A knot pattern is laid out on a square coordinate system using a set of "primary" points that are set at one unit distances in the horizontal and vertical directions. We'll say that (0,0) is the top left corner of the grid, and the positive <i>x</i> direction is towards the right and positive <i>y</i> direction is down. The dimensions of the primary grid must be odd (there must be a total odd number of dots in both the <i>x</i> and <i>y</i> directions). Because we are starting with (0,0) in the top left, the top right point (<i>x</i>, 0) must have x even (4 in the example below), and the bottom left point (0,<i>y</i>) must have y even (6 in the example below).<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-y34mxxvpzV4/W3jo0AZGwxI/AAAAAAAAEps/cu4LMR9-lCwxLEEZylF8kQRdG-aF368fACLcBGAs/s1600/primaryGrid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="390" data-original-width="325" height="320" src="https://1.bp.blogspot.com/-y34mxxvpzV4/W3jo0AZGwxI/AAAAAAAAEps/cu4LMR9-lCwxLEEZylF8kQRdG-aF368fACLcBGAs/s320/primaryGrid.png" width="266" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>the primary grid</i></div><div class="separator" style="clear: both; text-align: center;"></div><br /><i>(Note: In Meehan's account, things are layered a little differently so what we are calling the primary grid is referred to as the tertiary grid.)</i><br /><i><br /></i><b>2. identify secondary grid points</b><br />Some of the points on the grid are special - these form a secondary grid. The special secondary grid points are those where both <i>x</i> and <i>y</i> values are even, or both are odd.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-_as6VLcVf2Q/W3juJ6Rc97I/AAAAAAAAEqE/R8zNfSQTLdEQwqbHXtO_x_yK6AuEvSZXgCLcBGAs/s1600/secondaryGrid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="389" data-original-width="319" height="320" src="https://1.bp.blogspot.com/-_as6VLcVf2Q/W3juJ6Rc97I/AAAAAAAAEqE/R8zNfSQTLdEQwqbHXtO_x_yK6AuEvSZXgCLcBGAs/s320/secondaryGrid.png" width="262" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>the secondary grid</i></div><div class="separator" style="clear: both; text-align: center;"></div><br />In step 4 below, the secondary grid points where both <i>x</i> and <i>y</i> are even will be referred to as <i>even nodes</i>, and those that have both <i>x</i> and <i>y</i> odd will be referred to as <i>odd nodes</i>. The requirement to have the primary grid have odd dimensions (step 1) was needed to ensure that the corners of the pattern are all secondary points.<br /><i><br /></i><b>3. draw a quadrilateral around the nodes</b><br />Each node will become a gap in the node pattern - the basic shape of a gap is quadrilateral whose vertices lie 1/4 unit above, below, and to the right and left of each node.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/--t3hg3zsdOM/W5FMtD9MRxI/AAAAAAAAEr4/OKuDX3WZLG4BPnWzbqvzHwNWL5sZPcFiACLcBGAs/s1600/single_node.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="460" data-original-width="494" height="185" src="https://2.bp.blogspot.com/--t3hg3zsdOM/W5FMtD9MRxI/AAAAAAAAEr4/OKuDX3WZLG4BPnWzbqvzHwNWL5sZPcFiACLcBGAs/s200/single_node.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>the basic node polygon</i></div><br />With all of the polygons drawn for the nodes, we get a grid of 'diamonds' like this:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-ET807dyA3HE/W5FM-EnRmOI/AAAAAAAAEsA/N4_1dBLs4_oVMKvnTgO2BDcUY3yGVk04ACLcBGAs/s1600/nodes_drawn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="504" data-original-width="381" height="320" src="https://2.bp.blogspot.com/-ET807dyA3HE/W5FM-EnRmOI/AAAAAAAAEsA/N4_1dBLs4_oVMKvnTgO2BDcUY3yGVk04ACLcBGAs/s320/nodes_drawn.png" width="241" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>node polygons drawn for <br />secondary grid points</i></div><br /><br /><b>4. extend lines from node polygon vertices</b><br />To create a woven affect, we extend lines from the vertices of each node polygon<br /><div><br /></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-zKOgNlz1N10/W5FT9rVXZfI/AAAAAAAAEsY/XIkvTeWh0DsNpMvY3XIf6t2Z7iIQz6PugCLcBGAs/s1600/even_odd2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="340" data-original-width="681" height="198" src="https://1.bp.blogspot.com/-zKOgNlz1N10/W5FT9rVXZfI/AAAAAAAAEsY/XIkvTeWh0DsNpMvY3XIf6t2Z7iIQz6PugCLcBGAs/s400/even_odd2.png" width="400" /></a></div><br />Doing this for all nodes creates an image like the one below.￼<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-gq2iIPW4slI/W5FUg6BpWgI/AAAAAAAAEsg/adCCwZr4NdcxOVN5grDr5XwaqJ9RYFUwwCLcBGAs/s1600/with_node_lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="496" data-original-width="376" height="320" src="https://1.bp.blogspot.com/-gq2iIPW4slI/W5FUg6BpWgI/AAAAAAAAEsg/adCCwZr4NdcxOVN5grDr5XwaqJ9RYFUwwCLcBGAs/s320/with_node_lines.png" width="242" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>lines extended from node <br />polygon vertices</i></div><br />If you exchange the rules for odd and even nodes, you end up with a correct "opposite" weave: strands that were going under instead go over, and vice-versa.<br /><br /><b>5<i>. </i>place barriers, drop lines</b><br />In the above image, the simple woven pattern seems to extend off the sides. To create an edge boundary for the pattern, and to create more interesting twists and turns, we follow some rules for drawing boundaries.<br /><br /><i>boundary rule 1</i>: A boundary can connect any two non-diagonally adjacent nodes (secondary points), as long as rule 2 is not violated. The midpoint of a boundary segment will be a primary point.<br /><br /><i>boundary rule 2</i>: A primary point cannot have more than one boundary going through it.<br /><br />The example below shows boundaries drawn along the edge of the image, as well as some internal boundaries.<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-XDC8Vzno7ag/W5FX3GvDtEI/AAAAAAAAEss/9aZ6blad8QsVf20U8GizQpuyCtBXwvoNACLcBGAs/s1600/boundaries_drawn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="493" data-original-width="375" height="320" src="https://4.bp.blogspot.com/-XDC8Vzno7ag/W5FX3GvDtEI/AAAAAAAAEss/9aZ6blad8QsVf20U8GizQpuyCtBXwvoNACLcBGAs/s320/boundaries_drawn.png" width="243" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>legal boundary examples, showing<br />primary and secondary points <br />(node polygons are hidden)</i></div><br />Now that we have introduced boundaries, we refine how lines are drawn coming out of the nodes (adjusting step 4):<br /><br /><i>node-line rule</i>: Only draw a line from a node vertex if there is no boundary across from the vertex.<br /><br />Applying the node-line rule, and drawing the polygons (and dropping the primary grid points) we get an image like the one below, where the weaving respects the boundaries - the strands (in white) that emerge seem to bounce off the edges and twist to avoid internal boundaries.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-L9mi8Yh-s1E/W5FYSMhfGbI/AAAAAAAAEs0/cHgspXAbMvEqIMFCWqLW-bQk3deLcfqFACLcBGAs/s1600/lines_adjusted.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="490" data-original-width="372" height="320" src="https://2.bp.blogspot.com/-L9mi8Yh-s1E/W5FYSMhfGbI/AAAAAAAAEs0/cHgspXAbMvEqIMFCWqLW-bQk3deLcfqFACLcBGAs/s320/lines_adjusted.png" width="242" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>node polygons, boundaries, and lines </i></div><br /><b>6. refine node polygons</b><br />We can apply some styling rules to make the pattern look smoother - these changes to our original node polygon (step 3) will be based on whether or not there are boundaries next to the node.<br /><br /><i>node-style rule</i>: Truncate (chop off) the vertex of a node polygon that is next to a boundary.<br /><br />Below is the same pattern above, but with the node polygons following the node-style rule. You can see the effects of the rule most clearly by looking at the nodes near the edge of the image, and particularly the corner nodes.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-ygiFmXyjcUs/W5FZpkRqmNI/AAAAAAAAEtA/ePo2urD5q4sC3hgde3x6ibXcFm8XRhDTgCLcBGAs/s1600/truncated_nodes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="489" data-original-width="369" height="320" src="https://3.bp.blogspot.com/-ygiFmXyjcUs/W5FZpkRqmNI/AAAAAAAAEtA/ePo2urD5q4sC3hgde3x6ibXcFm8XRhDTgCLcBGAs/s320/truncated_nodes.png" width="241" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>pattern using truncated <br />node polygons</i></div><br />It is possible to add further adjustments to how the nodes and lines are drawn to create smoother looking knot patterns. I have experimented a bit, but have not obtained great results. Here's an example of the same patter above that adjusts the node polygons and line thicknesses:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-4cRMWYlA7pA/W5FcTUdtojI/AAAAAAAAEtM/3CmRPPHiRIoonOXJWcL-bP6DJBKf_-FnwCLcBGAs/s1600/curvy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="495" data-original-width="372" height="320" src="https://3.bp.blogspot.com/-4cRMWYlA7pA/W5FcTUdtojI/AAAAAAAAEtM/3CmRPPHiRIoonOXJWcL-bP6DJBKf_-FnwCLcBGAs/s320/curvy.png" width="240" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>a slightly different style applied <br />to the knot pattern</i></div><br />I hope you enjoy playing around with this - either implementing the process described above yourself or playing around with this <a href="https://dmackinnon1.github.io/celtic/">version</a>.<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/rbt0WohbdmI" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/09/generating-celtic-knot-patterns.htmltag:blogger.com,1999:blog-5008879105295771159.post-44174192182209213472018-06-06T19:12:00.000-07:002018-06-06T19:12:29.648-07:00origami workshop againA few years back, I posted <a href="http://www.mathrecreation.com/2014/05/origami-workshop.html">some notes about an origami workshop</a> that I had run with some middle school students. Last week I had the opportunity to run origami workshops with similar groups of students, using many of the same models I mentioned before (including the <a href="http://www.mathrecreation.com/2011/01/simple-origami-and-math-jumping-frog.html">hopping frog</a>).<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-bRCYlScF1Us/U4VR4FHWI3I/AAAAAAAACes/YM28JceeEror7hU5VotnyOVOQLEHYrpjgCPcBGAYYCw/s1600/frog-crease.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="228" data-original-width="368" height="198" src="https://4.bp.blogspot.com/-bRCYlScF1Us/U4VR4FHWI3I/AAAAAAAACes/YM28JceeEror7hU5VotnyOVOQLEHYrpjgCPcBGAYYCw/s320/frog-crease.JPG" width="320" /></a></div><br /><br />One nice model that I used this time that is not mentioned in that other post is the <a href="https://origamiusa.org/diagrams/multiform">multiform</a> (aka <a href="https://origamiusa.org/diagrams/multiform">windmill/pinwheel</a>) - a flexible hinged surface from which several simple models can be folded, including the <a href="https://makercamp.com/wp-content/uploads/2015/07/Origami-Pinwheel-Final.pdf">windmill</a>, the <a href="https://origamiusa.org/files/house.pdf">house</a>, and the <a href="http://make-origami.com/origami-pajarita/">pajarita</a>, and which can be extended to form the<a href="https://origamiusa.org/diagrams/masu"> masu box</a> and others.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-MNNXbpjnLJ4/Wxgi1_9w5cI/AAAAAAAAEjk/8ELLlEOGCJwI83oyYTEzmMnmMaYs018NQCLcBGAs/s1600/multiform.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="243" data-original-width="240" src="https://1.bp.blogspot.com/-MNNXbpjnLJ4/Wxgi1_9w5cI/AAAAAAAAEjk/8ELLlEOGCJwI83oyYTEzmMnmMaYs018NQCLcBGAs/s1600/multiform.PNG" /></a></div><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/a1tn7es3Mxg" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/06/origami-workshop-again.htmltag:blogger.com,1999:blog-5008879105295771159.post-52315105479506413092018-05-17T13:40:00.000-07:002018-05-18T14:46:07.489-07:00The Isle of DreamsAfter a short break, we are returning to some logic puzzles inspired by those of <a href="https://en.wikipedia.org/wiki/Raymond_Smullyan">Raymond Smullyan</a>. Earlier we visited the <a href="http://www.mathrecreation.com/2017/11/the-island-of-knights-and-knaves.html">island of knights and knaves</a>, looked into <a href="http://www.mathrecreation.com/2017/12/constructing-portias-caskets.html">Portia's caskets</a>, explored <a href="http://www.mathrecreation.com/2018/02/inspector-craig-logical-detective.html">the case files of Inspector Leslie Craig</a>, and looked behind doors for <a href="http://www.mathrecreation.com/2018/03/tigers-and-treasure.html">tigers and treasure</a>. In this post, we are visiting the <a href="https://dmackinnon1.github.io/inspectorCraig/dreamers.html">Isle of Dreams</a>. As Smullyan says in his book <i>The Lady or The Tiger?:</i><br /><blockquote class="tr_bq"><i>I once dreamed that there was a certain island called the Isle of Dreams. The inhabitants of this island dream quite vividly; indeed, their thoughts while asleep are as vivid as while awake. Moreover, their dream life has the same continuity from night to night as their waking life has from day to day. As a result, some of the inhabitants sometimes have difficulty in knowing whether they are awake or asleep at a given time. </i> </blockquote><blockquote class="tr_bq"><i>Now, it so happens that each inhabitant is of one of two types: diurnal or nocturnal. A diurnal inhabitant is characterised by the fact that everything he believes while he is awake is true, and everything he believes while he is asleep is false. A nocturnal inhabitant is the opposite: everything a nocturnal person believes while asleep is true, and everything he believes while awake is false. </i></blockquote>On this island then, each islander has a type (diurnal or nocturnal), and a state (awake or asleep), and based on their type and state, you can assess the veracity of their thoughts (either true or false).<br /><br />To play around with this, I decided to make some puzzles similar to ones found in <i>The Lady or The Tiger?</i>, but based on the thoughts of two islanders A and B. Each islander has two distinct thoughts: one about themselves (either about their state or their type), and one about the other (either their state or their type). Importantly, these thoughts occur to both A and B at exactly the same time. Here is an example:<br /><ul style="background-color: white; box-sizing: border-box; color: #333333; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; list-style-type: none; margin-bottom: 10px; margin-top: 0px; padding-left: 40px;"><li style="box-sizing: border-box; padding-bottom: 10px;"><br class="Apple-interchange-newline" />Islander <span style="box-sizing: border-box; font-weight: 700;">A</span> has two distinct thoughts at the same moment: <span style="box-sizing: border-box; font-weight: 700;">I am nocturnal. B is diurnal.</span></li><li style="box-sizing: border-box; padding-bottom: 10px;">At the same moment, islander <span style="box-sizing: border-box; font-weight: 700;">B</span> has these distinct thoughts: <span style="box-sizing: border-box; font-weight: 700;">I am awake. A is diurnal.</span></li></ul>We want to know: what is the actual type and state of both A and B? Can we know everything about them, or is their something about them that we cannot tell? Or maybe these thoughts are impossible, and lead to contradictions.<br /><br />To solve these kinds of puzzles, it helps to know the <b>Four Laws of the Isle of Dreams</b>:<br /><br /><ol style="background-color: white; box-sizing: border-box; color: #333333; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 10px; margin-top: 0px;"><em style="box-sizing: border-box;"><li style="box-sizing: border-box; padding-bottom: 10px;">An islander while awake will believe they are diurnal.</li><li style="box-sizing: border-box; padding-bottom: 10px;">An islander while asleep will believe they are nocturnal.</li><li style="box-sizing: border-box; padding-bottom: 10px;">Diurnal inhabitants at all times believe they are awake.</li><li style="box-sizing: border-box; padding-bottom: 10px;">Nocturnal inhabitants at all times believe they are asleep.</li></em></ol>Let's just establish the first law, and then you should try to convince yourself of the others. Consider the case of a diurnal awake islander: because they are diurnal and awake, they think true thoughts, so they will correctly think that they are diurnal. Second, consider the case of a nocturnal awake islander: because they are nocturnal and awake, they will think false thoughts, and will conclude that they are diurnal. So, no matter whether an islander is diurnal or nocturnal, when awake they will think they are diurnal (some correctly, some falsely). Using this along with rule 2, if an islander thinks they are diurnal, you should conclude that they are awake.<br /><br />Now back to the puzzle:<br /><br /><ul style="background-color: white; box-sizing: border-box; color: #333333; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; list-style-type: none; margin-bottom: 10px; margin-top: 0px; padding-left: 40px;"><li style="box-sizing: border-box; padding-bottom: 10px;">Islander <span style="box-sizing: border-box; font-weight: 700;">A</span> has two distinct thoughts at the same moment: <span style="box-sizing: border-box; font-weight: 700;">I am nocturnal. B is diurnal.</span></li><li style="box-sizing: border-box; padding-bottom: 10px;">At the same moment, islander <span style="box-sizing: border-box; font-weight: 700;">B</span> has these distinct thoughts: <span style="box-sizing: border-box; font-weight: 700;">I am awake. A is diurnal.</span></li></ul>Applying the four laws of the Isle of Dreams to the first thoughts of the islanders in the puzzle above, we know that A must be asleep (law 2) , and that B must be diurnal (law 3). Now turning to A's second thought: because they are asleep and thinking something that is true (B is diurnal) A must be nocturnal. B's second thought is not true, so since they are diurnal they must be asleep. So, A is nocturnal and asleep, while B is diurnal and asleep. Sweet dreams, A and B.<br /><br />How many puzzles can we make like this, where we have two islanders, each thinking something about their state or type and something about the state or type of the other? Well, there are 4 possible thoughts an islander could have about themselves (I am awake/asleep/nocturnal/diurnal) and 4 possible thoughts about the other (They are awake/asleep/nocturnal/diurnal), giving us 16 pairs of thoughts. Since there are two islanders involved, this gives 256 puzzles (really only 128 truly different puzzles, as A and B are interchangeable).<br /><br />You can try out all 256 of them, or as many as you like, <a href="https://dmackinnon1.github.io/inspectorCraig/dreamers.html">here</a>. They look something like this:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-B8xkwDTvbnU/Wv3c85aw_hI/AAAAAAAAEhQ/ZMteMv7XxeUd6Exda9Gt0ukrhpAGID65QCLcBGAs/s1600/example_dreamers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="715" data-original-width="625" height="400" src="https://4.bp.blogspot.com/-B8xkwDTvbnU/Wv3c85aw_hI/AAAAAAAAEhQ/ZMteMv7XxeUd6Exda9Gt0ukrhpAGID65QCLcBGAs/s400/example_dreamers.png" width="348" /></a></div><br /><br />This collection of puzzles has some interesting features. There are 192 that are completely solvable: you can find the type and state of both A and B from the thoughts that they think (like the example above). There are 32 partially solvable puzzles, where the first thoughts of A and B (their thoughts about themselves) tell us something about their state and type, but their second thoughts (about the other islander) are inconclusive. Finally, there are 32 puzzles included in the set where the thoughts of A and B are contradictory, and therefore impossible. We can include these contradictory items in the set, as the question page gives you the chance to identify these nasty puzzles.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-p1sHKw6In8A/Wv3ceCZdcsI/AAAAAAAAEhI/6qH1BNAU7Pwn_ReEejQ7Xab3bU-q0vf7ACLcBGAs/s1600/impossible.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="76" data-original-width="404" height="60" src="https://2.bp.blogspot.com/-p1sHKw6In8A/Wv3ceCZdcsI/AAAAAAAAEhI/6qH1BNAU7Pwn_ReEejQ7Xab3bU-q0vf7ACLcBGAs/s320/impossible.png" width="320" /></a></div><br /><br />It turns out that the distribution of the partially solvable and impossible puzzles display an interesting pattern. Let's consider all 16 pairs of thoughts, and make a graph showing which combinations are (a) completely solvable, (b) partially solvable, or (c) impossible.<br /><br />Here are the 16 pairs of thoughts an islander might have:<br /><br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">1: I am awake. The other is awake.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">2: I am awake. The other is asleep.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">3: I am awake. The other is diurnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">4: I am awake. The other is nocturnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">5: I am asleep. The other is awake.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">6: I am asleep. The other is asleep.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">7: I am asleep. The other is diurnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">8: I am asleep. The other is nocturnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">9: I am diurnal. The other is awake.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">10: I am diurnal. The other is asleep.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">11: I am diurnal. The other is diurnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">12: I am diurnal. The other is nocturnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">13: I am nocturnal. The other is awake.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">14: I am nocturnal. The other is asleep.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">15: I am nocturnal. The other is diurnal.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">16: I am nocturnal. The other is nocturnal.</span></div><br />Let's create a graph where the horizontal axis represents A's thoughts and the vertical axis represents B's thoughts. A white square on the graph represents a completely solvable puzzle for that x/y combination of thoughts, a grey square on the graph represents a partially solvable puzzle, and a black square represents an unsolvable puzzle.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-WhlMK3MXdlk/Wv3exT5xA5I/AAAAAAAAEhc/DZPERYBRsc0S5OdqpJI4z-gRAVmfSaR8gCLcBGAs/s1600/solvable_partial_unsolvable.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="369" data-original-width="621" height="237" src="https://1.bp.blogspot.com/-WhlMK3MXdlk/Wv3exT5xA5I/AAAAAAAAEhc/DZPERYBRsc0S5OdqpJI4z-gRAVmfSaR8gCLcBGAs/s400/solvable_partial_unsolvable.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>solvable, partially solvable, and unsolvable</i></div><div class="separator" style="clear: both; text-align: center;"><i>Isle of Dreams puzzles</i></div><br />This is really neat: the partially solvable and unsolvable combinations form an interesting pattern dispersed through the whitespace of the completely solvable puzzles. There are 16 "problem squares" of 4 puzzles that have a distinct symmetric pattern, and these 16 problem squares are arranged in 4 sets of 4 puzzles that also have an interesting symmetry.<br /><br />We'll zoom in on one of the "problem squares" to give a better picture of what the graph is displaying:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-E93QQ7495rE/Wv3hnWvDhpI/AAAAAAAAEho/EZ0zMwXJuXEWpGlPWh-wWF4ofW1AbzMiACLcBGAs/s1600/zoom_on_problem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="616" data-original-width="654" height="375" src="https://2.bp.blogspot.com/-E93QQ7495rE/Wv3hnWvDhpI/AAAAAAAAEho/EZ0zMwXJuXEWpGlPWh-wWF4ofW1AbzMiACLcBGAs/s400/zoom_on_problem.png" width="400" /></a></div><br />Let's look at one of the contradictory puzzles - the one in the bottom left of this "problem square."<br /><br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: "arial"; font-size: 11pt; white-space: pre-wrap;">A is thinking #1: I am awake. The other is awake.</span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span id="docs-internal-guid-07c77f0e-6fbd-c05e-6c51-0dce1ce2751d"></span></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">B is thinking #5: I am asleep. The other is awake.</span></div><br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">From their first thoughts, we know that A is diurnal and B is nocturnal. If A is awake, they they will think true thoughts and consequently B is awake. If B is awake, they must be thinking false thoughts, requiring A to be asleep - a contradiction. On the other hand, if A is asleep, they will be thinking false thoughts, so B will be asleep. B will then be thinking true thoughts, requiring A to be awake, again a contradiction.</div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><br /></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">But why to these partial/contradictory puzzles form the patterns that they do? Maybe we will return again to the Isle of Dreams someday to find an answer.<br /><br /><i>Try the puzzles out here: <a href="https://dmackinnon1.github.io/inspectorCraig/dreamers.html">https://dmackinnon1.github.io/inspectorCraig/dreamers.html</a></i></div><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><br /></div><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/81KCWVRgmY0" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/05/the-isle-of-dreams.htmltag:blogger.com,1999:blog-5008879105295771159.post-30807986829181909042018-05-06T10:37:00.000-07:002018-05-06T10:37:33.681-07:00more bipartite art<div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-kO-VVkJEQz4/Wu8mB5TPEBI/AAAAAAAAEfQ/Kq4BFSJvN8IdH9cwUDPsRyzzUopNlNNIACLcBGAs/s1600/12_48.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="503" data-original-width="501" height="320" src="https://2.bp.blogspot.com/-kO-VVkJEQz4/Wu8mB5TPEBI/AAAAAAAAEfQ/Kq4BFSJvN8IdH9cwUDPsRyzzUopNlNNIACLcBGAs/s320/12_48.PNG" width="318" /></a></div><br />Playing around with some of the images created by <a href="http://www.mathrecreation.com/2018/01/bipartite-art.html">connecting two sets of dots</a>. In this case, every dot from the second set is connected to every dot in the first set, and the two sets are arranged in concentric circles. In the picture above, the first set of dots has 12 equally spaced dots in a circle, and the second set has 48, but the second set is arranged on a circle whose radius is much, much larger than the first, so the lines from the second set to the first come in from a great distance.<br /><br />If both sets have 3 dots, both sets are on concentric circles, and one of the sets is on a much larger circle, you might get something like this:<br /><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-tf-R6hq9qAM/Wu8m5-mi8qI/AAAAAAAAEfY/Q0vcdMZaFAQomVkLwEiFYi4v4clJrDtXACLcBGAs/s1600/33.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="470" data-original-width="486" height="309" src="https://3.bp.blogspot.com/-tf-R6hq9qAM/Wu8m5-mi8qI/AAAAAAAAEfY/Q0vcdMZaFAQomVkLwEiFYi4v4clJrDtXACLcBGAs/s320/33.PNG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">The second set is so far out, that it looks like the lines from a point the second set are parallel. If the first set has 3 points and the second far-out set has 6 points, you might get something like this:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-E13MV-KPCqA/Wu8vZOVLIbI/AAAAAAAAEfo/zNfO54vY_KQc93o-vcl7rlumZXisCw5EQCLcBGAs/s1600/36.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="474" data-original-width="469" height="320" src="https://1.bp.blogspot.com/-E13MV-KPCqA/Wu8vZOVLIbI/AAAAAAAAEfo/zNfO54vY_KQc93o-vcl7rlumZXisCw5EQCLcBGAs/s320/36.PNG" width="316" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Increasing size of the far-out set to 18 points:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-SijU-7JodOg/Wu8vsDSktsI/AAAAAAAAEfw/y6MlxGXDE8wSRT8S8ijbpAJZNPb97yVsgCLcBGAs/s1600/318.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="483" data-original-width="490" height="315" src="https://1.bp.blogspot.com/-SijU-7JodOg/Wu8vsDSktsI/AAAAAAAAEfw/y6MlxGXDE8wSRT8S8ijbpAJZNPb97yVsgCLcBGAs/s320/318.PNG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Can you figure out the number of points in each set that would generate an image like this? You can test out your guesses <a href="https://dmackinnon1.github.io/bipartite2.html">here</a>.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-RCAEboGHv0c/Wu8x6D0DKBI/AAAAAAAAEf8/wULAJgeWGmkLs3zXOGH8L8Ir4PlJgYjxACLcBGAs/s1600/12_24.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="508" data-original-width="504" height="320" src="https://2.bp.blogspot.com/-RCAEboGHv0c/Wu8x6D0DKBI/AAAAAAAAEf8/wULAJgeWGmkLs3zXOGH8L8Ir4PlJgYjxACLcBGAs/s320/12_24.PNG" width="317" /></a></div><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/T4o_k9FDYYg" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/05/more-bipartite-art.htmltag:blogger.com,1999:blog-5008879105295771159.post-27807974621106457022018-04-27T20:04:00.001-07:002018-04-27T20:04:45.331-07:00some Chessboard Puzzle solutionsIn the <a href="http://www.mathrecreation.com/2018/04/mathematical-chessboard-puzzles.html">previous post</a> I mentioned some <a href="https://dmackinnon1.github.io/chessdom/puzzles.html">mathematical chessboard puzzle puzzles</a>, created as part of working through the book <a href="https://press.princeton.edu/titles/7714.html">Across the Board</a>, by John J. Watkins. This post provides some possible solutions to the puzzles on that <a href="https://dmackinnon1.github.io/chessdom/puzzles.html">puzzle page</a>.<br /><br /><b>Queens on a 5 by 5 board</b><br /><br />The puzzle "<i>Place 3 queens on a 5x5 chessboard. The board must be dominated</i>," is asking you to find the <b>minimal dominating set</b> for queens on a 5x5 board (3 is the queen's domination number for 5x5 boards). Here are two solutions:<br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-yHWI-d-cxQ4/WuJAcTHxXbI/AAAAAAAAEb4/0A7LTMW_IjMAx3bPI9hRTJIbfhTwpIR1ACLcBGAs/s1600/3on5Q_dom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="242" data-original-width="369" height="209" src="https://2.bp.blogspot.com/-yHWI-d-cxQ4/WuJAcTHxXbI/AAAAAAAAEb4/0A7LTMW_IjMAx3bPI9hRTJIbfhTwpIR1ACLcBGAs/s320/3on5Q_dom.png" width="320" /></a></div>The large dots show where the queens are placed, and a small dot appears on every square that is reachable by a queen. In the solution on the left, all three queens can be attacked, but in the solution on the right, the queen in the corner is uncovered.<br /><br />The puzzle "<i>Place 5 queens on a 5x5 chessboard. The board must be dominated. The pieces must be independent</i>," is asking you to find the <b>maximal independent set</b> for queens on a 5x5 board (5 is the queens independence number for 5x5 boards). Here's a solution:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-8MEGuNiIuuQ/WuJCHC7ZvbI/AAAAAAAAEcE/lDqJ8jccuW4IMkR7YKakfvP-lxCtVESvwCLcBGAs/s1600/5qon5_indep.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="237" data-original-width="189" src="https://3.bp.blogspot.com/-8MEGuNiIuuQ/WuJCHC7ZvbI/AAAAAAAAEcE/lDqJ8jccuW4IMkR7YKakfvP-lxCtVESvwCLcBGAs/s1600/5qon5_indep.png" /></a></div><br />There is also a puzzle that asks you to find an arrangement between the domination and independence numbers, "<i>Place 4 queens on a 5x5 chessboard. The board must be dominated. The pieces must be independent.</i>" Here is one solution for that:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-QDOdQQgqENg/WuJCzjdgqsI/AAAAAAAAEcM/Rdg9YVUNhbUV8By2jZJ7n3334rPxRmsWgCLcBGAs/s1600/4qon5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="173" data-original-width="175" src="https://1.bp.blogspot.com/-QDOdQQgqENg/WuJCzjdgqsI/AAAAAAAAEcM/Rdg9YVUNhbUV8By2jZJ7n3334rPxRmsWgCLcBGAs/s1600/4qon5.png" /></a></div><br /><div><br /></div><b>Queens on other boards</b><br /><br />On a 6x6 board, our queen puzzles will be bounded by the domination number of 3 and the independence number of 6. Here are solutions for those:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-3f4tpyvtFXA/WuJLgLh_PvI/AAAAAAAAEco/YQAqgiuJWG8NCkJn_QS5WnYoj2FfKEpvwCLcBGAs/s1600/3and6qon6_dand1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="269" data-original-width="427" src="https://1.bp.blogspot.com/-3f4tpyvtFXA/WuJLgLh_PvI/AAAAAAAAEco/YQAqgiuJWG8NCkJn_QS5WnYoj2FfKEpvwCLcBGAs/s1600/3and6qon6_dand1.png" /></a></div><br />In between these, we have "<i>Place 5 queens on a 6x6 chessboard. The board must be dominated. The pieces must be independent</i>;" here's a solution for that one:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-xWgpyGsXOTo/WuJMJe40RdI/AAAAAAAAEcw/WzFeuqBfUckjdryMcXJ0HaANT4tUntEDgCLcBGAs/s1600/5qon6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="211" data-original-width="209" src="https://1.bp.blogspot.com/-xWgpyGsXOTo/WuJMJe40RdI/AAAAAAAAEcw/WzFeuqBfUckjdryMcXJ0HaANT4tUntEDgCLcBGAs/s1600/5qon6.png" /></a></div><br /><div>Just to get a sense of what solutions to these might look like in general, let's jump up to 8x8. In this case, the domination number for queens is 5, so the puzzle in our set with the fewest queens on 8x8 is "<i>Place 5 queens on a 8x8 chessboard. The board must be dominated. The pieces must be independent</i>." Here is one solution:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-XWWDqFjyEqE/WuJEStJFqBI/AAAAAAAAEcY/wLgYQsD9tz0WwZRZSCOeUd73HxFjLTfoQCLcBGAs/s1600/5qon8_dom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="329" data-original-width="283" height="320" src="https://1.bp.blogspot.com/-XWWDqFjyEqE/WuJEStJFqBI/AAAAAAAAEcY/wLgYQsD9tz0WwZRZSCOeUd73HxFjLTfoQCLcBGAs/s320/5qon8_dom.png" width="275" /></a></div><div><br /></div><div>This particular solution is of interest because the pieces are in a pattern known as the Spencer-Cockayne construction, which can be used to find coverings of square boards of side length 9, 10, 11, and 12 as well. More interesting details can be found in <a href="https://press.princeton.edu/titles/7714.html">Across the Board</a>.</div><div><br /></div><div><b>Knights on a 5x5 board</b></div><div><br /></div><div>There are plenty of "independence and domination" problems for the knight on a 5x5 board, because the gap between the domination number (5) and the independence number (13) is so large (compared to queens on the 5x5, at least). Finding solutions for some of the intermediate numbers is a bit tricky, you may find. </div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-hzIr5CfaJT0/WuJPypRJQmI/AAAAAAAAEc8/-2YQW2w8xvUW8nOJPTzfMmrpEO9dknQngCLcBGAs/s1600/5and13knon5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="224" data-original-width="360" height="199" src="https://3.bp.blogspot.com/-hzIr5CfaJT0/WuJPypRJQmI/AAAAAAAAEc8/-2YQW2w8xvUW8nOJPTzfMmrpEO9dknQngCLcBGAs/s320/5and13knon5.png" width="320" /></a></div><div><br /></div><div>For example, here is a solution to "Place 9 knights on a 5x5 chessboard. The board must be dominated. The pieces must be independent":</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-F1rt9s5K31M/WuJQgrA-RfI/AAAAAAAAEdE/jEUh3LATBW0qs2eBmhJhDyvb7FKxMjzBgCLcBGAs/s1600/9kon5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="166" data-original-width="170" src="https://3.bp.blogspot.com/-F1rt9s5K31M/WuJQgrA-RfI/AAAAAAAAEdE/jEUh3LATBW0qs2eBmhJhDyvb7FKxMjzBgCLcBGAs/s1600/9kon5.png" /></a></div><div><br /></div><div><b>Knights on other boards</b></div><div><br /></div><div>All puzzles based on the maximum number of independent knights on a board have the same solution: put a knight on every square of the colour that has the most squares (on odd boards, one colour has more squares than the other). </div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/--pAItn3hric/WuJS1ykz_pI/AAAAAAAAEdQ/515O4Txd6wQCQgbybU01YPI2DJZOnY15gCLcBGAs/s1600/25knon7_ind.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="296" data-original-width="262" src="https://1.bp.blogspot.com/--pAItn3hric/WuJS1ykz_pI/AAAAAAAAEdQ/515O4Txd6wQCQgbybU01YPI2DJZOnY15gCLcBGAs/s1600/25knon7_ind.png" /></a></div><div><br /></div><div>Here is an example of a puzzle based on a "sub-optimal" dominating set that is also independent: "<i>Place 11 knights on a 6x6 chessboard. The board must be dominated. The pieces must be independent.</i>" And a solution:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-PshzFsN-kMA/WuJUMogMXUI/AAAAAAAAEdc/Fal1umOxLlwXo5JhlW2RzDUC4nnBockdACLcBGAs/s1600/11knon6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="211" data-original-width="208" src="https://2.bp.blogspot.com/-PshzFsN-kMA/WuJUMogMXUI/AAAAAAAAEdc/Fal1umOxLlwXo5JhlW2RzDUC4nnBockdACLcBGAs/s1600/11knon6.png" /></a></div><div></div><div><br /></div><div><b>Bishops on 5x5</b></div><div><br /></div><div>Of the remaining pieces that we have puzzles for, bishops, kings, and rooks, the bishop is the most interesting, and the 5x5 board gives a good idea of how to construct the puzzle solutions.</div><div><br />Consider these two puzzles:<br /><br />"<i>Place 5 bishops on a 5x5 chessboard. The board must be dominated. The pieces must be independent.</i>"<br /><br />"<i>Place 8 bishops on a 5x5 chessboard. The board must be dominated. The pieces must be independent</i>."<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-ta_mG10Yhiw/WuPI5irbKHI/AAAAAAAAEeM/Tyx2MSG9Sa8b3OIY_r_TOwRvoHouhSZLQCLcBGAs/s1600/5and8_bon5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="239" data-original-width="367" height="208" src="https://1.bp.blogspot.com/-ta_mG10Yhiw/WuPI5irbKHI/AAAAAAAAEeM/Tyx2MSG9Sa8b3OIY_r_TOwRvoHouhSZLQCLcBGAs/s320/5and8_bon5.png" width="320" /></a></div><br />The minimum dominating set for bishops on a 5x5 board has 5 pieces, and the maximum independent set has 8. In between these, we can also form puzzles based on non optimal dominating sets (that are also independent), such as:<br /><br />"<i>Place 6 bishops on a 5x5 chessboard. The board must be dominated. The pieces must be independent</i>."<br /><div><br /></div><div>"<i>Place 7 bishops on a 5x5 chessboard. The board must be dominated. The pieces must be independent.</i>"</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-awSxKOR-pgs/WuPJmxSO9_I/AAAAAAAAEeU/EkaOLxew4AgJlWmmJEU7czvXCBIj8gxTQCLcBGAs/s1600/6and7bon5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="181" data-original-width="368" height="157" src="https://4.bp.blogspot.com/-awSxKOR-pgs/WuPJmxSO9_I/AAAAAAAAEeU/EkaOLxew4AgJlWmmJEU7czvXCBIj8gxTQCLcBGAs/s320/6and7bon5.png" width="320" /></a></div><br /></div><div>Solutions for finding similar solutions for bishops on boards of other sizes follow the same patterns as those on the 5x5 board.<br /><br />Hopefully, these examples will help you out if you get stuck on any of the puzzles. As mentioned earlier, if you are interested in learning more about the mathematics behind these puzzles, check out <a href="https://press.princeton.edu/titles/7714.html">Across the Board</a>.<br /><br /><br /><b>Related posts and pages</b><br /><i><a href="https://dmackinnon1.github.io/chessdom/puzzles.html">domination and independence puzzles</a> </i><br /><a href="http://www.mathrecreation.com/2018/04/mathematical-chessboard-puzzles.html"><i>post introducing chessboard puzzles</i></a><br /><a href="https://dmackinnon1.github.io/kixote/"><i>chess tour puzzles</i></a><br /><a href="http://www.mathrecreation.com/2017/01/build-your-own-knights-tour.html"><i>post on chess tour puzzles</i></a></div><div><br /></div><div><br /></div><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/lM5fHeAVfpE" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/04/some-chessboard-puzzle-solutions.htmltag:blogger.com,1999:blog-5008879105295771159.post-76755111987465260592018-04-24T13:58:00.001-07:002018-05-01T14:30:28.549-07:00Mathematical Chessboard Puzzles<a href="https://en.wikipedia.org/wiki/Chess_problem">Chess problems</a> are compositions where a set of pieces are arranged as if in a game and a specific goal is set - the problem is to determine how to get from the arrangement to the end goal. An interesting variation on the traditional chess problem are the <a href="https://en.wikipedia.org/wiki/Retrograde_analysis">retrograde analysis</a> chess problems of <a href="https://en.wikipedia.org/wiki/Raymond_Smullyan">Raymond Smullyan</a>, where instead of a goal being set, a question is asked about the conditions that may have lead to the arrangement (a backwards looking problem, rather than the traditional forwards looking type). <a href="https://en.wikipedia.org/wiki/Mathematical_chess_problem">Mathematical chessboard problems</a> are completely different than these traditional chess problems, and bear little connection to the actual game of chess - they are more concerned with the structure of how particular pieces can move on the board, and ask questions about how a single piece can move about the board, or about what positions are reachable by collections of the same type of piece. These problems are questions in <a href="https://en.wikipedia.org/wiki/Graph_theory">graph theory</a> in (thin) disguise, and have attracted the attention of both professional and recreational mathematicians.<br /><br />A useful and very readable guide to mathematical chessboard problems is <a href="https://press.princeton.edu/titles/7714.html">Across the Board</a>, by John J. Watkins. I’ve been playing around with <a href="http://www.mathrecreation.com/2016/12/life-lessons-from-knights-tour.html">knight</a> <a href="http://www.mathrecreation.com/2011/09/punctured-knights-tours.html">tours</a> for a <a href="http://www.mathrecreation.com/2017/01/build-your-own-knights-tour.html">few</a> <a href="http://www.mathrecreation.com/2011/03/knight-moves.html">years</a>, and since picking up this book a while back, I have been returning to it again and again to learn new and interesting things about them. Although I had heard about other mathematical chessboard problems, like the eight queens problem, <i>Across the Board </i>introduced me to the general category of chess independence and domination problems and encouraged me to learn more about them.<br /><br />A group of chess pieces of the same type is said to <b>dominate</b> a board if every square is either occupied or a neighbour (reachable in one move) of an occupied square. A group of chess pieces of the same type is said to be <b>independent</b> if no piece is a neighbour of any other piece. Domination (sometimes called covering) problems are, generally, to find a minimal dominating set, for example, the smallest number of queens required to dominate a board. Independence (or un-guarding) problems generally require you to find a maximal set of pieces that can be placed and remain independent; the greatest number of knights, for example, that can be placed so that no knight attacks another.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-u5GzYQhOqk4/Wt-PphqzGlI/AAAAAAAAEa8/UX-Sd3ur-tgHyRoMghTY_rP5M8JIATvhACLcBGAs/s1600/uninteresting.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="187" data-original-width="357" src="https://4.bp.blogspot.com/-u5GzYQhOqk4/Wt-PphqzGlI/AAAAAAAAEa8/UX-Sd3ur-tgHyRoMghTY_rP5M8JIATvhACLcBGAs/s1600/uninteresting.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Uninteresting examples of dominating queens and independent knights.</i></div><div class="separator" style="clear: both; text-align: center;"><i></i></div><div class="separator" style="clear: both; text-align: center;"><i>A minimal dominating set and a maximal independent set would be more interesting</i></div><br />As part of working through <i>Across the Board</i> and understanding chess domination and independence, I tried to create an interactive ‘mathematical chessboard puzzle’ set (<a href="https://dmackinnon1.github.io/chessdom/puzzles.html">try it out here</a>). Here is a screenshot example: <br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-OKAuo0tgsnk/Wt-QZq3dSJI/AAAAAAAAEbE/lY4-XJIzLsEgqpGJdCUKyM7mD1W5IDkIACLcBGAs/s1600/puzzle_example.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="656" data-original-width="365" src="https://4.bp.blogspot.com/-OKAuo0tgsnk/Wt-QZq3dSJI/AAAAAAAAEbE/lY4-XJIzLsEgqpGJdCUKyM7mD1W5IDkIACLcBGAs/s1600/puzzle_example.png" /></a></div><div><div class="separator" style="clear: both; text-align: center;"><i>An example puzzle from the <a href="https://dmackinnon1.github.io/chessdom/puzzles.html">online set</a>.<br /> The solver is not off to a good start.</i></div><br />What is the difference between a mathematical chessboard <i>problem</i> and a mathematical chessboard <i>puzzle</i>? When considering the <i>problem</i> of queens independence, we would expect a serious treatment: a solution which finds the maximum number of independent queens for boards up to a certain size, an algorithm or method for generating maximal independent arrangements, and for some cases that remain unsolved by methods provided, some way of placing bounds on the independence number. A <i>puzzle</i> based on the idea of queens independence is a much simpler thing: merely an instruction like “Find a way to place 8 queens on an 8x8 board so that the board is dominated and the queens are independent.” <i>Across the Board</i> provides a great survey of results that mathematicians have used in tackling the problems of finding dominating sets, independent sets, and tours. The rest of this post is about puzzles (like the example above) that are generated from those results.<br /><br />In puzzles inspired by the problems of domination and independence, we want to ask the solver to come up with arrangements of pieces of a single type, constrained so that the pieces either dominate the board, are independent, or both. Recall that the domination problem is looking for a minimum number of pieces required to cover the board (either by placement or by attack), while the independence problem is looking for a maximum number of pieces that can be placed independently. For example, for queens on a 5x5 board, the domination number is 3, but the independence number is 5. So for queens on a 5x5 board, our puzzles will require placements of sets ranging from 3 to 5 queens.<br /><br />There is an asymmetry between domination and independence that we have to keep in mind: A solution to the domination problem might not be independent, but the maximal independent set will always be dominating. The example of 3 queens on the 5x5 board shows that you cannot always make your dominating set independent. On the other hand, a maximal independent set will always dominate: if the set does not dominate the board, that means there is a square that cannot be attacked by any of the current pieces - you can therefore add one more piece to the board at that spot, contradicting the fact that you already had a maximal independent set.<br /><br />For our puzzles, we’ll just consider boards from 4x4 to 8x8 (so that they fit reasonably on the screen). In the table below, the lowest number in each cell represents the domination number for that piece on the given board size, and the largest represents the independence number. The letters next to each number indicate whether the set of that size should be said to be independent (i) and/ or dominant (d) - some of this information is redundant, but all indicators are included for completeness. The numbers between the least and greatest represents other possible arrangements. For example, for queens on a 4x4 board, the domination number is 2 (dominant set is not independent in this case), and the independence number is 4, but it is possible to find a dominating independent set of size 3, giving us the entries 2d, 3di, and 4di. <br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-VQekwmjcPPU/Wt-S_b255rI/AAAAAAAAEbQ/cLB8KdBdQE4IzNwYzq0xl_Ix9PpuE2coQCLcBGAs/s1600/table_of_puzzles.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="531" data-original-width="375" src="https://4.bp.blogspot.com/-VQekwmjcPPU/Wt-S_b255rI/AAAAAAAAEbQ/cLB8KdBdQE4IzNwYzq0xl_Ix9PpuE2coQCLcBGAs/s1600/table_of_puzzles.png" /></a></div><br />The independence and domination numbers in the table above are from the results described in <i>Across</i> <i>the Board; </i>the values between were found looking at the solutions for either domination or independence and perturbing them slightly. For example, to fill in the values for queens on an 8x8 board, start with one of the solutions to the queens domination problem for 8x8, which consists of an arrangement of 5 pieces, and move one of the pieces to a reachable square with fewer neighbours, and fill in the gaps with additional pieces. Proceeding by trial and error, this leads to dominating independent sets of 6 and 7 pieces. Finding additional dominating and independent sets for knights is a little more challenging than others - there are some gaps in the table (maybe you can fill them). Most of these possible puzzles were written out in a format for displaying online, which you can view <a href="https://dmackinnon1.github.io/chessdom/data/puzzles.json">here</a>.<br /><br />If you interested in exploring the mathematical chessboard problems through the playful medium of chessboard puzzles, please give <a href="https://dmackinnon1.github.io/chessdom/puzzles.html">these a try</a>; if you are interested in learning more about the mathematics behind these puzzles, check out <a href="https://press.princeton.edu/titles/7714.html">Across the Board</a>.</div><i><br /></i><i>domination and independence puzzles: <a href="https://dmackinnon1.github.io/chessdom/puzzles.html">https://dmackinnon1.github.io/chessdom/puzzles.html</a></i><br /><i>chess tour puzzles: <a href="https://dmackinnon1.github.io/kixote/">https://dmackinnon1.github.io/kixote/</a></i><br /><br /><a href="http://www.mathrecreation.com/2018/04/some-chessboard-puzzle-solutions.html"><i>some puzzle solutions</i></a><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/xk45YJKks90" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/04/mathematical-chessboard-puzzles.htmltag:blogger.com,1999:blog-5008879105295771159.post-88468440591737582242018-03-07T09:15:00.000-08:002018-03-07T09:15:02.396-08:00Symmetry and Asymmetry in Tigers and TreasureTiger and treasure logic puzzles, like ones you can try out <a href="https://dmackinnon1.github.io/inspectorCraig/tiger.html">here</a>, offer you a choice between two doors that might lead to treasure, or a tiger. Statements on "door 1" are true only if they lead to treasure, and statements on "door 2" are true only if they lead to a tiger.<br /><br />The <a href="http://www.mathrecreation.com/2018/03/tigers-and-treasure.html">previous post</a> gave an overview of the different "tiger and treasure" logic puzzles that could be formed from a starting list of 14 statements:<br /><ol><li>this room has treasure</li><li>the other room has treasure</li><li>at least one room has treasure</li><li>both rooms have treasure</li><li>this room has a tiger</li><li>the other room has a tiger</li><li>at least one room has a tiger</li><li>both rooms have a tiger</li><li>this room has treasure or the other room has a tiger</li><li>the other room has treasure or this room has a tiger</li><li>this room has treasure and the other room has a tiger</li><li>the other room has treasure and this room has a tiger</li><li>both rooms have treasure or both rooms have a tiger</li><li>one room has treasure and the other has a tiger</li></ol>All possible puzzles are listed <a href="https://github.com/dmackinnon1/inspectorCraig/blob/master/report/tiger_report.csv">here</a> (statement numbers in the file start at 0, rather than 1).<br /><br />When exploring all the different possible puzzles we can make from these, we won't include puzzles that lead to a contradiction, or puzzles where the clues don't allow you to identify either door. This leaves 96 good puzzles out of the 196 combinations of statements, shown in black below:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Hckl0NN-IgU/Wp6ykQawDWI/AAAAAAAAEWw/-jo9VznwkHgoZ0BaaUjC2MC0Y43Y5Qp-wCLcBGAs/s1600/all_puzzles_nonSym.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="700" data-original-width="835" height="335" src="https://1.bp.blogspot.com/-Hckl0NN-IgU/Wp6ykQawDWI/AAAAAAAAEWw/-jo9VznwkHgoZ0BaaUjC2MC0Y43Y5Qp-wCLcBGAs/s400/all_puzzles_nonSym.png" width="400" /></a></div><h4><br /></h4><h4>Symmetry among Puzzles</h4>For each statement in the list of fourteen, you can find the negation of that statement in the list - for example, statement 1 "this room has treasure" has its negation in statement 5 "this room has a tiger." If we plot the list of statements on door 1 vs. the the list of statements on door 2, but re-arrange the statements on the door 2 axis so they are the negations of our original list (the negated list would be statements 5, 6, 8, 7, 1 ,2, 4, 3, 12, 11, 10, 9, 14, 13), we can see the symmetry in these puzzles more clearly:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-h2ye1fP6Qm4/Wp6z4CTsszI/AAAAAAAAEW8/B7JBHfgStvsH4b4jz4v-M3rcjVzlbGARACLcBGAs/s1600/symmetric_all_puzzles.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="695" data-original-width="835" height="331" src="https://4.bp.blogspot.com/-h2ye1fP6Qm4/Wp6z4CTsszI/AAAAAAAAEW8/B7JBHfgStvsH4b4jz4v-M3rcjVzlbGARACLcBGAs/s400/symmetric_all_puzzles.png" width="400" /></a></div><br />This graph is telling us that if we have a puzzle that works, then if we swap the signs on the doors and negate them, we will also get a working puzzle. If you explore this a bit further, you'll see that the symmetry goes deeper. Let's get a little mathy with this.<br /><br />If <i>a</i> and <i>b</i> are statements in our list, a puzzle <i>P</i> can be described by the ordered pair (<i>a</i>,<i>b</i>). Every puzzle <i>P</i> also has a solution, (<i>s</i>, <i>t</i>) where <i>s</i> and <i>t</i> are either "tiger", "treasure", or "unknown."<br /><br />For any statement in the list <i>x</i>, we can write the negation of <i>x</i> as <i>-x</i>. If we form a new puzzle by putting the negation of <i>a</i> on door 2 and the negation of <i>b</i> on door 1, we get a new puzzle <i>-P</i> = (<i>-b</i>,-<i>a</i>).<br /><br />The symmetry of our tiger treasure puzzles can be expressed as this little theorem:<br /><blockquote class="tr_bq">If <i>P</i> = (<i>a</i>,<i>b</i>) is a tiger treasure puzzle with solution (<i>s</i>,<i>t</i>), then its negation, <i>-P</i> = (<i>-b</i>, -<i>a</i>), will have the solution (<i>t</i>, <i>s</i>).</blockquote>Here is an example. Consider the example puzzle from the previous post.<br /><br /><b>Puzzle P</b><br />Door 1 says: Both rooms have a tiger. (statement 8)<br />Door 2 says: The other room has treasure and this room has a tiger. (statement 12)<br /><br />In the previous post, we worked out that door 1 has a tiger and door 2 has treasure.<br /><div><br /></div><div>Statement 8's negation is statement 3, and statement 12's negation is statement 9. So the puzzle -P looks like this:</div><div><br /></div><div><div><b>Puzzle -P</b></div><div>Door 1 says: This room has treasure or the other room has a tiger (statement 9) </div><div>Door 2 says: At least one room has treasure (statement 3)</div></div><div><br /></div><div>If you have tried out a few of these, you may be able to find the solution to -P, which is that door 1 has a tiger and door 2 has treasure, which is the reverse of Puzzle P, where door 1 had treasure and door 2 had the tiger - the contents behind the doors have switched.</div><div><br /></div><div>The symmetric graph above helped point us towards a nice symmetry that holds true for all of the tiger and treasure puzzles, but our original non-symmetric graph can point to another interesting things too.</div><h4><br /></h4><h4>Using asymmetry to make puzzles more interesting</h4><div>In Raymond Smullyan's book "The Lady or the Tiger?" he presented a nice twist on the usual presentation of this kind of puzzle:</div><div><blockquote class="tr_bq">"There are no signs above the doors!" exclaimed the prisoner. "Quite true," said the king. "The signs were just made, and I haven't had time to put them up yet." "Then how do you expect me to choose?" demanded the prisoner. "Well, here are the signs," replied the king. That's all well and good," said the prisoner anxiously, "but which sign goes on which door?" The king thought awhile. "I needn't tell you," he said. "You can solve this problem without that information."</blockquote></div><div>Let's look around for puzzles like this. One question to ask: Which of our problems would allow us to interchange the signs on the doors without affecting the solution to the problem? We'd like to know when does <i>P</i> = (<i>a</i>,<i>b</i>) give the same solution as <i>Q</i> = (<i>b</i>,<i>a</i>)? To explore which puzzles might work in this way, we can start looking at our first graph above, but limit our attention to those puzzles who's reflection in the line door1= door2 is also a puzzle. These are shown in black below (grey shows other puzzles whose reflection is not also a puzzle).</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-OrMJ28xV60U/Wp6-t8os_pI/AAAAAAAAEXM/JyT9cg2B4dk2yVmbHWzjQwTldAL5nLfawCLcBGAs/s1600/reflections.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="687" data-original-width="842" height="326" src="https://1.bp.blogspot.com/-OrMJ28xV60U/Wp6-t8os_pI/AAAAAAAAEXM/JyT9cg2B4dk2yVmbHWzjQwTldAL5nLfawCLcBGAs/s400/reflections.png" width="400" /></a></div><div><br /></div><div>But we don't just want puzzles whose reflection gives us a puzzle, but ones whose reflections have the same solution as the original. It turns out that this gives an uninspiring set of six puzzles:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-BgzMoOIzwq8/Wp7YjpTL7UI/AAAAAAAAEXc/oWUqQ-GaAZUZao_ajG1PyqNwKAZ_dDQSwCLcBGAs/s1600/reflection_has_same_solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="711" data-original-width="765" height="371" src="https://1.bp.blogspot.com/-BgzMoOIzwq8/Wp7YjpTL7UI/AAAAAAAAEXc/oWUqQ-GaAZUZao_ajG1PyqNwKAZ_dDQSwCLcBGAs/s400/reflection_has_same_solution.png" width="400" /></a></div><div><br /></div><div>Only the trivial cases work: puzzles where the statements on the doors are exactly the same end up giving us puzzles that have exactly the same solution when the statements are interchanged. So what about the problem from "The Lady or the Tiger?", it uses these statements:</div><div><div><ul><li>this room contains a tiger (statement 5)</li><li>both rooms contain tigers (statement 8)</li></ul></div></div><div>Why does the solver not need to know which door each goes on? Well, if statement 5 goes on door 1 we get a contradiction, so it must go on door 2. This is why the solver does not need to be told how to label the doors: there is only one possible way to do so without getting a contradiction. So, a way to find more problems like this is to look for puzzles <i>P</i> = (<i>a</i>,<i>b</i>) where <i>P</i> is a legitimate puzzle, but <i>Q</i> = (<i>b</i>, <i>a</i>) is not a puzzle, as that labelling of the doors leads to a contradiction.</div><div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-6wdODlvbLLw/Wp7apBa1_1I/AAAAAAAAEXs/8W7UK24x4Dc_s7DRHw5gM13y_it6HrwqwCLcBGAs/s1600/puzzles_reflect_no_puzzle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="684" data-original-width="759" height="358" src="https://1.bp.blogspot.com/-6wdODlvbLLw/Wp7apBa1_1I/AAAAAAAAEXs/8W7UK24x4Dc_s7DRHw5gM13y_it6HrwqwCLcBGAs/s400/puzzles_reflect_no_puzzle.png" width="400" /></a></div><div><br /></div>There are 32 puzzles in this category (shown in black above): puzzles when you exchange the statements on the doors, you obtain a contradiction. Adding to this the 6 trivial cases where both doors have the same statement, we have 38 puzzles where we simply present the statements without explaining which statement is on each door.<br /><br />For example, the puzzle (13, 10) falls into this set.<br /><br />Let's try putting 13 on door 1 and 10 on door 2:<br /><br />door 1: both rooms have treasure or both rooms have a tiger (13)<br /><br />door 2: the other room has treasure or this room has a tiger (10)<br /><br />Because inscriptions on door 1 are only true of door 1 leads to treasure, statement 13 implies that door 2 must lead to treasure. Door 2 leading to treasure makes its statement (10) false, requiring door 1 to lead to a tiger.<br /><br />However, if we switch the statements, we run into trouble:<br /><br />door 1: the other room has treasure or this room has a tiger (10)<br /><div><br /></div>door 2: both rooms have treasure or both rooms have a tiger (13)<br /><br />If statement 10 on door 1 is false, then door 1 would lead to a tiger. However, the statement says that it leads to a tiger, so this cannot be. Door 1 must lead to treasure, making statement 10 true, requiring door 2 to also lead to a treasure. If door 2 leads to treasure, then its statement (13) must be false. However, statement 13 is true (both rooms have treasure), a contradiction.<br /><br />So, presented with statements 10 and 13, there is only one way to arrange them on the doors: put statement 13 on door 1 and statement 10 on door 2, leading to a tiger behind door 1 and treasure behind door 2.<br /><br />Please try out the tiger-treasure puzzles <a href="https://dmackinnon1.github.io/inspectorCraig/tiger.html">here</a> and ask yourself: "What would the negation of this puzzle (-P) be?" and "Is this one of the 38 puzzles that can be answered without being told which sign is on which door?"<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/Ny9IQ6dd3u0" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/03/symmetry-and-asymmetry-in-tigers-and.htmltag:blogger.com,1999:blog-5008879105295771159.post-3272994985458835222018-03-02T20:16:00.001-08:002018-03-09T08:16:00.432-08:00Tigers and TreasureHere is yet another type of logic puzzle for you:<br /><blockquote class="tr_bq">Imagine there are two doors, both doors either lead to a tiger or treasure. You would like to know what each door leads to. On each door there is an inscription that provides a clue. If door 1 leads to treasure, its inscription is true, otherwise it is false. If door 2 leads to a tiger, its inscription is true, otherwise it is false. </blockquote><blockquote class="tr_bq">Door 1 says: Both rooms have a tiger.<br />Door 2 says: The other room has treasure and this room has a tiger. </blockquote><blockquote class="tr_bq">Can you figure out what each door leads to?</blockquote><br />Here is one way to think about it:<br /><br />Door 1 cannot lead to treasure, since if it does its inscription must be true. The inscription on door 1 contradicts the assumption that it leads to treasure. Consequently, door 1 must lead to a tiger. However, if door 1 leads to a tiger, its inscription must be false - which means the statement "both rooms have a tiger" cannot be true, so door 2 must lead to treasure. If door 2 leads to treasure, then its statement is false, which lines up with door 1 having a tiger and door 2 having a treasure. If we instead start with the inscription on door 2, if door 2 had a tiger, it would mean that door 1 has a treasure, but door 1 leading to treasure leads to a contradiction. It is safe to conclude that door 1 leads to a tiger, and door 2 leads to treasure.<br /><br />You can find 96 of these puzzles <a href="https://dmackinnon1.github.io/inspectorCraig/tiger.html">here</a>.<br /><br />These puzzles, <a href="https://dmackinnon1.github.io/knaves/">like</a> <a href="https://dmackinnon1.github.io/portia/">previous</a> <a href="https://dmackinnon1.github.io/inspectorCraig/">ones</a> are based on puzzles by Raymond Smullyan. In this post, I wanted to look at a reasonable list of statements that could appear on the doors, and how the statements interact with the peculiarities of the doors.<br /><br />To generate these puzzles, I started with a set of 14 statements that could be placed on either door:<br /><br /><ol><li>this room has treasure</li><li>the other room has treasure</li><li>at least one room has treasure</li><li>both rooms have treasure</li><li>this room has a tiger</li><li>the other room has a tiger</li><li>at least one room has a tiger</li><li>both rooms have a tiger</li><li>this room has treasure or the other room has a tiger</li><li>the other room has treasure or this room has a tiger</li><li>this room has treasure and the other room has a tiger</li><li>the other room has treasure and this room has a tiger</li><li>both rooms have treasure or both rooms have a tiger</li><li>one room has treasure and the other has a tiger</li></ol><br />If we stick with puzzles generated using these 14 statements, there are 196 possible labelling of door 1 and door 2. However, some statements will not work on a particular door. For example, door 2 cannot be labelled with statement 1, since if door 2's statements are only true if door 2 leads to a tiger, the statement "this room has treasure" will lead to a contradiction in every case. If door 2 has a tiger, then its statements are true, but "this room has treasure" would be false. If door 2 has treasure, then its statements are false, but "this room has treasure" would be true.<br /><br />The graph below shows all 196 possible puzzles. The puzzles that lead to contradictions are coloured as white squares, the puzzles that do not lead to contradictions are coloured in black. We can see a white strip across the bottom: these are all the puzzles where door 2 is labelled with statement 1. Can you find the statement that always leads to contradictions for door 1? There are 131 puzzles that are "good" in the sense that they do not lead to contradictions.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-rFDoyZJUltM/WpmFCsnHVdI/AAAAAAAAEVQ/L5DWkLBorOYUx6uUa1pE0nX25hY7YkE7QCLcBGAs/s1600/puzzles_with_solutions.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="692" data-original-width="781" height="353" src="https://2.bp.blogspot.com/-rFDoyZJUltM/WpmFCsnHVdI/AAAAAAAAEVQ/L5DWkLBorOYUx6uUa1pE0nX25hY7YkE7QCLcBGAs/s400/puzzles_with_solutions.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>treasure/tiger puzzles with solutions, <br />or an upside-down DigDug level</i></div><br />But some of these 131 puzzles are not so satisfying - the clues provided on the doors don't help in figuring out what lies beyond. In some cases, like the example puzzle above, the clues will tell you what lies beyond both doors. In others, you may only learn the contents of one door. For certain puzzles, you can conclude nothing. There are 35 puzzles, shown in black below, that are contradiction-free, but whose clues provide inconclusive information about the rooms.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-DtU4oruqbYk/WpmIW7vLXXI/AAAAAAAAEVg/Ks4QjZE9qE4gB0C1OUGRxdfqQEld7iGRgCLcBGAs/s1600/puzzles_leading_nowhere.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="692" data-original-width="779" height="353" src="https://3.bp.blogspot.com/-DtU4oruqbYk/WpmIW7vLXXI/AAAAAAAAEVg/Ks4QjZE9qE4gB0C1OUGRxdfqQEld7iGRgCLcBGAs/s400/puzzles_leading_nowhere.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>treasure/tiger puzzles where the inscriptions<br />tell you nothing</i></div><br />In the graph above, notice that many puzzles along the vertical stripe at statement 1 are in this category of puzzles that tell us nothing. When put on door 1, the statement "this room has treasure" is not helpful (except in some interactions with door 2 statements); taken on its own, if door 1 has treasure, the statement is simply true, and if door 1 does not have treasure, it is simply false - it does not tell us anything about door 2's possible contents, or generate a contradiction that would allow us to reject one of the options. Similarly, the horizontal stripe at statement 5 symmetrically corresponds to door 2 having the statement "this room has a tiger."<br /><br />So, to get a set of nice puzzles, we take the 131 that are contradiction-free, and remove these 35 unsatisfying puzzles to obtain 96 where you can find the contents of at least one of the rooms based on the inscriptions on the doors.<br /><br />Some of the puzzles are particularly nice: both rooms lead to treasure! There are 20 of these, shown in black below:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-8i6HZY14Xi0/WpmQRBUamaI/AAAAAAAAEVw/bJFXEu8NkRkg9QRs97W8eXB2UIsI-Z-LwCLcBGAs/s1600/puzzles_two_treasures.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="689" data-original-width="786" height="350" src="https://4.bp.blogspot.com/-8i6HZY14Xi0/WpmQRBUamaI/AAAAAAAAEVw/bJFXEu8NkRkg9QRs97W8eXB2UIsI-Z-LwCLcBGAs/s400/puzzles_two_treasures.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>treasure/tiger puzzles with two treasures</i></div><br />A quick look at this graph shows that when statement 11 is on door 2, or when statement 10 is on door 1, your odds of getting treasure are pretty good.<br /><br />Looking at statement 11:<br /><blockquote class="tr_bq"><i>this room has treasure and the other room has a tiger</i></blockquote>If seen on door 2, we know it cannot be true: statements on door 2 are only true if door 2 leads to a tiger. So this means two things: First door 2 must have treasure, and second, the statement is false. The only way for the statement to be false is if door 1 also leads to treasure.<br /><br />Looking at statement 10:<br /><blockquote class="tr_bq"><i>the other room has treasure or this room has a tiger</i></blockquote>If seen on door 1, this statement cannot be false: statements on door 1 are only false if door 1 leads to a tiger. If door 1 leads to a tiger, this would make the statement true - a contradiction. So this means two things: door 1 must lead to treasure, and the statement must be true. The only way for the overall statement to be true is if door 2 also leads to treasure.<br /><br />Statements 11 and 13 are, just like statements 1 and 3, negations of each other. <a href="https://en.wikipedia.org/wiki/De_Morgan%27s_laws">DeMorgan's laws</a>, tell us that an "and" statement like "this room has treasure and the other room a has a tiger" when negated becomes an "or" statement, like "the other room has a treasure or this room has a tiger."<br /><br />Just as there are puzzles that lead to 2 treasures, there are those that lead to two tigers. Not surprisingly, there are 20 of these also, and their graph looks like this:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-KfVSLY9gP6Q/WpoU7d-L6VI/AAAAAAAAEWA/rIBkrCBp3TMw29vwx-P5cWJ7lIqucGa9wCLcBGAs/s1600/two_tigers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="693" data-original-width="778" height="356" src="https://1.bp.blogspot.com/-KfVSLY9gP6Q/WpoU7d-L6VI/AAAAAAAAEWA/rIBkrCBp3TMw29vwx-P5cWJ7lIqucGa9wCLcBGAs/s400/two_tigers.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>treasure/tiger puzzles with two tigers</i></div><div><br /></div>Can you see why statement 9 when put on door 2 leads to two tigers, and why the same is true for statement 12 when put on door 1?<br /><br />Although some puzzles end up being solvable with two tigers or two treasures, the classic form of the puzzle would have a solution where we would find a tiger behind one door, and treasure behind the other. It turns out there are 40 of these in our set, distributed like so:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-KA9wcay63o0/WpoeZRQMQXI/AAAAAAAAEWQ/Pxo431XMvEIkpIL-pXSBOgHV-547gNBYwCLcBGAs/s1600/one_of_each.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="698" data-original-width="754" height="370" src="https://3.bp.blogspot.com/-KA9wcay63o0/WpoeZRQMQXI/AAAAAAAAEWQ/Pxo431XMvEIkpIL-pXSBOgHV-547gNBYwCLcBGAs/s400/one_of_each.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>treasure/tiger puzzles where the <br />solution is one of each</i></div><br />Rounding out the puzzle collection are puzzles with one door that is unknowable. There are 16 of these, with 8 puzzles having a solution that is a tiger plus an unknown and 8 that is a treasure plus an unknown.<br /><br />So, out of the 196 combinations of our 14 statements on two doors, we have 131 that are contradiction free. Of these, we removed the 35 where the clues do not allow you to draw any conclusions about the rooms. This leaves:<br />- 16 puzzles that have a partial solution (8 where one door leads a tiger, and another 8 where one door leads to treasure);<br />- 40 puzzles that have one door leading to a tiger and one to treasure;<br />- 20 puzzles that have both doors leading to tigers; and<br />- 20 puzzles that have both doors leading to treasure.<br /><br />See how many you can solve: <a href="https://dmackinnon1.github.io/inspectorCraig/tiger.html">https://dmackinnon1.github.io/inspectorCraig/tiger.html</a><br /><br /><i><b>Update</b>: <a href="http://www.mathrecreation.com/2018/03/symmetry-and-asymmetry-in-tigers-and.html">Another post about tigers and treasure puzzles</a></i><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/N-0ZRdd9xiQ" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/03/tigers-and-treasure.htmltag:blogger.com,1999:blog-5008879105295771159.post-23804545601628250712018-02-04T12:08:00.000-08:002018-02-04T12:08:25.358-08:00Inspector Craig, Logical DetectiveInspired by the puzzles of Raymond Smullyan, I've been playing with various puzzle types that he either invented or popularised. Earlier I posted some <a href="https://dmackinnon1.github.io/knaves/">knight and knave puzzles</a>, and a a page of puzzles inspired by his "<a href="https://dmackinnon1.github.io/portia/">Portia's Caskets</a>" puzzles, and now another has joined the pile: <a href="https://dmackinnon1.github.io/inspectorCraig/">The Case Files of Inspector Craig</a>.<br /><br />Here's an example of the kind of puzzles you will find on the page:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-K6WDKrSMSbI/WndiTbzMu4I/AAAAAAAAESs/V20aJlHtpPkl84pW8M3NoH5Ha4vuuYqyACLcBGAs/s1600/craig1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="277" data-original-width="451" height="245" src="https://4.bp.blogspot.com/-K6WDKrSMSbI/WndiTbzMu4I/AAAAAAAAESs/V20aJlHtpPkl84pW8M3NoH5Ha4vuuYqyACLcBGAs/s400/craig1.png" width="400" /></a></div><br />Your goal is to classify each suspect as either innocent, guilty, or unknown (in the case where the evidence cannot support either guilt or innocence).<br /><br />Depending on how familiar you are with <a href="https://en.wikipedia.org/wiki/List_of_logic_symbols">logical symbols</a>, it may help to simplify the language used to describe the clues - if we use the letter <b>X</b> to mean "X is guilty," we can express the statements above a bit more formally:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Z-GSPrJLf1Q/WndjNu972AI/AAAAAAAAES0/NpX52BWlcGIzS3MuU8GBqhiSyUAdCB_5QCLcBGAs/s1600/craig2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="170" data-original-width="165" src="https://4.bp.blogspot.com/-Z-GSPrJLf1Q/WndjNu972AI/AAAAAAAAES0/NpX52BWlcGIzS3MuU8GBqhiSyUAdCB_5QCLcBGAs/s1600/craig2.png" /></a></div>There are two key techniques for solving these puzzles: 1) start with one of the statements, say <b>A</b>, and see if applying the propositions will lead to a contradiction; and 2) start with the statement "<b>A</b> or <b>B</b> or <b>C</b>" and work out the implications of each case - if there is a result that all three lead to, then that must be true.<br /><br />We can use the first method starting with <b>B</b>. If we assume <b>B</b> is guilty then since <b>B</b> always uses <b>A</b> as an accomplice (<b>B</b> <i>implies</i> <b>A</b>), <b>A</b> must be guilty. However we also have a statement that says that <b>A</b> never works with <b>B </b>(<b>A</b> <i>implies not</i> <b>B</b>), which means that <b>B</b> is innocent. Since assuming <b>B</b> is guilty ended up showing that <b>B</b> is innocent (<b>B</b> <i>implies not</i> <b>B</b>), then <b>B</b> must not have been guilty.<br /><br />Using the second method, we know that either <b>A</b> or <b>B</b> or <b>C</b> is guilty. We already know that <b>B</b> is innocent, so that leaves us with <b>A</b> and <b>C</b>. If <b>A</b> is guilty, we can't determine much else. However if <b>C</b> is guilty, then since <b>C</b> always uses <b>A</b> as an accomplice (<b>C</b> <i>implies</i> <b>A</b>), then <b>A</b> is also guilty. So, no matter which of the two alternatives we choose, <b>A</b> is guilty.<br /><br />Unfortunately, there is no way to know whether or not <b>C</b> is guilty based on this reasoning, so we are left to make this selection:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-v1fg7KOiQiM/WndlCcZvZjI/AAAAAAAAETA/xjZwxalLjyYao06VqU1V9Q4dMuWDqVVTACLcBGAs/s1600/craig3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="231" data-original-width="394" height="233" src="https://2.bp.blogspot.com/-v1fg7KOiQiM/WndlCcZvZjI/AAAAAAAAETA/xjZwxalLjyYao06VqU1V9Q4dMuWDqVVTACLcBGAs/s400/craig3.png" width="400" /></a></div><br />Which turns out to be correct.<br /><br />Try a few out here: <a href="https://dmackinnon1.github.io/inspectorCraig/">https://dmackinnon1.github.io/inspectorCraig/</a><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/GqHmpL0alNs" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/02/inspector-craig-logical-detective.htmltag:blogger.com,1999:blog-5008879105295771159.post-95258694562969712018-01-13T14:29:00.002-08:002018-01-13T14:29:25.872-08:00bipartite artA bipartite graph consists of two sets of nodes, N and M, where every node in N is connected to every node in M by an edge.<br /><br />If you set up the nodes N and M on a pair of circles centred around the same point, you can get quite a variety of nice looking diagrams. As part of playing around with generating svg images using d3js, I set up <a href="https://dmackinnon1.github.io/bipartite2.html">a page</a> that allows you to create some 'bipartite art.' Some of the diagrams turned out nicely, particularly when you hide the nodes completely:<br /><div class="separator" style="clear: both; text-align: center;"></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-YiVJLS6oJx4/Wk56GnKxpnI/AAAAAAAAEPY/nZZapjNK0g4Z08HvWJSjmB1UsZ3MDDL7ACLcBGAs/s1600/k88a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="509" data-original-width="619" height="263" src="https://1.bp.blogspot.com/-YiVJLS6oJx4/Wk56GnKxpnI/AAAAAAAAEPY/nZZapjNK0g4Z08HvWJSjmB1UsZ3MDDL7ACLcBGAs/s320/k88a.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-wmy_MgwOUNo/Wk55_lJcNmI/AAAAAAAAEPQ/awTM0gl0QK4eBfgo1r5WJU9_HHgQ0W6PQCLcBGAs/s1600/k642a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="485" data-original-width="528" height="293" src="https://1.bp.blogspot.com/-wmy_MgwOUNo/Wk55_lJcNmI/AAAAAAAAEPQ/awTM0gl0QK4eBfgo1r5WJU9_HHgQ0W6PQCLcBGAs/s320/k642a.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-ZKrDZNB3kfM/Wk56EMQ6pFI/AAAAAAAAEPU/HHQM8otqqogRWB2qAJJZhmg9LEPzKqRqwCLcBGAs/s1600/k2424b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="502" data-original-width="495" height="320" src="https://4.bp.blogspot.com/-ZKrDZNB3kfM/Wk56EMQ6pFI/AAAAAAAAEPU/HHQM8otqqogRWB2qAJJZhmg9LEPzKqRqwCLcBGAs/s320/k2424b.png" width="315" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-lzzrYol9xg8/Wk56NBOSk0I/AAAAAAAAEPc/bP-SPOvEXtcOIfFjo0HdAaM3huHnoIK6QCLcBGAs/s1600/k2424a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="502" data-original-width="546" height="293" src="https://4.bp.blogspot.com/-lzzrYol9xg8/Wk56NBOSk0I/AAAAAAAAEPc/bP-SPOvEXtcOIfFjo0HdAaM3huHnoIK6QCLcBGAs/s320/k2424a.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-L7zD5-2QwGA/Wk555yZv_0I/AAAAAAAAEPI/cD-UMKPpO1wWJi0lLBaO59QBvkL1YuWtwCLcBGAs/s1600/blackhole.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="555" data-original-width="556" height="319" src="https://1.bp.blogspot.com/-L7zD5-2QwGA/Wk555yZv_0I/AAAAAAAAEPI/cD-UMKPpO1wWJi0lLBaO59QBvkL1YuWtwCLcBGAs/s320/blackhole.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-Cd2KgIo8pII/Wk559i2ZX0I/AAAAAAAAEPM/N_lukAEAUKklh96eHSCnm_Z6OQWKz48awCLcBGAs/s1600/k4812.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="508" data-original-width="509" height="319" src="https://3.bp.blogspot.com/-Cd2KgIo8pII/Wk559i2ZX0I/AAAAAAAAEPM/N_lukAEAUKklh96eHSCnm_Z6OQWKz48awCLcBGAs/s320/k4812.png" width="320" /></a></div><br />Try it out at: <a href="https://dmackinnon1.github.io/bipartite2.html">https://dmackinnon1.github.io/bipartite2.html</a><br /><div><br /></div><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/kj6128OZDcU" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2018/01/bipartite-art.htmltag:blogger.com,1999:blog-5008879105295771159.post-23905300061342523172017-12-19T11:19:00.000-08:002017-12-29T06:00:25.254-08:00Hello Phyllotaxis<a href="https://en.wikipedia.org/wiki/Phyllotaxis">Phyllotaxis</a> spirals are a favorite of recreational math - often explored in connection to other perennial topics such as the golden mean and Fibonacci numbers.<br /><br />When I am trying out a new data visualization platform or programming language, I like to try to draw phyllotaxis spirals as a sort of "<a href="https://en.wikipedia.org/wiki/%22Hello,_World!%22_program">Hello World</a>." My latest "Hello Phyllotaxis" came about during the early stages of learning how to use <a href="http://d3js.org/">D3js</a>. You can try it out <a href="https://dmackinnon1.github.io/phylo2.html">here</a>. <br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-NG0HAqfjiQY/WjlIugGDFLI/AAAAAAAAENQ/8VJLyMBOoS4d5YKJKtm6dSXZeiyukomdQCLcBGAs/s1600/phyllo1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="607" data-original-width="624" height="311" src="https://4.bp.blogspot.com/-NG0HAqfjiQY/WjlIugGDFLI/AAAAAAAAENQ/8VJLyMBOoS4d5YKJKtm6dSXZeiyukomdQCLcBGAs/s320/phyllo1.PNG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Sketched with D3js (see <a href="https://dmackinnon1.github.io/phylo2.html" style="text-align: start;">here</a>)</i></div><br /><a href="http://www.mathrecreation.com/2016/10/some-familiar-spirals-in-desmos.html">Here</a> is a "Hello Phyllotaxis" for Desmos (blog post <a href="http://www.mathrecreation.com/2016/10/some-familiar-spirals-in-desmos.html">here</a>). Over the years I have also pointed to phyllotaxis-like sketches using Fathom <a href="http://www.mathrecreation.com/2009/05/more-phyllotaxis.html">here</a>, Processing <a href="http://www.mathrecreation.com/2011/09/spirals.html">here</a>, and R <a href="http://www.mathrecreation.com/2015/08/simple-fun-with-r.html">here</a>.<br /><br />In the image above, the dark circles are chosen by skip-counting out from the center - in this case, skip counting by 11 (see #6 in <a href="http://www.mathrecreation.com/2012/08/a-deep-dive-into-multiplication-table.html">this post</a>).<br /><br />Below is a brief visual roundup of how this little "program" displays on the various platforms I have tried it on.<br /><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-deBwZrHf8mw/SMf4iUHfUWI/AAAAAAAACg8/gDVh0TAD4-4Od-TWwyf4LFcofGrkyGhkQCPcBGAYYCw/s1600/fathom_phylo4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="927" data-original-width="948" height="312" src="https://2.bp.blogspot.com/-deBwZrHf8mw/SMf4iUHfUWI/AAAAAAAACg8/gDVh0TAD4-4Od-TWwyf4LFcofGrkyGhkQCPcBGAYYCw/s320/fathom_phylo4.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Sketched with Fathom (see<span style="text-align: start;"> </span><a href="http://www.mathrecreation.com/2009/05/more-phyllotaxis.html" style="text-align: start;">here</a>)</i></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-Txgad-BFxLM/T3Ub5K9NnMI/AAAAAAAACc8/h9OHFbMlee8X7QS0J1d3eo7yKNtzghCAQCPcBGAYYCw/s1600/mod17_2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="397" height="320" src="https://2.bp.blogspot.com/-Txgad-BFxLM/T3Ub5K9NnMI/AAAAAAAACc8/h9OHFbMlee8X7QS0J1d3eo7yKNtzghCAQCPcBGAYYCw/s320/mod17_2.JPG" width="313" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Sketched with Processing (see <a href="http://www.mathrecreation.com/2011/09/spirals.html">here</a>)</i></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-1qk_fTEl4go/VdzWP6XSyLI/AAAAAAAAC20/kfYisM9RqTUfJSev47BtriMCDP_yBosXgCPcBGAYYCw/s1600/exa2b.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="335" data-original-width="386" height="276" src="https://4.bp.blogspot.com/-1qk_fTEl4go/VdzWP6XSyLI/AAAAAAAAC20/kfYisM9RqTUfJSev47BtriMCDP_yBosXgCPcBGAYYCw/s320/exa2b.JPG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Sketched with R (see <a href="http://www.mathrecreation.com/2015/08/simple-fun-with-r.html" style="text-align: start;">here</a>)</i></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-uJCCFGeuDRc/V_2l8gHJ-bI/AAAAAAAADlY/Kg2JchW1XMw7nMcN4VB8q5M6QnxAhZvvwCPcBGAYYCw/s1600/spiral1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="372" data-original-width="387" height="307" src="https://3.bp.blogspot.com/-uJCCFGeuDRc/V_2l8gHJ-bI/AAAAAAAADlY/Kg2JchW1XMw7nMcN4VB8q5M6QnxAhZvvwCPcBGAYYCw/s320/spiral1.PNG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><i>Sketched with Desmos (see <a href="http://www.mathrecreation.com/2016/10/some-familiar-spirals-in-desmos.html" style="text-align: start;">here</a> and <a href="https://www.desmos.com/calculator/risuha09iw">here</a>)</i></div><br /><br /><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/ra-Z9if0SSg" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2017/12/hello-phyllotaxis.htmltag:blogger.com,1999:blog-5008879105295771159.post-23700342637266504832017-12-07T19:39:00.002-08:002017-12-07T19:39:55.803-08:00Constructing Portia's CasketsIn Shakespeare's <i>The Merchant of Venice</i>, Portia tested her suitors by asking them to discover which of three caskets concealed her portrait. Inscriptions on the caskets presented riddles that would challenge the virtue of her potential mates. In his classic <i>What is the Name of this Book?</i> logician Raymond Smullyan, imagined several generations of clever Portias, who presented potential suitors with caskets inscribed with logic puzzles that provided the key to finding her hidden portrait.<br /><br />On <a href="https://dmackinnon1.github.io/portia/">this page</a> I have set up interactive puzzle generators that correspond (roughly) to Smullyan’s first three generations of Portias. In this post I thought I would describe what I find interesting about the way the puzzles are solved and how they are generated. The code that generates and presents these puzzles is found <a href="https://github.com/dmackinnon1/portia">here</a>.<br /><br />Here's the first Portia's Caskets puzzle in "What is the Name of this Book?":<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-J03MNu3OIiA/WimJreGSZiI/AAAAAAAAEKA/0rs36f1BGIowE2vIezfI8PTgEtiYSYOwgCLcBGAs/s1600/portia1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="217" data-original-width="403" height="215" src="https://1.bp.blogspot.com/-J03MNu3OIiA/WimJreGSZiI/AAAAAAAAEKA/0rs36f1BGIowE2vIezfI8PTgEtiYSYOwgCLcBGAs/s400/portia1.PNG" width="400" /></a></div><br />One way to solve problems like this is to <b>work backwards</b>. For each casket, imagine that the portrait is concealed within that casket, then count how many statements would be true. When you find the portrait placement that matches the requirement that "at most one is true" you have your solution.<br /><br /><h3>Building our first 348 Portia Puzzles</h3>Working backwards also gives us a way to <b>generate</b> puzzles like this one. To generate these puzzles, consider all possible statements on the caskets. Each set of statements gives you three possible puzzles: a puzzle where the portrait is in the gold casket, a puzzle where the portrait is in the silver casket, and a puzzle where it is in the lead casket. To find out if any (or all) of these are valid solvable puzzles, check to see if the portrait placement gives you a 'truth count' that unique within that group of potential puzzles.<br /><br />But what about generating 'all possible statements'? What are the statements that can be included? The statements on the caskets can be thought of as pointers to caskets, pointers that are either positive ("the portrait is in the silver casket") or negative ("the portrait is not in the gold casket"), and that may be directed at the current casket itself ("the portrait is in this casket").<br /><br />For three caskets, this can be represented as an array of three integers. For example the statements for the puzzle above would be represented as [1, -2, -1], the 1 in the first position is saying that the first casket is pointing positively to itself ("the portrait is in this casket"). The -2 in the second position is saying that the second casket is pointing negatively to itself ("the portrait is not in this casket"), and the -1 in the third position is saying that the third casket is pointing negatively at the first casket ("the portrait is not in the gold casket"). We can analyse this puzzle using a chart like the one below:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-fauEF_QqVGs/WimONa4p42I/AAAAAAAAEKM/hdo1547BvbwAFOiDYN4rXSEGYaJvSNWDwCLcBGAs/s1600/truth_counts_portia1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="192" data-original-width="628" height="121" src="https://3.bp.blogspot.com/-fauEF_QqVGs/WimONa4p42I/AAAAAAAAEKM/hdo1547BvbwAFOiDYN4rXSEGYaJvSNWDwCLcBGAs/s400/truth_counts_portia1.PNG" width="400" /></a></div><br />For the puzzle that says "there is at most one true statement," this means that the portrait is in casket 2 (silver), the only placement which gives at most one true statement. The chart also tells us that we cannot use this statement arrangement to make up other puzzles like "there are no true statements" or "there are exactly two true statements," as the other casket positions (p=1, p=3) both make two statements true.<br /><br />So, generating this sort of Portia Casket problem is easy: first generate all lists of length three (for the three caskets) made up of the values -1, -2, -3, 1, 2, 3 (for positive and negative statements about the three caskets). Each of these lists gives a family of three possible puzzles - one for the portrait being in each casket. Check each possible solution to see how many statements become true with that solution. Any solution that gives a truth count that is unique in that family corresponds to a valid puzzle.<br /><br />For three caskets, following this method of generating puzzles, we get a total of 348 puzzles. Some of these are trivially easy, as in the case where the clue is "all statements are true" and one of the caskets says "the portrait is in here."<br /><br />Smullyan's first Portia puzzle, puzzle 67a, corresponds to the puzzle with identifier <i>portia1-44 </i>in our Portia I generator. Smullyan presents another puzzle by the first generation of Portias, puzzle 67b. This puzzle has statements [-2, -2, 3], and corresponds to <i>portia1-271</i> in the Portia I generator.<br /><br />All the Portia I puzzles are listed in <a href="https://raw.githubusercontent.com/dmackinnon1/dmackinnon1.github.io/master/portia/data/portia1.json">this json file</a>. Here is an example of one from <a href="https://dmackinnon1.github.io/portia/">the page</a>:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-FCqmQhTdRRE/WimqRNAu4aI/AAAAAAAAEK8/Ow2GlOYIMhI8VRc8hmGvXFmfcyMai7SpwCLcBGAs/s1600/portia1-generated.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="326" data-original-width="552" height="235" src="https://1.bp.blogspot.com/-FCqmQhTdRRE/WimqRNAu4aI/AAAAAAAAEK8/Ow2GlOYIMhI8VRc8hmGvXFmfcyMai7SpwCLcBGAs/s400/portia1-generated.PNG" width="400" /></a></div><br />Hopefully, you can see that we would represent the statements as [-1, -2, 2] and that the solution to this puzzle would have to be casket 1.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-TVLoapx6k6M/Wimq37yHW6I/AAAAAAAAELE/cDVX8G7OWUAj6kkzIcWzCsJ3GLqM2XwVQCLcBGAs/s1600/portia1-generated-solved.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="372" data-original-width="549" height="270" src="https://3.bp.blogspot.com/-TVLoapx6k6M/Wimq37yHW6I/AAAAAAAAELE/cDVX8G7OWUAj6kkzIcWzCsJ3GLqM2XwVQCLcBGAs/s400/portia1-generated-solved.PNG" width="400" /></a></div><br /><h3>Finding 16152 more!</h3>In "What is the Name of this Book?" a second generation Portia makes more difficult puzzles by putting two statements on each casket. Our Portia II generator is based on Smullyan's puzzle 68b.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-3ZtEzVvfGyw/WimTTKorxZI/AAAAAAAAEKc/evwtJprqyYgGFMijZEbCnhsYBi9qxNoHgCLcBGAs/s1600/portia2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="299" data-original-width="383" height="311" src="https://1.bp.blogspot.com/-3ZtEzVvfGyw/WimTTKorxZI/AAAAAAAAEKc/evwtJprqyYgGFMijZEbCnhsYBi9qxNoHgCLcBGAs/s400/portia2.PNG" width="400" /></a></div><br /><br />It seems clear that these puzzles are very similar to the Portia I puzzles except: (1) there are two lists of statements, and (2) instead of giving a total count of the true statements, we describe the distribution ("on one lid both statements are true, on another both statements were false, and on a third one statement was true and one false").<br /><br />If we model the statements as two lists of integers, such as [-1, -1, -3], [2 ,3, 1] for the above, and then for each pair of lists include puzzles where a portrait position generates a unique distribution, we can create puzzles like this one. It makes sense to exclude statement lists where the second set of statements is the same as the first, and to consider puzzles the same if we just exchange the first list of statements with the second list.<br /><br />Following this approach we get a large number (16152) of puzzles (all of them are <a href="https://raw.githubusercontent.com/dmackinnon1/dmackinnon1.github.io/master/portia/data/portia2.json">here</a>). These are generally quite a bit trickier to solve than Portia I puzzles, although the method for solving them is essentially the same. Puzzle 68b above corresponds to <i>portia2-6854, </i>although the Portia II algorithm we used swaps the first statement list for the second (it generates as [2 ,3, 1], [-1, -1, -3]).<br /><br />Here's an example of a generated puzzle:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-d5sqgaOX6mA/WimvJ2fxfGI/AAAAAAAAELQ/zsCzs5a4ugoOIlO2o2FIVwBaGnqzF-_MQCLcBGAs/s1600/portia2-generated.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="374" data-original-width="633" height="236" src="https://1.bp.blogspot.com/-d5sqgaOX6mA/WimvJ2fxfGI/AAAAAAAAELQ/zsCzs5a4ugoOIlO2o2FIVwBaGnqzF-_MQCLcBGAs/s400/portia2-generated.PNG" width="400" /></a></div><br />For this particular puzzle we don't have to work backwards, we can take a direct approach aided by the contradictory statements on casket 2: We know this must be the one casket with one true statement. Since the statements on casket 1 cannot both be true, we know that this must be the casket with no true statements. This implies that casket 3 is the casket with two true statements. One of the statements on casket 3 says the portrait is in casket 2... so that is where it must be.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-OoQk1etUVyU/WimxzLqifLI/AAAAAAAAELc/Q4pq4jS-ITEPKwbxtquM28QYjiLXFuvYACLcBGAs/s1600/portia2-generated-solution.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="412" data-original-width="626" height="262" src="https://3.bp.blogspot.com/-OoQk1etUVyU/WimxzLqifLI/AAAAAAAAELc/Q4pq4jS-ITEPKwbxtquM28QYjiLXFuvYACLcBGAs/s400/portia2-generated-solution.PNG" width="400" /></a></div><br /><h3>Bellini and Cellini give us 3600 more puzzles</h3>Instead of telling us how many of the caskets have true statements, or how true statements are distributed across the caskets, what if solving another riddle was the key to figuring out which statements are true and which are false?<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-MghAC5MbZDE/WimiAhQzo2I/AAAAAAAAEKs/VRaSInk9xqwoD29LnO3s5Pbv3iAZdpXAwCLcBGAs/s1600/bellini_cellini.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="294" data-original-width="385" height="305" src="https://2.bp.blogspot.com/-MghAC5MbZDE/WimiAhQzo2I/AAAAAAAAEKs/VRaSInk9xqwoD29LnO3s5Pbv3iAZdpXAwCLcBGAs/s400/bellini_cellini.PNG" width="400" /></a></div><br />When attempting to generate "Bellini and Cellini" puzzles, I decided on an approach that does not quite match up with any of the puzzles in "What is the Name of this Book," but is a combination of Portia I, Portia II, and the "Knights and Knaves" puzzles that Smullyan describes in an earlier chapter (see <a href="http://www.mathrecreation.com/2017/11/the-island-of-knights-and-knaves.html">this post</a>).<br /><br />For Portia III, we imagine that the caskets have inscriptions similar to Portia I, but also have an extra inscription that says something about the provenance of the caskets. For example, casket 1 might have an inscription "casket 2 was made by Bellini." You might think "great, that means that whatever is written on casket 2 must be true." Well, that is correct only if casket 1 was also made by Bellini, if it was made by Cellini, then whatever is written on casket 2 is actually false.<br /><br />So, our Portia III algorithm is actually a set of Portia I statements with a "three-islander Knights and Knaves puzzle" layered on top of it. You can learn more about these <a href="http://www.mathrecreation.com/2017/11/the-island-of-knights-and-knaves.html">here</a>. For simplicity, a specific kind of "three islander" problem was chosen: the three caskets (islanders) point at each other using 2 "accusation/affirmations" and one "similarity/difference" statement. These are always (pretty easily) solvable. Maybe a future Portia puzzle generator will involve different varieties of Bellini & Cellini statements.<br /><br />All the Portia III puzzles that the current algorithm generates are listed in <a href="https://raw.githubusercontent.com/dmackinnon1/dmackinnon1.github.io/master/portia/data/portia3.json">this json file</a>. Let's try one:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-frL7ain6-bI/WimyUAMdPJI/AAAAAAAAELk/gakc2ScnMmkh-pXjPrBEWkBXKQkvF-uiACLcBGAs/s1600/portia3-generated.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="367" data-original-width="681" height="215" src="https://3.bp.blogspot.com/-frL7ain6-bI/WimyUAMdPJI/AAAAAAAAELk/gakc2ScnMmkh-pXjPrBEWkBXKQkvF-uiACLcBGAs/s400/portia3-generated.PNG" width="400" /></a></div><br /><br />Casket 2 includes the inscription "Fashioned by a different maker than 1." If casket 2 is made by Bellini, this means that casket 1 is made by Cellini, since we can trust casket 2 in this case. If on the other hand, casket 2 is made by Cellini, then we should disbelieve the statement, and conclude that casket 1 is made by the same maker (Cellini). Hence, regardless of who made casket 2, we know that casket 1 is made by Cellini, and its inscriptions will be false. Now casket 1 makes the (false) assertion that casket 3 is made by Cellini - so we know that actually casket 3 is made by Bellini and must contain only true inscriptions. Casket 3 says that the portrait is in casket 2, so we believe it:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-FIvlm_Niq_A/Wim0XCyqSBI/AAAAAAAAELw/N9vUfXuUdWkLImPR4zPxI33aYi7Sc7MNgCLcBGAs/s1600/portia3-generated-solution.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="432" data-original-width="675" height="255" src="https://3.bp.blogspot.com/-FIvlm_Niq_A/Wim0XCyqSBI/AAAAAAAAELw/N9vUfXuUdWkLImPR4zPxI33aYi7Sc7MNgCLcBGAs/s400/portia3-generated-solution.PNG" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div>Working backwards is not the approach to take with Portia III: these puzzles require you to first solve the Bellini/Cellini riddle and figure out which caskets are stating the truth, and which are lying. Next you can use this information to follow the true (or false) statements to the portrait.<br /><br />When generating these puzzles, the method is to first generate all possible Portia I statements. For a given set of statements, each possible solution (casket 1, casket 2, or casket 3) makes each statement either true or false. To verify if the puzzle is solvable, we need to check whether the portrait can be discovered once the truth or falsehood of each statement is known. There is a simple rule for this: if <i>p</i> is the position of the portrait, then either we need a statement with value +/-p or we need a statement for each of the remaining caskets. An example of a puzzle that does not work would be [1, 1, 1] where <i>p</i> = 2. The three caskets would all be lying (they would all be saying the portrait was in casket 1), but there would not be enough information to tell us if the portrait was in casket 2 or 3. The same statement list, [1,1,1] is a valid puzzle if <i>p</i> = 1. Once we have a solvable puzzle, we can overlay a few different Bellini & Cellini riddles that would say which caskets are lying and which are stating truths.<br /><div><br /></div><div>So, all told, these three Portias have given us 20100 puzzles, enough to keep us busy for a while. I had a lot of fun digging into them, and I hope you have fun with them as well - please try them out: <a href="https://dmackinnon1.github.io/portia/">https://dmackinnon1.github.io/portia/</a> </div><div><br /></div><br /><div style="text-align: left;"><b>Portia:</b></div><i><div style="text-align: left;"><i>Thus hath the candle singed the moth.</i></div></i><i><div style="text-align: left;"><i>O, these deliberate fools! when they do choose,</i></div></i><i><div style="text-align: left;"><i>They have the wisdom by their wit to lose.</i> </div></i><div style="text-align: left;">- Act II, Scene VII, The Merchant of Venice </div><br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/2lb-9mNyNuQ" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2017/12/constructing-portias-caskets.htmltag:blogger.com,1999:blog-5008879105295771159.post-43190846723212202702017-11-18T06:16:00.000-08:002017-11-18T06:16:08.492-08:00the island of knights and knavesThere is classic type of logic problem where we are asked to imagine an island consisting of two types of people: those that always tell the truth (knights), and those that always tell lies (knaves). In puzzles based on this trope, the islanders make statements, and we have to figure out which islanders are knights and which islanders are knaves.<br /><br /><a href="https://dmackinnon1.github.io/knaves/">This page</a> will generate knight and knave puzzles of varying difficulty. Here’s an example: <br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-XA00rfKskEo/Wg9aOIQ-E2I/AAAAAAAAEIM/WJR3oXmagmU1DFBHr1uVqkZJGl6rELRwwCLcBGAs/s1600/easy4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="214" data-original-width="418" src="https://2.bp.blogspot.com/-XA00rfKskEo/Wg9aOIQ-E2I/AAAAAAAAEIM/WJR3oXmagmU1DFBHr1uVqkZJGl6rELRwwCLcBGAs/s1600/easy4.png" /></a></div><div style="text-align: center;"><i>An "easy" puzzle from https://dmackinnon1.github.io/knaves/</i> </div><br />The grandfather of all these puzzles is an actual islander who referenced an actual island - around 600 BCE, the Cretan <a href="https://en.wikipedia.org/wiki/Epimenides_paradox">Epimenides</a> is credited with the statement “All Cretans are liars.” The fun has not stopped since.<br /><br />The authoritative source for island puzzles is “What is the Name of this Book?” by <a href="https://en.wikipedia.org/wiki/Raymond_Smullyan">Raymond M. Smullyan</a>, which builds these seemingly simple puzzles from humble beginnings (knights and knaves alone on islands) to much more complicated ones that include normals (they sometimes lie, and sometimes tell the truth), the insane (they think lies are truths, and vice versa), monkeys, clubs of knights and knaves, vampires, werewolves and other characters. Using this motley crew, the book slyly leads us to a puzzle-based statement of Godel’s incompleteness theorem.<br /><br />We will stick to the first type of puzzles: knights and knaves alone on an island. How do we solve the puzzle above? Here's one way to reason it out:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-c0oVpQSbNLo/Wg9afBJdY3I/AAAAAAAAEIQ/86EDu9Y3lec4H8EsTygTFIkA-3o5Q1M9ACLcBGAs/s1600/easy4.solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="384" data-original-width="417" src="https://3.bp.blogspot.com/-c0oVpQSbNLo/Wg9afBJdY3I/AAAAAAAAEIQ/86EDu9Y3lec4H8EsTygTFIkA-3o5Q1M9ACLcBGAs/s1600/easy4.solution.png" /></a> </div><div class="separator" style="clear: both; text-align: center;"><i>A sample solution for a puzzle generated <br />at https://dmackinnon1.github.io/knaves/</i></div><br />The puzzle generation page mentioned above limits itself to knights and knaves making three kinds of statements:<br /><br /><b>Accusations and Affirmations</b><br />In an accusation, an islander A says something like "B is a knave" or an equivalent statement like "B always lies." In an affirmation, islander A says something like "B is a knight" or "B always tells the truth."<br /><br />Unfortunately, we don't know if A is telling the truth or not, so how can we know if what they are saying about B is true or not? Even without knowing the type of A, we can learn something very helpful about A and B from these statements. If A and B are linked by an accusation, they must be of different types: either A is a knave and B is a knight, or vice versa. If A and B are linked by an affirmation, they must be of the same type: either both are knights, or both are knaves. See if you can reason out why this must be so.<br /><br />One approach to use when solving puzzles that feature several accusations and affirmations is to draw a diagram (as described in an <a href="http://www.mathrecreation.com/2012/05/liar-truther-accusation-graphs.html">old post</a>).<br /><br /><b>Knave Conjunctions</b><br />An example of a knave conjunction, is when A says "B is a knight, or I am a knave," or "C is a knave and I am a knave."<br /><br />These are very helpful statements, as they always tell us the type of both the speaker and the spoken-of. Any islander who says "or I am a knave" will be making a statement that must be, overall, truthful and is therefore a knight, while any islander who says "and I am a knave" will by lying, and must be knave. Try and convince yourself of that.<br /><br />An interesting thing about "knave conjunctions" is that their usefulness comes from how close they are to the <a href="https://en.wikipedia.org/wiki/Liar_paradox">liar paradox</a>. The liar paradox is a more self-directed refinement of that original statement of Epimenides, where we imagine that someone says: "I am lying" and wonder if they are telling the truth or not.<br /><br />An islander cannot make the statement "I am lying," or any equivalent statement such as "I am a knave." If such a statement is true, then the speaker is lying, making the statement also false; and if it is false, the speaker is lying, making the statement also true. So such a statement is contradictory - neither false or true, and our islanders are restricted to statements that are either true or false.<br /><br />Islanders, however, can get close to generating the liar paradox by including its statement as a clause along with another statement. To see how they can do this, you have to be clear on how statements that include "and" and "or" work. If someone on the island says "X or Y" then only X or Y has to be true in order for the whole statement to be true. So a knight can say "X or Y" when only one of the statements is true. However, if a knave says "X or Y" then both X and Y must be false (if one was true, the whole statement would be true, and a knave cannot make a true statement). If an islander says "X and Y" then both X and Y have to be true in order for the statement to be true, and only one needs to be false for the statement to be false. So a knave can say "X and Y" when only one of the statements is false. <br /><br /><b>Similarity and Difference Statements</b><br />Sometimes an islander A might say "B is my type" or maybe "C is not my type." We might not know if A is a knight or knave, but we can infer the type of B and C right away. No matter whether A is lying or telling the truth, if A claims "B is my type," then B must be a knight. On the other hand, if A claims that "C is not my type" we know that C is a knave. Do you agree?<br /><br />It is interesting to compare these statements with our first type of statements, the "accusations/affirmations," these two types of statements are reciprocal in a way. When an islander directly says what type another islander is (an accusation or affirmation), all we learn is that the source and target of the statement are similar or different, without learning the actual type. However, when an islander makes a statement about similarity or difference, we learn exactly what type the target is, without learning if this is similar or different than the source.<br /><br />There are many more interesting things that islanders could say, but once you have reasoned out how these three kinds of statements work, you can beat any puzzle on the <a href="https://dmackinnon1.github.io/knaves/">page</a>.<br /><br /><img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/n7QWdxkKFE0" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2017/11/the-island-of-knights-and-knaves.htmltag:blogger.com,1999:blog-5008879105295771159.post-74584891434167282352017-11-10T12:14:00.001-08:002017-11-10T12:14:50.138-08:00trihexagonal & rhombille tilings<div class="separator" style="clear: both; text-align: center;"><img src="http://78.media.tumblr.com/6af5ec0ff617c1b6cb6f101c88745618/tumblr_oz2ypePiEm1r62rxco1_250.png" /></div><br />The image above is the superposition of two tessellations. The dark bold lines show a tiling of the plane that is made up of regular hexagons and triangles (the <a href="https://en.wikipedia.org/wiki/Trihexagonal_tiling">trihexagonal</a> tiling).<br /><br />The light lines show portions of the reciprocal (or dual) of the dark-lined tessellation.<br /><br />To create a reciprocal tessellation, for every two adjacent tiles in the original tessellation, join the centers of the two tiles by a line segment perpendicular to their shared side. This line segment becomes the edge of one of the tiles in the reciprocal tessellation.<br /><br />The reciprocal of trihexagonal tiling is made up entirely of rhombs, the <a href="https://en.wikipedia.org/wiki/Rhombille_tiling">rhombille </a>tiling.<img src="http://feeds.feedburner.com/~r/Mathrecreation/~4/iU16cvoYa40" height="1" width="1" alt=""/>Dan MacKinnonhttps://plus.google.com/100029769408149043814noreply@blogger.comhttp://www.mathrecreation.com/2017/11/trihexagonal-rhombille-tilings.html