Mathematical Circles Library

Mathematical Circle Diaries, Year 2 Complete Curriculum for Grades 6 to 8

Anna Burago Mathematical Circle Diaries, Year 2 Complete Curriculum for Grades 6 to 8

Mathematical Circles Library

Mathematical Circle Diaries, Year 2 Complete Curriculum for Grades 6 to 8

Anna Burago

Berkeley, California Advisory Board for the MSRI/Mathematical Circles Library Titu Andreescu Tatiana Shubin (Chair) David Auckly Zvezdelina Stankova H´el`ene Barcelo James Tanton Zuming Feng Ravi Vakil Tony Gardiner Diana White Nikolaj N. Konstantinov Ivan Yashchenko Andy Liu Paul Zeitz Alexander Shen Joshua Zucker Series Editor: Maia Averett, Mills College. Edited by Nelli Tkach and Maia Averett

Illustrations by Susanna Hakobyan

This volume is published with the generous support of the Simons Foundation and Tom Leighton and Bonnie Berger Leighton.

2010 Mathematics Subject Classification. Primary 97A20, 97A80, 00A07, 00A08, 00A09, 97D50.

For additional information and updates on this book, visit www.ams.org/bookpages/mcl-20

Library of Congress Cataloging-in-Publication Data Names: Burago, Anna, 1967- author. Title:Mathematicalcirclediaries,year2: completecurriculumforgrades6to8/AnnaBurago. Description: Berkeley, California : MSRI Mathematical Sciences Research Institute ; Providence, Rhode Island : American Mathematical Society, c2018. | Series: MSRI mathematical circles library ; 20 | Includes bibliographical references. Identifiers: LCCN 2017058792 | ISBN 9781470437183 (alk. paper) Subjects: LCSH: Games in mathematics education. | Mathematics–Study and teaching (Middle school)–Activity programs. | AMS: Mathematics education – General, mathematics and educa- tion – Recreational mathematics, games. msc | Mathematics education – General, mathematics and education – Popularization of mathematics. msc | General – General and miscellaneous specific topics – Problem books. msc | General – General and miscellaneous specific topics – Recreational mathematics. msc | General – General and miscellaneous specific topics – Popularization of mathematics. msc | Mathematics education – Education and instruction in mathematics – Teaching and heuristic strategies. msc Classification: LCC QA20.G35 B8725 2018 | DDC 510.71/2–dc23 LC record available at https://lccn.loc.gov/2017058792

Copying and reprinting. Individual readers of this publication, and nonprofit libraries acting for them, are permitted to make fair use of the material, such as to copy select pages for use in teaching or research. Permission is granted to quote brief passages from this publication in reviews, provided the customary acknowledgment of the source is given. Republication, systematic copying, or multiple reproduction of any material in this publication is permitted only under license from the American Mathematical Society. Requests for permission to reuse portions of AMS publication content are handled by the Copyright Clearance Center. For more information, please visit www.ams.org/publications/pubpermissions. Send requests for translation rights and licensed reprints to [email protected]. c 2018 by Anna Burago. All rights reserved. Printed in the United States of America. ∞ The paper used in this book is acid-free and falls within the guidelines established to ensure permanence and durability. Visit the AMS home page at http://www.ams.org/ Visit the MSRI home page at htpp://www.msri.org/ 10987654321 232221201918 Contents

Acknowledgments xiii Preliminaries 1 Mathematical Circles 1 A Few Words about This Book 2 Potential Students 3 Curriculum 3

Part 1. Session Plans 5 Introduction 7 Lessons and Problem Sets 7 Session 1: Checkerboard Problems 9 1.1. Introduction 9 1.2. Math Warm-up 10 1.3. Discussion of the Day: Checkerboard Problems 10 1.4. In-Class Problem Set 14 1.5. A Few Words about Problem Sets 15 1.6. Take-Home Problem Set 15 1.7. Additional “Checkerboard” Problems 17 Session 2: Review: Math Logic and Other Problem-Solving Strategies 19 2.1. Math Warm-up 19 2.2. Discussion of the Day: Problem-Solving Strategies 20 2.3. Take-Home Problem Set 23 Session 3: Invariants 25 3.1. Warm-up Discussion. Are Proofs Really Necessary? 25 3.2. Discussion of the Day: Invariants 28 3.3. Take-Home Problem Set 32

v vi Contents

Session 4: Proof by Contradiction 33 4.1. Math Warm-up 33 4.2. Discussion of the Day: Proof by Contradiction 33 4.3. Take-Home Problem Set 37 Session 5: Decimal Number System and Problems on Digits 39 5.1. Warm-up Discussion. Egyptian Number System 39 5.2. Discussion of the Day: Problems on Digits 41 5.3. In-Class Problem Set 45 5.4. Take-Home Problem Set 45 5.5. Additional Problems 46 Session 6: Binary Numbers I 47 6.1. Math Warm-up 47 6.2. Discussion of the Day: Binary Land—an Informal Introduction to Binaries 48 6.3. Binary Number System 51 6.4. Binary Notation 53 6.5. Computers and Binary Numbers 53 6.6. Take-Home Problem Set 55 Session 7: Binary Numbers II 59 7.1. Math Warm-up 59 7.2. Discussion of the Day: Binary Arithmetic 60 7.3. How to Convert Decimals to Binary 61 7.4. Take-Home Problem Set 65 Session 8: Mathematical Dominoes Tournament 67 8.1. Math Warm-up 68 8.2. Rules of Mathematical Dominoes 68 8.3. Mathematical Dominoes Problems 69 8.4. Take-Home Problem Set 78 Session 9: Pigeonhole Principle 81 9.1. Math Warm-up 81 9.2. Discussion of the Day: Pigeonhole Principle 81 9.3. Take-Home Problem Set 85 9.4. Additional Problems 87 Session 10: Geometric Pigeonhole Principle 89 10.1. Math Warm-up 89 10.2. Discussion of the Day: Geometric Pigeonhole 89 10.3. Take-Home Problem Set 92 10.4. Additional Problems 93 Contents vii

Session 11: Mathematical Olympiad I 95 11.1. Event of the Day: Mathematical Olympiad 95 11.2. Mathematical Olympiad I. First Set of Problems 96 11.3. Mathematical Olympiad I. Second Set of Problems 97 11.4. Mathematical Olympiad I. Additional Problems 97 Session 12: Combinatorics I. Review 99 12.1. Math Warm-up 99 12.2. Discussion of the Day: Review of Combinatorics Techniques 100 12.3. In-Class Problem Set 105 12.4. Take-Home Problem Set 106 12.5. Additional Problems 107 Session 13: Combinatorics II. Combinations 109 13.1. Math Warm-up 109 13.2. Discussion of the Day: Combinations 110 13.3. Take-Home Problem Set 114 Session 14: Mathematical Auction 117 14.1. Math Warm-up 118 14.2. Event of the Day: Mathematical Auction Game 118 14.3. Mathematical Auction Problems 119 14.4. Take-Home Problem Set 120 Session 15: Combinatorics III. Complements. Snake Pit Game 121 15.1. Math Warm-up 121 15.2. Discussion of the Day: Complements 122 15.3. Activity of the Day: Snake Pit on Combinatorics 124 15.4. Take-Home Problem Set 126 Session 16: Combinatorics IV. Combinatorial Conundrum 129 16.1. Math Warm-up 129 16.2. Discussion of the Day: Combinatorial Craftiness 130 16.3. Take-Home Problem Set 135 16.4. Additional Problems 136 Session 17: Magic Squares and Related Problems 139 17.1. Math Warm-up 139 17.2. Discussion of the Day: Magic Squares from 1 to 9 140 17.3. More on 3 × 3 Magic Squares 143 17.4. Magic Squares Extended 144 17.5. Take-Home Problem Set 144 viii Contents

Session 18: Double Counting, or There Is More than One Way to Cut a Cake 147 18.1. Math Warm-up 147 18.2. Discussion of the Day: Double Counting 148 18.3. Take-Home Problem Set 152 18.4. Additional Problems 153 Session 19: Mathematical Olympiad II 157 19.1. Event of the Day: Mathematical Olympiad 157 19.2. Mathematical Olympiad II. First Set of Problems 157 19.3. Mathematical Olympiad II. Second Set of Problems 158 19.4. Mathematical Olympiad II. Additional Problems 159 Session 20: Divisibility I. Review 161 20.1. Math Warm-up 161 20.2. Discussion of the Day: Divisibility 162 20.3. Prime Factorization Practice. Set 1 168 20.4. Prime Factorization Practice. Set 2 168 20.5. Take-Home Problem Set 169 20.6. Additional Problems 170 Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM 171 21.1. Math Warm-up: Mysteries of Prime Numbers 171 21.2. Discussion of the Day: Relatively Prime Numbers 173 21.3. Greatest Common Factor (GCF) 174 21.4. Least Common Multiple (LCM) 175 21.5. How GCF and LCM Are Related 177 21.6. GCF and LCM. In-Class Practice Problems 177 21.7. Take-Home Problem Set 179 21.8. Additional Problems 180 Session 22: Divisibility III. Mathematical Race Game 181 22.1. Math Warm-up 182 22.2. Event of the Day: Mathematical Race 182 22.3. Take-Home Problem Set 183 Session 23: Mathematical Auction 185 23.1. Event of the Day: Mathematical Auction Game 185 23.2. Mathematical Auction Problems 186 23.3. Take-Home Problem Set 187 Session 24: Divisibility IV. Divisibility by 3 and Remainders 189 24.1. Math Warm-up 189 24.2. Discussion of the Day: Remainders When Divided by 3 189 Contents ix

24.3. Arithmetic of Remainders 190 24.4. Take-Home Problem Set 196 24.5. Additional Problems 197 Session 25: Divisibility V. Divisibility and Remainders 199 25.1. Math Warm-up 199 25.2. Discussion of the Day: Divisibility and Remainders 199 25.3. Divisibility and Remainders Practice 204 25.4. Take-Home Problem Set 205 25.5. Additional Problems 205 Session 26: Graph Theory I. Graphs and Their Applications 207 26.1. Math Warm-up 207 26.2. Discussion of the Day: Why Graphs Are Important 208 26.3. How to Calculate the Number of Edges in a Graph 210 26.4. Take-Home Problem Set 211 Session 27: Graph Theory II. Handshaking Theorem 213 27.1. Math Warm-up 213 27.2. Discussion of the Day: Odd Vertices Theorem 214 27.3. In-Class Problem Set 217 27.4. Take-Home Problem Set 218 27.5. Additional Problems 219 Session 28: Graph Theory II. Solving Problems with Graphs 221 28.1. Math Warm-up 221 28.2. Discussion of the Day: Graphs Potpourri 221 28.3. Take-Home Problem Set 226 Session 29: Mathematical Olympiad III 227 29.1. Event of the Day: Mathematical Olympiad 227 29.2. Mathematical Olympiad III. First Set of Problems 228 29.3. Mathematical Olympiad III. Second Set of Problems 229

Part 2. Mathematical Contests and Competitions 231 Mathematical Contests 233 Mathematical Auction 235 What Is Special about Mathematical Auctions? 235 Rules of Mathematical Auction 235 A Sample Round 237 Team Work 238 Advice for a Teacher 239 Examples of Mathematical Auction Problems 239 x Contents

Mathematical Dominoes 241 Rules of Mathematical Dominoes 241 Why Students Like Mathematical Dominoes 242 Why Teachers Like Mathematical Dominoes 243 Useful Details 243 Scorecards 244 Dominoes Cards: How to Make Them 244 Odds and Ends 244 Mathematical Snake Pit 247 Rules of Snake Pit Game 247 Useful Details 247 Score Table 248 Mathematical Race 249 Rules of Mathematical Race 249 Useful Details 249 Score Table 249 Mathematical Olympiad 251 Planning for an Oral Olympiad 253 Running an Olympiad 253 Olympiads in This Book 254 Awards and Prizes 254 Short Entertaining Math Games 255 Giotto and Math Giotto 255 Nim 256 Black Box 256

Part 3. More Teaching Advice 259 How to Be a Great Math Circle Teacher 261 Teaching Style 261 Your Target Group 263 What Comes Next? 265 The Farewell 267

Part 4. Solutions 269 Session 1. Checkerboard Problems 271 Session 2. Review: Math Logic and Other Problem-Solving Strategies 275 Session 3. Invariants 278 Session 4. Proof by Contradiction 279 Session 5. Decimal Number System and Problems on Digits 282 Session 6. Binary Numbers I 287 Contents xi

Session 7. Binary Numbers II 290 Session 8. Mathematical Dominoes Tournament 292 Session 9. Pigeonhole Principle 295 Session 10. Geometric Pigeonhole Principle 298 Session 11. Mathematical Olympiad I 301 Session 12. Combinatorics I. Review 303 Session 13. Combinatorics II. Combinations 307 Session 14. Mathematical Auction 309 Session 15. Combinatorics III. Complements. Snake Pit Game 311 Session 16. Combinatorics IV. Combinatorial Conundrum 315 Session 17. Magic Squares and Related Problems 318 Session 18. Double Counting, or There Is More than One Way to Cut a Cake 321 Session 19. Mathematical Olympiad II 326 Session 20. Divisibility I. Review 329 Session 21. Divisibility II. Relatively Prime Numbers; GCF and LCM 332 Session 22. Divisibility III. Mathematical Race Game 335 Session 23. Mathematical Auction 338 Session 24. Divisibility IV. Divisibility by 3 and Remainders 340 Session 25. Divisibility V. Divisibility and Remainders 343 Session 26. Graph Theory I. Graphs and Their Applications 347 Session 27. Graph Theory II. Handshaking Theorem 349 Session 28. Graph Theory III. Solving Problems with Graphs 352 Session 29. Mathematical Olympiad III 355 Appendix to Session 6 359 “Convert Decimal to Binary” Blank Table 359 Bibliography 361

Acknowledgments

This book would not have been possible without the help, support, and encouragement of many great people whom I have the fortune to know. I am happy to thank some of them here. I would like to start by expressing gratitude to my entire family—my husband, my children, and my mother—for their support and for giving me an opportunity to spend so much time on this project. Special thanks go to my husband, Andrei, whose contribution is invalu- able. He is a mathematical circles expert and enthusiast, and we often teach together. The ideas and presentational approaches for many of the lessons in this book have been polished through our endless discussions, and many problems that you will encounter are his creations or translations. His sup- port and encouragement carried this project forward. While I was working on it, he took on whatever role was desperately needed to be filled at the moment: the family cook, a technical expert, an editor, and a psychologist. I will never be able to express in full my gratitude to Nelli Tkach, my longtime friend, editor, writing coach, and a person who strives to make the world better. She guided me through both this volume and Mathematical Circle Diaries, Year 1: together, we read through every page, and under her guidance, my cluttered and messy texts gained flow and power. I am very thankful to my Prime Factor partner, Luba Malkina. She is wise, careful, and thoughtful; conversations with her enlighten and give new perspectives on teaching mathematics, working with children, and on the constant rediscovery of meaning in the profession that we both chose. She also shouldered a lot of the Prime Factor daily operations, giving me time to work on this project. I am happy that so many young people, including my children and my ex-students, contributed their editing and technical expertise to the book: Bella Burago, Alex Burago, Tim Burago, Sasha Nalimova, Anna Meleschuk, Anna Ipatova, and many others. I am thankful to the American Mathematical Society (AMS) and the Mathematical Sciences Research Institute (MSRI) (and all the individuals involved) for their continuous support of the mathematical circles movement. Without their efforts, such a rapid growth in the popularity of math circles

xiii xiv Acknowledgments in the US would not have been possible. In particular, I am grateful to Tatiana Shubin for working so relentlessly for the cause. I would like to express my gratitude to Sergei Gelfand, AMS publisher, for caring and making sure this book is published as good as it could possibly be. My special thanks go to my very thoughtful and hardworking AMS production editor, Arlene O’Sean, for the significant contributions she made to the final version of the book. I am thankful to my great teachers, in St. Petersburg Math Circles and in St. Petersburg Math Schools 45 and 239, who shaped my love and understanding of mathematics. Finally, I am thankful to all past and present enthusiasts of math circle education, who created the math circle culture, came up with the topics to teach, and invented most of the problems in this book. Preliminaries

Mathematical Circles

What is mathematics? Some people would say that it is a collection of useful knowledge that gives us tools for solving challenging technical problems. Indeed, empowered with mathematical skills, an engineer can evaluate the stability of a bridge, and a rocket scientist can design the trajectory for a Mars rover. And, undoubtedly, students attending a circle learn their share of math- ematical knowledge. This knowledge is precious by itself because children learn material that is typically not covered at school and that is relevant to a broad range of modern professions. However, mathematics is much more than a collection of technical knowl- edge. It is also a unique way of thinking about the world. Thinking mathe- matically is about analyzing why and how, breaking complex problems apart, spotting connections, finding common patterns, making predictions, creating logical arguments, and coming up with new ideas. And mathematical circles are places where kids get exposed to this view of the world. Therefore, the benefits of studying in a circle are much broader than just the expansion of factual knowledge. Students gain new ways of thinking about mathematics: they learn to build arguments, to give proofs, to analyze from different points of view, to make connections across topics, to generate ideas, and to look for their answers. This analytical approach to learning and problem solving is universally important. It is valuable not only for mathematicians but also for scientists, programmers, engineers, and business leaders. Moreover, the same set of thinking skills—an ability to analyze and critically process information, to reason, and to problem-solve—is crucial for everyday life as well. It helps to overcome biases and prejudices, to navigate in the ocean of information that surrounds us, to develop one’s judgments and opinions. Let’s mention a couple more benefits of studying in a mathematical circle. A circle serves as a place where mathematically motivated students can meet

1 2 Preliminaries like-minded peers. Participation in a circle helps kids to become members of a special community and to make friends who share their interest in learning. Moreover, a circle is a place where children interact with adults who share the commitment to the subject. Mathematical circle teachers often serve as role models, helping kids foster their enthusiasm for learning, influencing their future career choices, helping them grow and make important steps in the right direction. Learning in a math circle allows a child to discover the beauty and meaning of mathematics and to learn an important set of thinking skills and problem-solving habits. Most of the mathematical circle students will prob- ably not become professional mathematicians, choosing very different career paths instead. However, mathematics will remain their good friend through- out their formal education and beyond. Mathematical culture, problem- solving abilities, and analytical skills fostered in math circles are powerful tools that are indispensable for success in any career.

A Few Words about This Book This book is the second volume in the “Mathematical Circle Diaries” series. It shares the same presentational approach as Mathematical Circle Diaries, Year 1 [1], and it continues where the first book ended. The book offers a curriculum that can be used in the second year of a middle-school mathematical circle. As in the first book, the curriculum is organized as a collection of lessons: every lesson includes the materials to be presented in class, the sets of problems to work on, and all other bells and whistles required to make this lesson easy to prepare and fun to teach. This book covers a broad range of topics that belong to the “core” of a math circle education. These are proofing techniques and problem-solving strategies, as well as useful and exciting topics that are typically not well covered in school. These topics include invariants, proofs by contradiction, the Pigeonhole Principle, proofs by coloring, double counting, combinatorics, graph theory, binary numbers, divisibility and remainders, and many oth- ers. Yet, there are also plenty of challenges (problems, , ) that require nothing but common sense to solve them. The book includes problem-solving sessions, Olympiads, games, and tournaments as well. As in the Mathematical Circle Diaries, Year 1, our goal is to present top- ics that are both interesting and useful for children, balancing mathematical rigor with the scope of material and level of presentation that are accessible for middle-school students. Another goal of the book is to ease the challenge of preparing for a circle session. The material of the book is distributed among 29 easy-to-use lessons. Most of the lessons are organized as theoretical discussions followed by sets of relevant problems. These discussions and problems provide enough challenge for a broad range of students—from a rookie to a seasoned prob- lem solver. Some lessons are structured like mathematical entertainment Curriculum 3 sessions—problem-solving contests and tournaments (Mathematical Domi- noes, Mathematical Auctions, Olympiads). Besides, the book contains many pointers and useful “know-how” for teaching in a circle, such as advice on presenting the material and avoiding typical mistakes.

Potential Students The material is suitable for a child who has had some previous math circle experience. However, things do not always work as planned: new, inex- perienced students might join your class anytime. Also, children have this remarkable talent for forgetting things—you might end up with returning students who have a vague memory of this or that topic. Therefore, the book starts with a review of the key ideas and concepts from the first year. The topics in Year 2 build upon the themes presented in Year 1andare preceded by brief reviews of these themes as well. The book is written with 6th–8th graders in mind. However, many topics and problems will be interesting and challenging to older students as well. The level of the classroom discussions can be adjusted to add more or less complexity to a lesson. Also, the problem sets are constructed in such a way that they will be appealing to students of various levels—both to beginners and to more advanced pupils. Each set is composed of a mix of easier and more complex problems. Every problem set contains additional problems that can be incorporated into a curriculum for a more advanced group. All problem sets are accompanied by solutions. Easy-to-print problem sets can be found on the book’s website: www.ams.org/bookpages/mcl-20.

Curriculum The material presented in the book is based on the curriculum that has been taught for many years in Seattle-area mathematical circles: Prime Factor Math Circle, Northwest Academy of Sciences, and Robinson Center for Young Scholars at the University of Washington. In the Acknowledgments, the author personally thanked the teachers who contributed their materials to making this book happen. This curriculum has been time-tested, teacher-tested, and child-tested. Graduates from our first circles, who studied with us for many years, have already turned into adults establishing their professional careers. They can now look back and judge which aspects of their school-age education impacted their lives in a significant way. We asked several of our graduates to comment on how math circle experiences shaped them. Here is what one of them said: “My time in Math Circle was extremely valuable. Not only did I enjoy the circle itself (the people, the problems, the contests), but it nurtured my mind in a way that has helped me beyond the circle. Thinking about math in a rigorous proof-based 4 Preliminaries manner was useful when I wanted to compete in math competitions in high school and college. It was also useful in the math classroom itself as I had been exposed to many ideas (like number theory) while my classmates often had never seen it. On the non-academic side, the Math Circle also grew my love for math, and that has remained—I enjoy judging math competitions and helping out at math circles when I can.” We take great pride and pleasure in the material that we teach, and we hope that it will be useful for the other teachers, parents, and students. Part 1

Session Plans

Introduction

This book is about the art and craft of teaching a mathematical circle. It contains a collection of math circle materials and the know-how that has been accumulated during many years of teaching extracurricular mathematics to middle-school students. The book has four parts. The first part, which contains a full-year cur- riculum for a middle-school mathematical circle, is composed of 29 lessons. A typical lesson includes a detailed discussion of some mathematical topic and a set of problems to work on. Some lessons are organized as math games, tournaments, and Olympiads. The second part of the book is devoted to math entertainment: it de- scribes contests and games that can be used to make your mathematical circle more dynamic. The third part discusses the principles of teaching in a mathematical circle. The last part contains hints, answers, and solutions. Finally, the appendix contains a blank table for converting decimal to binary. This goes along with Session 6.

The format of the book is somewhat unusual. Some of the lessons are presented as transcripts of actual sessions that include students’ questions, teachers’ comments and observations, and so on. In my opinion, this format would help the reader appreciate the fun and joy of a math circle lesson.

Lessons and Problem Sets Every lesson in the book is accompanied by a collection of problems and exercises. The main problem set, which contains between five and eight problems, could be offered to the students after the lecture. The majority of the problems in a set are related to the topic of the lecture. Others could review previous material or simply provide an entertaining diversion. The problems in a set vary in difficulty: the most difficult ones are marked with an asterisk or are separated from the main set by a divider (a horizontal line).

7 8 Introduction

Additionally, some lessons come with sets of exercises that give students extra practice in the core problem-solving techniques presented in class. Typical examples of such topics are divisibility, remainders, combinatorics, and graph theory. Finally, some of the lessons include additional problems, which can be used for practice, for Olympiads, etc. Easy-to-print problem sets can be found on the website that accompanies the book: www.ams.org/bookpages/mcl-20. Each lesson in this book is intended to be presented during an hour-and- a-half or a two-hour class. (This time includes lecture, time for independent problem solving, and discussion of the solutions to homework problems.) However, all students are different: for more advanced groups, you may do with a shorter lesson. For a group of younger students, you may need to present a single lesson over the course of two lectures or skip some of the more advanced material. Session 1: Checkerboard Problems

The topic of the first meeting of a mathematical circle should be approach- able, educational, and captivating. At the same time, it should illustrate several key ideas that make a mathematical circle so special. We would like children to feel that a search for a solution can already be a fascinating process. Therefore, today we will be learning how color can help us in problem solving. This exciting and challenging topic will surely be a hit with students. There will be plenty of elegant and insightful proofs created on the fly, and there will be “aha!” moments. Today’s session will be organized as follows: - Teacher-students introduction. - A few words about math circles. - Short Warm-up. - Discussion and problem solving.

Teaching supplies for this session: - Printouts of the Sir Square’s Castle Puzzles (one per student, can be copied from Problem 2, page 11). - Printouts of the Sir Square’s Castle Puzzles with the hints (mapped on a checkerboard) (one per student, can be copied from Problem 2 discussion, page 12). - Printouts of the in-class problems (one per student). - Printouts of the take-home problem set (one per student). - Grid-lined paper (today’s problem set is dominated by problems that are set on a square grid).

1.1. Introduction During the first lesson, it is a good idea to spend some time on introducing yourself and getting acquainted with your pupils. If you have an extra 10 minutes to spare, you can play a short game to break the ice. For example, it could be “Two Truths and a Lie”. In this

9 10 Session 1: Checkerboard Problems game, everyone must tell the class three facts about himself or herself: two truths and a lie. Others must guess which facts are true. For example, the teacher would start the game by introducing herself and stating: “I own a ginger cat named Sugar Puff; every day I eat one Hi-Chew candy; I can juggle up to 5 objects.” Students would then try to guess which facts are true. Others would continue the game by taking turns. You can follow the game with a short talk about your plans for the math circle: what are you going to teach, how the lessons will be organized, how a math circle is different from school, etc.

1.2. Math Warm-up As usual, we start the lesson from a short warm-up. Warm-up 1. Several trees grow in the garden. On one of them, a pear tree, there are pears. After a strong wind had blown, there were neither pears on the tree nor on the ground. How come? Warm-up 2. Two girls were born to the same mother, on the same day, at the same time, in the same month and year, and yet they’re not twins. How could this be? For Teachers: Before presenting the warm-up problems, remind the kids that they are tricky and fun but usually not too challenging mathe- matically. Therefore, the children should be open-minded and be ready to come up with an unusual solution.

For Teachers: The answers to the Warm-up problems and solutions to all problems sets can be found in the “Solutions and Answers” starting on page 269.

For Teachers: Before we move on, let me remind you that some of the discussions in the book are presented as transcripts of actual circle sessions. They may include students’ questions, teachers’ answers, and so on.

1.3. Discussion of the Day: Checkerboard Problems

We start the discussion by presenting a collection of -like problems. All these puzzles are of the same type; yet, solutions for some of them will be easy to find, and for others—impossible. Why is this so? The answer will serve as an excellent review of the concept of a proof and of the topics on parity and alternations. Let’s present the first puzzle on the board. 1.3. Checkerboard Problems 11

Problem 1. The castle of Sir Square has 24 rooms arranged as a 6 × 4 grid; in each wall between the rooms there is a door. (The castle map is presented on the picture below.) Can you walk through the castle in such a way that you would start in the room marked with Sir Square’s coat of arms (a winged lion), visit each room of the castle exactly once, and end up in the room marked with a crown?

Problem 1 Discussion. We work through this puzzle together: I draw the map on the board, and a couple of volunteers step up to trace the possible routes you could take. One of the solutions is presented below.

Problem 2. Now, each child receives a sheet with 6 more puzzles and starts working on them.

a) b) c)

d) e) f )

Problem 2 Discussion. Pretty soon, students start presenting solutions for (a), (b), and (d). At the same time, some children declare that (c), (e), and (f) are impossible to solve. Several children try to explain this fact. The argument most likely goes like this: “If we start at this room and walk this way, we get stuck here; if we walk that way we get stuck there .... We tried all possible paths, and we failed to reach our goal....” Unfortunately, these 12 Session 1: Checkerboard Problems arguments are far from perfect. First, what if we missed a solution because we failed to notice some tricky way to take a turn? Moreover, the argument is picture-dependent: every time we choose a new pair of rooms, we need to analyze all possible paths all over again. Can’t we come up with some explanation that would be more universal? A student has an interesting observation: if we take the shortest route from the first to the last room and pass through an even number of empty rooms, the puzzle can be solved; if we pass through an odd number of rooms, it cannot. This observation seems to work: in (a) we pass through 6 rooms, in (b)—through 0, in (c)—through 3, in (e)—through 5 rooms. However, this is not a proof yet; so far, it is just an observation that happens to be correct for several specific puzzles. Is there a way to prove that this pattern is always true? We do need an insight. How about coloring the rooms in a checkerboard pattern?

I hand out new copies of the same puzzle set. This time, all 6 maps have the checkerboard coloring. (See the picture below.) The children copy their solutions to these colored maps. Could they spot some pattern?

a) b) c)

d) e) f )

Pretty soon, we have a bunch of new observations: - The rooms along a route alternate in color! - If the first and the last rooms are of different colors, then the puzzle has a solution! - If the first and the last rooms are of the same color, the puzzle cannot be solved! Hurray! These last two statements sound like a very promising hypothe- sis: “A proper route has to start and end in rooms of different colors!” Let’s prove it!

Indeed, the rooms along a route always alternate in color. Therefore, all the odd-numbered rooms must be of one color, and all the even-numbered rooms—of the other. The castle has 24 rooms altogether; thus, a path should be 24 rooms long. However, 24 is an even number. Therefore, the color of 1.3. Checkerboard Problems 13 the last room will always be different from the color of the first room. (See the picture below.) That explains why (c), (e), and (f) are impossible.

Let’s finish the discussion by generalizing the important principle we discovered so far. For this problem, we found a property that remains unchanged: a path of even length should always start and end in rooms of different colors. So, the conclusion is that it would be impossible to find a path of an even length connecting rooms of the same color! This idea of a quantity or property that remains unchanged is a very powerful problem-solving principle. Such a property is called invariant. In this problem, we discovered the invariant that uses the ideas of alternation and parity.

Our solution is short and elegant. Any other solution would have been way more complicated. For example, if we were trying to eliminate all possible routes by smart trial and error, our solution would have been time- consuming. Moreover, our solution is universal: we can use the same ap- proach for bigger castles as well!

For Teachers: A careful reader has probably noticed that we did not answer another important question. We proved that some positions are impossible; however, we did not prove that all other positions are possible. Indeed, is it true that for any pair of rooms of different colors the puzzle has a solution? While the answer is positive, the proof is somewhat difficult. Therefore, we are skipping it for now.

Now that we demonstrated how coloring could be helpful for solving problems, it is time for independent practice. To fully grasp this technique, the children should work through a set of problems on their own.

For Teachers: While the children are working on the in-class prob- lems, walk around checking their solutions and helping as needed. For all these problems, coloring is a pathway to an efficient solution. Therefore, whenever students steer toward a trial and error approach, remind them of the ideas that were discussed at the beginning of the session. Finish the lesson by discussing solutions. 14 Session 1: Checkerboard Problems

1.4. In-Class Problem Set

Problem 1. Can you tile this doggy with dominoes? (A domino is a 2 × 1 rectangle. “To tile” means to cover completely and without overlaps.)

Problem 2. Can you cut this hexagon-shaped cake into 23 identical pieces? (All cuts should follow the grid lines.)

Problem 3. A “cavalier” is a newly invented chess piece. It acts like a chess knight, except for moving in a 2×4 L-shape instead of a 2×3 L-shape. A chess cavalier stands at the bottom left corner of an 8 × 8 chessboard. Could you, after a series of steps, move it 1 square to the right?

Chess Chess Knight Cavalier

Problem 4. The summer cottage of Lady Square has 35 rooms arranged as a 7 × 5 grid; each wall between the rooms has a door. Can you walk through the cottage in such a way that: - you would start in the Lady Square’s drawing room (marked with a smiley face), - you would visit each room of the cottage exactly once, - you would end up in the room marked with the heart? (For every map, either draw a path or prove that such a route is impos- sible.) 1.6. Take-Home Problem Set 15

1.5. A Few Words about Problem Sets At every circle meeting, the children get one or more sets of problems to work on. Some of these problem sets, called “in-class problem sets”, are intended for in-class follow-up work to help the new concepts and ideas sink in. Others, called “take-home problem sets”, are more difficult and challenging. If time allows, students can start working through them in class. The unsolved problems become homework for the next class. Some of the problems can be quite tricky. Therefore, it could be possible that a student is not able to solve all of them. However, it never hurts to try. Also, we do not require the children to write down complete solutions. (Some could be quite lengthy.) It is sufficient to mark the important steps that would make it possible to recreate solutions in class.

1.6. Take-Home Problem Set Problem 1. The chess queen baked a cake that looks like a 4×6 chessboard. The chess king sneaked in and ate a 1 × 3 piece. The queen was left with the cake that is shown in the picture. However, the queen managed to cut the cake into 3 rectangular pieces, which she rearranged into a 5 × 5 square in such a way that the chess pattern was preserved. How did she do it? (All cuts should follow grid lines. Cake pieces can be rotated but cannot be flipped over.)

Problem 2. After a successful raid, pirates Archie, Billie, Cindy, and Daniel divided their loot of 70 gold coins. Each pirate received at least 1 coin. Archie got more coins than anyone else. Bill and Cindy together received 45 coins. How big was Daniel’s share?

Problem 3. The Triangular Castle (see the picture below) has triangular rooms and a door in each of its interior walls. A tour guide wants to trace a route through this castle that would not visit any room more than once. What is the maximum number of rooms one can visit on such a tour? (A tour can start and end in any two rooms.) 16 Session 1: Checkerboard Problems

Problem 4. The difference between 2 numbers is equal to one-half of their sum. What is the ratio of the first to the second number?

Problem 5. Downtown MathHattan has 4 streets going east-west, and 4 avenues going north-south, with a small plaza at each intersection. All roads

can be walked in both directions. ➩ Prime Factor

Chapel Integral ➩ Square ➩ Pi Cantina

(a) Can you walk from the Integral Square to the Pi Cantina, visiting each plaza exactly once? (b) Can you walk from the Integral Square to the Prime Factor Chapel, visiting each plaza exactly once? For each part, either present the route or explain why it doesn’t exist.

Problem 6. Mischievous Mike has changed two digits in Masha’s home- work problem, and her exercise now reads: 4 × 5 × 4 × 5 × 4 = 2247. Help Masha to find the changed digits and to restore the equality.

Problem 7. There are 10 Rainbow Dragons living on the slopes of Spring Mountain; each dragon has a specific color (red, blue, yellow, etc.) It is known that if you pick any 4 dragons, 2 of them will share a color. Prove that at least 4 of those dragons are of the same color.

For Teachers: Remember that the horizontal divider indicates a sec- tion with more difficult problems. You may decide to skip these problems when working with a younger group. 1.7. Additional “Checkerboard” Problems 17

1.7. Additional “Checkerboard” Problems Problem 1. You start off with a 6 × 6 chessboard. In part (a), one corner of it is missing. In parts (b) and (c), each chessboard is missing 2 corners. Which of these boards can you tile with dominoes? (A domino is a 2 × 1 tile. “To tile” means to cover completely and without overlaps.)

a) b) c)

Problem 2. There are 25 beetles sitting on the 25 squares of a 5 × 5 chessboard. On a blow of a whistle, each beetle relocates to an adjacent square (a square above or below or to the right or to the left). Prove that at least one of the squares will end up being empty. Problem 3. Little Bear came out of his house and found strange footprints going around his favorite tree (see the picture). He walked around the tree several times, studying the tracks and sometimes jumping over them to get a better look. In the end, the bear returned to the house. Could he have jumped over the mystery footprints 7 times? (Little Bear never jumps over the places where the track intersects itself.)

Problem 4. Someone has put a rectangular playing card face down on the table. You can flip the card over one of its edges as many times as you want. Can you end up with the card sitting face up on the same spot?

Session 2: Review: Math Logic and Other Problem-Solving Strategies

The goal of this session is to remind the students about several fundamental problem-solving techniques that they learned during the Year 1 circle. For those kids who are joining the circle this year, this lesson will serve as a brief crash course into some of the key topics and problem-solving strategies that we have studied. We will discuss logic, parity, and some types of proofs.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

2.1. Math Warm-up For today’s warm-up, we will discuss several Knights and Liars problems. Such a warm-up combines entertainment and education: it emphasizes the importance of reasoning and justifying an answer. Let’s describe the setting of the problems: Knights and Liars are two different groups of people who reside on some faraway island. People from the first group, the Knights, cannot lie. On the other hand, for the Liars telling lies is the only possible way of talking.

Warm-up 1. Two residents of the Knights and Liars Island, Rachel and Emma, are introducing themselves to you. “AtleastoneofusisaLiar,”saysRachel. Can you figure out who is who?

Warm-up 1 Discussion. Since we don’t know who each girl is, let’s assume that Rachel is a Knight. If she is a Knight, she has to tell the truth, making one of the girls a Liar. Since Rachel is a Knight, Emma must be the Liar. We have found an answer, but does it mean that this problem is solved? No, it is not—we have found one solution; however, other solutions may exist as well.

19 20 Session 2: Review: Math Logic and Other Problem-Solving Strategies

Assume now that Rachel is a Liar. In this case, the phrase “At least one of us is a Liar” should be false. So, both Rachel and Emma must be Knights. However, this scenario makes Rachel a Knight and a Liar at the same time. Our assumption leads to nonsense; therefore, Rachel cannot be a Liar. Finally, the problem is solved: we found the answer and proved that no other answers could be found. All possible cases have been covered.

Another group of people that we occasionally bump into on the island are tourists—the people who come to visit. As most regular people do, tourists sometimes tell the truth and sometimes tell lies. Warm-up 2. Once upon a time, on an island of Knights and Liars, you met a boy who told you that he was a Liar. Is this boy an islander or a tourist? Warm-up 2 Discussion. Can this boy be a Knight? The answer is neg- ative: a Knight would never lie to you. Can he be a Liar? No, because a Liar would never tell you the truth about himself. Thus, the boy is a tourist (and he chose to tell you a lie). Warm-up 3. While visiting the Knights and Liars Island, you (a tourist) come to a party. Every single person at this party states that there is at least one Liar at the party. How many Knights, Liars, and tourists are at this party? Warm-up 3 Discussion. Can there be a Liar at this party? No, since a Liar cannot tell the truth. Thus, this is a party of Knights and tourists. How many Knights could possibly be there? Everyone states that there is at least one Liar in the room. But we already know that there are none! A Knight cannot lie; therefore, there must be no Knights. Thus, this is the party of tourists.

2.2. Discussion of the Day: Problem-Solving Strategies One of the primary goals of the Year 1 circle was to instill in children the idea that “to solve a problem” means to deduce an answer rather than to guess it. The students have also learned that “to present a solution” does not stand for “to give an answer”. Instead, it means to explain the solution in a clear and logical way, stating all the assumptions and conclusions and presenting all the steps. Also, during the entire year, we worked hard on developing a culture of logical reasoning and creative problem solving. The goals of this session are to illustrate these ideas to the newcomers and at the same time to keep the returning students interested and busy. Therefore, for the rest of the session, we will be working through problems that demonstrate various problem-solving approaches. 2.2. Problem-Solving Strategies 21

For Teachers: Present the problems one by one on the board. Encour- age the students to generate ideas for solutions. Sum up the ideas and round up the discussion of each problem by presenting the complete solution. Also, remember that the students come from very different math backgrounds. Try to get input from everybody, and make sure that everyone understands all the steps of the solutions.

We start with a core topic from last year, parity (the property of a number to be odd or even). Parity is a very simple idea; however, it generates a variety of cool problem-solving techniques. Problem 1. A row of 20 zapberry bushes grows in Ella’s garden. Every bush has either 1 more or 1 fewer berry than the bush to the left of it. Before leaving for a party, Ella’s stepmother ordered her to count all the berries on all the bushes. Friendly mice, who wanted to help Ella, counted the berries for her: their total was 99. Should Ella trust the mice or would it be better to go and count the berries herself? Problem 1 Discussion. The numbers of berries on any two bushes next to each other differ by 1; thus, they must have different parity. So, the bushes with odd and even numbers of berries alternate. It follows that 10 bushes have even numbers of berries on them, and 10—odd. A sum of 10 even numbers and 10 odd numbers must be an even number. Therefore, the total number of berries can never be equal to the odd number 99.

For Teachers: A typical incorrect solution would be to present 20 numbers that add up to a number that is close to 99 (98 or 100, for example). Next, a student would claim that she cannot get any closer: modifying her combination of numbers generates a total that is even farther from 99. However, several failed examples do not prove that something is impossible.

Problem 2. Martian men have 3 heads and 11 legs, Martian women have 7 heads and 5 legs, and Martian babies have 1 head and 3 legs. A group of Martians are dancing around a spaceship. Can they have 1,001 heads and 1,000 legs altogether? Problem 2 Discussion. The problem uses the fact that the sum of an odd number of odd numbers is always odd. Notice that each Martian (a man, a woman, a baby) has an odd number of heads and an odd number of legs. Now let’s prove that the total number of heads and the total number of legs in any group of Martians should have the same parity. Indeed, if the total number of Martians were even, then both the total number of heads and the total number of legs would be even (the sum of an even number of odds). For the same reason, if the total number of Martians were odd, then both the total number of heads and the total number of legs 22 Session 2: Review: Math Logic and Other Problem-Solving Strategies would have also been odd. However, 1,001 and 1,000 are of different parity, so they cannot stand for the number of heads and the number of legs. In all the problems we have discussed so far, we argued that a specific example cannot prove a general case; therefore, such an example does not constitute a solution. So, can a specific example ever prove a problem? Yes, sometimes it can. Take a look at these two problems: Problem 3. Nathaniel states that (3, 5), (5, 7), (11, 13), and (17, 19) are the only pairs of prime numbers that differ by 2. Is he correct? Problem 3 Discussion. The example (29, 31) proves that Nathaniel is not right.

An example that disproves a statement is called a counterexample . In the problem about Nathaniel, we came up with a counterexample that proved him wrong.

Problem 4. The numbers a and b are such that a = b +1.Cana4 be equal to b4? Problem 4 Discussion. Yes, it could happen. Example: a = −0.5 and b =0.5. The previous problems demonstrate that sometimes an example solves a problem and sometimes it doesn’t. How could one know if a specific example would work as a solution? Full understanding comes with practice. However, keep in mind that: - If you want to disprove a general rule, you can do it by finding one specific counterexample. - Also, if you want to show that something exists, you can prove it by presenting an example. - However, suppose that you want to show that something is true in general, for all elements. Then testing on specific elements would not prove the claim. You should employ a proof instead. Next, let’s take a look at several problems that require both an example and a proof for a complete solution. Problem 4 Discussion. A box contains 5 red and 7 blue pencils. What is the smallest number of pencils one should take from this box, without looking, in such a way as to definitely end up with at least 2 red and 3 blue pencils? Problem 4 Discussion. The answer to this problem is “9 pencils”. To justify it, we should prove that we cannot go smaller than 9 and that 9 is always sufficient. - An example demonstrates that we cannot go smaller than 9. Indeed, with 8 pencils, we may end up with 7 blue and 1 red. Therefore, it is necessary to have at least 9 pencils. 2.3. Take-Home Problem Set 23

- Next, we should prove that the answer 9 works. If fewer than 2 pencils out of 9 happen to be red, then more than 7 pencils must be blue, which is impossible. Also, if fewer than 3 pencils happen to be blue, then more than 6 pencils must be red, which is impossible as well. Finally, it is time for independent problem solving.

2.3. Take-Home Problem Set Problem 1. Connect points A and B with a path made of 4 segments so that: - all 4 segments have the same length, - neighboring segments are not collinear, - each segment starts and ends at a marked point but does not pass through any other marked point. A

B

Problem 2. The company “Wheeler Dealer” has a board of directors that consists of the CEO and 3 vice presidents. The board meets once a month and votes on new salaries for all board members. The list of salaries is prepared by the CEO, who herself does not vote. Each vice president is greedy and votes for the proposal only if his or her own salary goes up. The new list of salaries is approved only if the majority votes for it. Is it possible for the CEO to come up with a way to grow her salary 10 times in one year, while the vice president’s salaries would become 10 times smaller? Problem 3. A grasshopper jumps along the road, right or left. He jumps 1 inch, then he jumps 2 inches, and so forth; his last jump was 10 inches long. Could the grasshopper, after making these 10 jumps, land exactly where he started? Problem 4. Karin is pretty sure that if an area of one rectangle is smaller than the area of another one and if the perimeter of the first one is smaller than the perimeter of the second one, then the first one would definitely fit into the second one. Is she right? Problem 5. There are 10 red, 8 blue, 8 green, and 4 yellow pencils in a box. (a) What is the biggest number of pencils you could take, without looking, so that you leave at least 6 blue pencils? 24 Session 2: Review: Math Logic and Other Problem-Solving Strategies

(b) What is the biggest number of pencils you could take, without looking, so that you leave at least 1 pencil of each color? (c) What is the smallest number of pencils you could take, without looking, so that you leave not more than 6 blue pencils? Problem 6. Fred Allstar’s car is equipped with a high-precision cruise control. Fred was driving his car at 55 mph when he resolved to test it. He decided that he would change his speed by 1 mph after each minute, either accelerating or slowing down. Can Fred come to a complete stop after 100 minutes of driving in this fashion? Problem 7. A policeman lives in the corner house of a town. (See the town map below.) Every night he has to patrol the streets of his hometown. The policeman wants to plan his patrol route so that he walks every street (maybe more than once) and returns home. What is the length of the shortest possible route?

Problem 8. There are 8 jars of strawberry jam, 7 jars of apricot jam, and 5 jars of sour cherry jam in the pantry. What is the biggest number of jars you could take, without looking, in such a way as to leave at least 4 jars of jam of one kind and at least 3 jars of another kind? Problem 9. Six monks entered a temple leaving their shoes by the doors. (The shoe sizes of all monks were different.) The monks were leaving the temple one by one, at night. Some of them, instead of putting their own shoes on, were putting bigger shoes on. What was the greatest possible number of monks that had to leave barefoot? (A monk would leave barefoot if all the shoes that are left are too small.) Session 3: Invariants

The concept of a proof is a cornerstone of mathematics, and we spend a lot of time in this class learning how to explain and how to prove. However, newbies could be surprised by such a strong emphasis on proofs in a math circle. Indeed, it is not how children are used to thinking about mathematics; at school, they spend more time working with numbers and formulas than reasoning about problems. Also, children often lack the skills required to explain their solutions with enough mathematical rigor. Sometimes kids expect a mathematical circle to be all about fun: challenging puzzles, logic problems, and similar stuff. Today’s lesson serves a double purpose. First, we will try to show how valuable the ability to prove can be: we will present several examples from human history that illustrate how much of a difference a proof can make. Next, we will introduce, explain, and practice an important proofing strategy, which is called invariant. Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - Printouts of the gaming board and 6 tokens for Problem 4 (The Candy Challenge) on page 30 (one set per two students; optional).

3.1. Warm-up Discussion. Are Proofs Really Necessary? As you may have already noticed, we spend a lot of math circle time learning how to explain and justify solutions and talking about proofs. Quite often, we try to prove facts that seem to have no practical value. For example, a lot of our problems are (and will be) about proving that it is not possible to do something. Why should we spend our valuable time on these proofs? Wouldn’t it be more useful to learn a new formula or a computational trick? The thing to remember is that the ability to prove and justify results is vital for a real scientist. Let me give you several real-life examples. You have probably heard of the term “perpetual motion ma- chine”. A perpetual motion machine is a machine that works forever and

25 26 Session 3: Invariants does not use any external energy—not from the sun, the wind, or a chemical reaction. For many centuries, great minds and common minds alike have been preoccupied with the idea of perpetual motion. For example, Leonardo Da Vinci worked on a perpetual motion machine and left us several drawings with designs of it. A lot of people spent a good chunk of their lives trying to create the device, believing that they are almost there. Proposals for perpetual motion machines became so common that the United States Patent and Trademark Office refused to grant patents without a working model of such a machine. However, no one has been able to come up with such a model so far. Now, the question is why aren’t scientists and inventors of our time obsessed with perpetual motion? The answer is that the scientific community has come up with a proof that such a machine is impossible. There is a scientific consensus that perpetual motion would violate the conservation of energy laws. (These laws were established in the late 19th century after years of painstaking research and experimentation.) When scientists received a definite proof that such a machine is impossible, they dropped efforts to create it. Another example is the alchemist’s quest for gold. For hundreds, even thousands, of years, alchemists tried to discover a way to convert lead, copper, and other base metals to gold. Why don’t modern chemists occupy themselves with this problem? The simple answer is that they came up with a proof that while such conversion is possible, it is absolutely not profitable. These days, scientists know that atoms of one element can be changed into atoms of another element through nuclear reactions. Indeed, nuclear physicists have successfully transformed lead into gold, but the procedure itself is so expensive that the result is not worth it. Next, let’s talk about cryptography, the science of converting infor- mation into a secret form (encryption) and restoring this information back into its original form (decryption). These days, cryptography is everywhere. All significant online computer transactions are encrypted. For most encryp- tions, we use a new generation of cryptographic algorithms that scientists believe to be very secure. This belief is based on the way the encryption process is organized and on one important mathematical assumption related to prime numbers. To decrypt a secret message, an intruder needs to start by getting this message’s secret key. To obtain this key, a certain very big number should be broken into a product of two primes. How long can this take? Believe it or not—for a number that is big enough, it may take VERY long. For example, it will take years and years for a modern computer to find prime factors of a 300-digit number. The reason is that no efficient algorithms are known for factoring big numbers. Therefore, the only efficient way for a spy or an intruder to learn a secret key is to keep guessing until he finds the right key, which can take ages. 3.1. Warm-up Discussion. Are Proofs Really Necessary? 27

Already, you might see a weak spot; what will happen to all this security if someone discovers an efficient algorithm for breaking big numbers into primes? Mathematicians believe that such an algorithm cannot be found. However, this fact has not been proven yet. If someone were able to prove it, a lot of people and countries would sleep better at night knowing that their secrets are well protected.

Why should we look for all possible answers? Suppose that you’ve been solving a word problem and you’ve found the answer to it. You proudly present it to your math circle teacher, and you get a reply: “Yes, this answer is correct. However, can you convince me that no other answers are possible?” You are disappointed—why would one need such a justification? Let’s come up with an example that explains the importance of getting all possible answers. Let’s talk about bridges and ways to collapse them. Do you know why soldiers break step when crossing a bridge? Because a bridge can easily be collapsed due to the effects of resonance. What is resonance? Mechanical structures, although they appear to be unmovable, have a natural frequency or set of frequencies at which they vibrate. If a force (wind, for example) is applied to the structure with the same frequency, then the vibration will amplify. This amplified vibration, called resonance, can cause a structure to collapse. How is this fact related to the number of solutions? A structure such as a bridge may have several natural frequencies of vibration in it. When engineers are designing a bridge, they need to compensate for possible effects of vibration on all these frequencies. How does one calculate these frequen- cies? The physical behavior of a structure can be described by a complex system of equations. Each solution of such an equation defines a vibration frequency. Therefore, to make sure that all collapse scenarios are prevented, it is indeed crucial to be able to find all solutions.

For Teachers: Alchemy, gold, cryptography, and spies are all very exciting topics for children. Expect your students to try to steer you into long sideways discussions. Stay focused, and try to stick to your 10-minutes warm-up time limit.

For Teachers: The idea illustrated in the “bridges” example is not totally aligned with today’s topic. Also, if all 4 examples are presented in a single lesson, you would probably run out of time. Therefore, while the examples are grouped together in the book, it is better to postpone the last one until another warm-up. 28 Session 3: Invariants

3.2. Discussion of the Day: Invariants In the examples that we just presented, the discussion was over after sci- entists were able to prove that something is impossible. However, proving impossibility could be difficult. For example, it took many hundreds of years to show that a perpetual motion machine is an impossible thing. The good news is that mathematicians came up with a lot of clever techniques that could help us prove that something is not possible to achieve. For example, we started this school year by discussing a bunch of problems about routes in a castle. In these problems, we wanted to prove that a certain route was impossible, and we did it by discovering a property that holds true for all possible routes—the colors of the first and last rooms had to be the same. However, for the route that we were seeking, the colors of the first and last rooms had to be different. So, we concluded that such a route cannot be found. Identifying a quantity or property that remains unchanged is a very powerful problem-solving technique: such a property is called an invariant. We already touched on invariants in Session 1. Invariants could help us crack really tough problems. For the rest of the lesson, we will be discussing problems illustrating different types of invariants.

For Teachers: You could ask your students to come up with examples of invariant problems from Year 1. One such easy-to-remember example is the problem about overturned cups. We had 7 cups, 6 of them facing up and 1 down. We were allowed to flip 2 cups at a time (up-up to down-down, down-down to up-up, or up-down to down-up). Our goal was to prove that is not possible to get all 7 cups facing up by repeating these operations. In this problem, we were able to find the invariant: the parity of face-up cups does not change. Thus, we reasoned that it is impossible to start with 6 cups facing up and end with 7.

Problem 1. Numbers from 1 to 15 are written on a board. Two players, Rosie and Olivia, are taking turns. On a single turn, a player erases two numbers of her choice and replaces them by their sum. They play until one number is left on the board. Rosie wins if this number is odd; Olivia wins if it is even. Rosie makes the first turn. Which of the two players has the winning strategy?

Problem 1 Discussion. Playing the game several times, we observe that the number left on the board by the end of the game is always the same—it is the number 120. Thus, the game seems to be unfair for Rosie, because Olivia 3.2. Invariants 29 always wins. To prove this, let’s observe that this game has an invariant: the total sum of all the numbers on the board remains unchanged. Indeed, when we replace a pair of numbers by their sum, the total sum does not change. Since the sum of the original set was 120, the last number standing has to be 120 as well. Problem 2. In every cell of a 2 × 2 table, there sits an animal: a rabbit or a frog. On a single turn, we can replace all animals in a single row or a column: each rabbit becomes a frog, and each frog becomes a rabbit. Initially, a rabbit is sitting in the top left corner cell, and frogs occupy the rest of the cells. Can we end up with a table that is all filled with rabbits?

Problem 2 Discussion. It is easy to spot the invariant: the parity of the total number of rabbits remains unchanged. The table below proves this claim: number of rabbits number of rabbits change in the in a row/column after transformation total number of rabbits 1 1 0 0 2 +2 2 0 -2 Since we start with an odd number of rabbits, we could never end up with an even number. Problem 3. Now, the animals sit in a 3 × 3 table; can we get from a table with a single rabbit and many frogs to a table with all rabbits and no frogs?

Problem 3 Discussion. This problem seems to be more challenging. In- deed, the original invariant does not work: the parity of the number of rabbits in the table is no longer constant. For example, if we transform the animals in the topmost row, the total number of rabbits goes up by 1. However, no matter how hard we try, we are still unable to get rid of all the frogs. 30 Session 3: Invariants

The trick is to use the result of the previous problem. Let’s concentrate on the top left 2 × 2 subtable of the original table. The animals in this 2 × 2 subtable are transformed the same way as in the previous problem. Therefore, whatever we do, this 2 × 2 subtable will always contain at least one frog. Therefore, the entire table will always contain a frog.

Problem 4. A circle is divided by 3 diameters into 6 sections, and a piece of candy is placed into each section. (See the picture.) On a single turn, a player can choose any 2 candies and move each of these candies into one of the adjacent sections. The player who manages to get all the candies into the same section wins the game and gets the candies. Who has the winning strategy: the first player or the second one?

For Teachers: It would be a good idea to present this problem as a hands-on activity by printing pictures of a circle and bringing enough tokens for everyone to be able to play.

Problem 4 Discussion. After several attempts, it becomes apparent that neither player can win: it is impossible to move all the candies into one sector. To help prove this fact, let’s color the sectors in two alternating colors:

Now we can observe a pattern: the parity of the total number of candies in the same-color sectors does not change; it remains odd.Ifwecouldprove this fact, we would have an invariant for this problem! To come up with a proof, let’s observe that whenever a piece of candy is moved to an adjacent sector, it always changes color. Thus, if a player chooses to move 2 pieces that are located on different colors, then these 3.2. Invariants 31 pieces switch colors. So, the total number on each color does not change. If she moves 2 pieces that are located on the same color, the total on this color goes down by 2, and the total on the other color goes up by 2. Therefore, the parity on each color does not change either! Since the game starts with an odd number of pieces of candy on each color, we can never end up with 6 pieces on the same color.

Problem 5. The countries of Dillia and Dallia share a border. Whenever you cross the border to Dallia, you can exchange dillers (Dillia coins) to dallers (Dallia coins) at the rate of 3 dallers for 1 diller. Whenever you cross the border from Dallia to Dillia, you can exchange dallers to dillers at the rate of 3 dillers for 1 daller. You can cross the border as many times as you like, and you are free to choose how much money to exchange. Suppose that you are in Dallia and you have 1 daller in your pocket. Show that you will never end up with the same number of dallers and dillers.

Problem 5 Discussion. How can we prove this problem? Listing several possible sequences of exchanges does not work since there are infinitely many of them. For example, we may decide to start exchanging money like this: dillers 0 3 0 27 0 6 5 ... dallers 1 0 9 0 81 79 82 ... or like this: dillers 0 3 2 5 3 6 4 ... dallers 1 0 3 2 8 7 13 ... These examples do not constitute a proof; however, they allow us to observe something important about this problem: the total amount of money after any exchange remains odd! If we prove this observation, the problem will be solved! That is because having the same number of dillers and dallers means that the total number of coins is even, not odd! And the good news is that this observation is easy to prove: - We start with an odd number of coins, one. - If we choose to exchange an even number of coins, the total changes by an even number. (We give an even number of coins, and we get back an even number of coins.) - If we choose to exchange an odd number of coins, the total changes by an even number as well. (We give an odd number of coins, and we get back an odd number of coins.) Thus, we have the proof: whatever we do, the parity of the total number of coins remains odd. Thus, the number of Dillia and Dallia coins can never be the same.

We presented plenty of examples that illustrate how handy invariants are. Now, it’s problem-solving time. 32 Session 3: Invariants

3.3. Take-Home Problem Set Problem 1. Youhave3boxesofchocolates.Thefirstboxhas6chocolates less than the second and the third together, and the second box has 10 less than the first and the third together. How many chocolates are there in the third box? Problem 2. You start with 3 piles of candy, with 2, 3, and 4 pieces. In a single turn, you can choose 2 piles and then add 1 piece of candy to both. By repeating this operation a number of times, could you end up with 3 piles that contain 200, 300, and 400 pieces of candy? Problem 3. A broken calculator can only do several operations: multiply by 2, divide by 2, multiply by 3, divide by 3, multiply by 5, and divide by 5. Using this calculator any number of times, could you start with the number 12 and end up with 49? Problem 4. The numbers 1 through 12 are written on a board. You can erase any 2 of these numbers (call them a and b) and replace them with the number a + b − 1. After 11 such operations, there will be just 1 number left. What could this number be? Problem 5. There are 6 trees growing along Park Lane, and a bird is sitting in each of them. Every time a car passes, exactly 2 birds fly up and go to the next tree in either direction. Can all birds gather in the same tree? Problem 6. If a magician puts 1 dove into his hat, he pulls out 2 rabbits and 2 flowers from it. If the magician puts 1 rabbit in, he pulls out 2 flowers and 2 doves. If he puts 1 flower in, he pulls out 1 rabbit and 3 doves. The magician starts with 1 rabbit. Could he end up with the same number of rabbits, doves, and flowers after performing his hat trick several times? Problem 7. Two identical cups—one filled with coffee and another with milk—have been placed on the table. You take a spoonful of milk from the milk cup and put it into the coffee cup. Next, you take a spoonful of the mixture from the coffee cup and put it into the milk cup. Do you have more milk in the coffee cup now or more coffee in the milk cup? Session 4: Proof by Contradiction

Today, we will present, explain and practice a very important type of proof that keeps coming up in our problems and discussions—proof by contradic- tion.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

4.1. Math Warm-up Warm-up 1. A golden ring is hidden in one of the three boxes, the two others boxes are empty. Each box has an inscription. It is known that either all three inscriptions are false or exactly one of them is true. Can you point out the box with the ring in it without opening any of them?

The ring is in The ring is not The ring is not in this box in this box the leftmost box

Warm-up 2. At least one inscription is true and at least one is false. Can you point out the box with the ring in it without opening any of them?

The ring is not in The ring is not The ring is in the center box in this box this box

4.2. Discussion of the Day: Proof by Contradiction People like to use the word “proof” in their conversations. However, quite often they do not think about the meaning of this word. For example, a lawyer may say that he proved that his defendant is not guilty. Does this really mean that he proved it? Not necessarily. Most likely, the lawyer merely convinced the jury of his client’s innocence using his public speaking and debating skills.

33 34 Session 4: Proof by Contradiction

So, what constitutes a proof? Early on, ancient Greeks started to explore the difference between a rigorous proof and plausible reasoning. Since this time, the concept of a scientific proof has been widely studied. Mathematicians of the past worked hard exploring the nature of proofs, and a range of proof techniques has been developed over the centuries. Today, we are going to introduce one important proving method which is called proof by contradiction. Problem 1. Is there a largest odd integer? Problem 1 Discussion. Let’s assume that this largest odd integer actually exists. What would happen if we add 2 to this integer? We would get another odd integer that is larger than the original one. Thus, we have a contradiction: we assumed that the largest odd number exists, and we immediately found an odd number that is even bigger. Therefore, our original assumption is incorrect.

Why did we present this simple problem here? Not because of the problem itself, but because of the approach we used to prove it.

Proof by Contradiction: We start by assuming that some fact or statement is true. Next, we demonstrate that the consequences of this assumption lead to inconsistency. Therefore, we can conclude that the original assumption is incorrect. This approach of thinking about a problem is called “proof by contradiction”.

Such a model of reasoning is both natural and rigorous at the same time. We often employ it in our conversations, especially when we are engaged in a debate. Suppose that you overheard a child reasoning along the following lines: “If it were I who ate all those chocolates yesterday, I would be sick today. However, I am OK. That means I did not eat them!” Believe it or not, the child is using proof by contradiction to argue her innocence. In philosophy, this type of proof goes by an impressive Latin name: reduction to absurdity. In mathematics and technical sciences, proof by contradiction works as a powerful weapon that allows us to arrive at a lot of impressive results. Let’s move on by working our way through a collection of “proof by contradiction” problems. Problem 2. Together, 5 soccer players together scored 14 goals, with every player scoring at least 1. Prove that at least 2 of them scored the same number of goals. Problem 2 Discussion. The primary challenge of this problem is to come up with a clear explanation of the solution. Children tend to come up with solutions like: “If the first player scored 1 goal, the second player scored 2, 4.2. Proof by Contradiction 35 and so on, then the total number of goals would be 15, which is more than 14. Problem solved.” What’s wrong with this approach? The main objection is that this statement deals with a specific scenario: 1 goal by the first player, 2 by the second, and so on. What if no one scored exactly 1 goal, or the third player scored 7? We cannot use one case to prove the entire problem. Thus, while the problem seems to be easy, the solution eludes us. However, proof by contradiction provides a simple framework for a proof. Let’s start by assuming that no two players scored the same number of goals. If we order the players by their scores, then the first player scored at least 1, the second—at least 2, the third—at least 3, the fourth one—at least 4, and the fifth one—at least 5. (Note that we never claim that a player achieved some specific score: we always use the word “at least”.) The players altogether scored at least 1+2+3+4+5=15. However, the total score is 14. This contradiction proves that there must have been at least two players with the same score.

Problem 3. One hundred witches are seated at a round table, evenly spaced. More than half of them are evil; the rest are good. Every evil witch is about to put a curse on the person sitting directly across from her. Prove that there is a pair of evil witches at this table who will end up cursing each other.

Problem 3 Discussion. The challenge in this problem comes from the fact that we cannot assume that the witches sit around the table in some specific way. For example, we cannot claim that all evil witches are grouped together or that good and evil witches alternate. Even the exact number of evil witches is not known. Instead, we have to prove that no matter which way everyone is seated, there will be a pair of evil witches sitting directly across from each other. To the contrary, let’s assume that no two evil witches are facing each other. In this case, there is at most one evilwitchineachpairof witches facing each other. Thus, since the total number of pairs is 50, the number of evil witches should be at most 50. However, this contradicts the fact that more than half of the witches are evil. Therefore, the assumption that no two evil witches are facing each other is incorrect. Hurray, our “proof by contradiction” approach worked!

Problem 4. The parliament of a certain country is formed by represen- tatives from 8 provinces. Fifty of these parliamentarians decide to form a committee. Prove that this committee will include 8 people from the same province or people from all 8 provinces.

Problem 4 Discussion. To the contrary, assume that we were able to find a group of 50 parliamentarians such that no more than 7 people are from the same province and at least 1 province is not represented. 36 Session 4: Proof by Contradiction

Then, since 1 province is not there, at most 7 provinces are included. At the same time, each province is represented by at most 7 parliamentarians. So, there should be no more than 7 × 7=49reps altogether. This conclu- sion contradicts the fact that the group has 50 people. Therefore, such a committee cannot be formed. Problem 5. Each node of a square grid is colored either black or white. Prove that it is possible to find 3 nodes of the same color that are located at the vertices of a right triangle. Problem 5 Discussion. Another proof by contradiction is in order here. Assume that a right triangle with vertices of the same color cannot be found. Let’s choose three nodes on the grid that form a right triangle with 2 legs of length 2. (See the picture.)

Since the vertices of this triangle cannot be of the same color, 2 of them must be of 1 color, and 1—of another. Suppose that 2 nodes are black and 1 is white. Let’s orient the grid in such a way that the line connecting the 2 black nodes will be horizontal.

Now, let’s concentrate on the 3 nodes marked with diamonds. Each of them, taken together with the 2 black nodes, forms a right triangle. Therefore, neither of these “diamond” nodes can be black. This means that all of them are white. However, these 3 nodes form another right triangle. Therefore, we found a right triangle with all nodes of the same color. We will conclude this lesson with the problem that answers one very important question: how many prime numbers are there in the world? Is the number of primes finite or infinite? While most of the students know the answer, they do not know how to prove it. Let’s use proof by contradiction to demonstrate that the number of primes is infinite. (This problem is quite difficult. If your students are not ready for hard proofs, you may decide to postpone it for the next year. However, it is such a beautiful example of a proof by contradiction that it would be a pity to leave it out.) Problem 6. Prove that there are infinitely many prime numbers. Problem 6 Discussion. First, we will outline the main idea of the proof. We will assume that the number of primes is finite. Since it is finite, it will be 4.3. Take-Home Problem Set 37 possible to find the prime number that is the biggest of them all. However, after that, we will demonstrate how to construct an even bigger number that is prime as well. This way, we will disprove the assumption that the number of primes is finite. Now, let’s present the detailed proof. If the number of primes is finite, then we can list them all: P1,P2, ..., PN . In this sequence, each symbol stands for a corresponding prime number: P1 stands for the first prime (which is equal to 2), P2 for the second prime (which is 3), P3 for the third prime, and so on. The symbol PN stands for the largest prime number. Let’s start constructing a prime number that is even bigger than PN . First, take a look at the number that is equal to the product of all these primes: M = P1 × P2 × P3 ×···×PN . The number M is a very special number: it is divisible by each and every prime number in the world, and it is much bigger than any of them. Next, let’s take a look at the number M +1=P1 × P2 × P3 ×···×PN +1. Can this number be divisible by P1? No, it cannot, as it is 1 bigger than a multiple of P1. Can this number be divisible by P2? No, it cannot, as it is 1 bigger than a multiple of P2. Similarly, it cannot be divisible by any prime number since it is 1 bigger than a multiple of each. Therefore, this number itself must be prime. Moreover, this number is way larger than the largest prime number we know about. Thus, our mission is accomplished: we assumed that the largest prime number exists, and we were able to construct a prime number that is bigger. Therefore, the largest prime number cannot be found, and the number of primes is infinite.

4.3. Take-Home Problem Set Problem 1. Recently, 10 rich guys from Seattle married 10 rich girls from Portland. The total net worth of each new family was 10 million dollars. Prove that if the girls’ total worth was less than 70 million, then the guys’ total worth was at least 30 million.

Problem 2. Twenty-five extraterrestrials from 8 different planets came to the Intergalactic Congress. Prove that at least 4 of them are from the same planet.

Problem 3. There are 5 magicians standing in a row. Altogether, these 5 magicians know 300 different powerful spells. Prove that there are 2 magicians next to each other who, combined, know at least 100 powerful spells.

Problem 4. Romeo and Juliet quarreled. Juliet started walking east, and Romeo—west. In 4 minutes, Romeo turned back and started running after Juliet. In 2 minutes, he reaches the spot where they parted. If Romeo runs 38 Session 4: Proof by Contradiction

3 times as fast as Juliet walks, how long will it take him to reach Juliet from themomentheturnedback? Problem 5. A 5×9 rectangle is cut into 10 smaller rectangles. (All cuts follow grid lines.) (a) Prove that at least 2 of these rectangles have the same area. (b) Prove that at least 2 of these rectangles are congruent. Problem 6. There are 31 gnomes, 31 elves, and 30 humans standing side by side in line. It is known that no elf stands next to a gnome. Prove that at least 3 gnomes or at least 3 elves are standing next to each other. Problem 7. The game of Trick-a-Troll is played with 10 players and a deck of 20 cards: 2 through 10 and an ace of spades, and 2 through 10 and an ace of clubs. Each player gets 1 club and 1 spade and adds his cards (aces count as 1). Prove that there will be at least 2 players with sums that end in the same digit.

Problem 8. Each square of an infinite grid is occupied by one of four creatures: a frog, a bunny, a hamster, or a mouse. It is known that every 2 × 2 square contains all four creatures. Prove that is it possible to choose a row or a column that contains just two types of creatures. Session 5: Decimal Number System and Problems on Digits

Today we will be focusing on the organization of our numeral system and the decimal representation of numbers. Some of the key notions that we will be exploring are the structure of numbers, the concept of place-value, and the relationship between numbers and the numerals that represent them. Some students may already have a formal understanding of the topic. Here we will try to give them a deeper, more intuitive feel. Problems that deal with decimal representations occupy an intermediate position between number puzzles and elementary number theory. They can be solved using relatively simple methods, but they also have high educational value. Gaining an understanding of the decimal system provides us with a path toward understanding other number systems as well.

Teaching supplies for this session: - Printouts of the in-class problem set (one per student). - Printouts of the take-home problem set (one per student).

5.1. Warm-up Discussion. Egyptian Number System Today’s warm-up is determined by the topic of the day—we will be talking about the history of numeration systems. Specifically, we will concentrate on Egyptian numbers.1 We will be discussing the Egyptian number system and its similarities to and differences from the decimal number system. We will use this example to highlight some of the important properties of our numeration system that make it so convenient and universal. The ancient Egyptians used the number system that was based on a scale of tens; they had special symbols for 1, 10, and each consecutive power of ten

1This warm-up uses materials from the Wichita State University History of Math Project [31].

39 40 Session 5: Decimal Number System and Problems on Digits up to one million. Take a look at the table below—it contains these symbols and their descriptions. Decimal Egyptian Meaning of Number Symbol This Symbol 1= staff

10= heel bone

100= coil of rope

1,000= lotus flower

10,000= pointing finger

100,000= tadpole astonished 1,000,000== man To make up a number, Egyptians would combine these symbols so that the total value of the symbols would be equal to such a number. For example, a single line (a staff, the symbol for one) would mean one; three lines would mean 3; seven lines would mean 7, and so on. To write the number 10, they would use the symbol for ten (a heel bone). To write the number 436, they would combine 4 symbols for a hundred, 3 symbols for ten, and 6 ones (see below).

Egyptian numeral for 436

Egyptians had several rules on how to position symbols that make up a number. First, they grouped identical symbols together (ones to ones, tens to tens, and so on). Also, they arranged these identical symbols into patterns that would be easy to recognize. Take a look at the table below, and just try to imagine how much more difficult it would have been to distinguish between the numbers 8 and 9 if each was represented by a single row of lines.

one two three four five six seven eight nine

It was common to write numbers from right to left, starting from the highest power of 10, as we did for the number 436 above. However, it was totally acceptable to arrange symbols differently. For example, on tomb 5.2. Problems on Digits 41 inscriptions, it was traditional to write from top to bottom. In the picture below, both drawings stand for the same number: 77.

We can see that, in Egyptian numeration, the order and the position of symbols do not matter much. Indeed, the sum of the symbols remains the same whichever way the symbols are positioned. Systems like this are called additive. It is interesting and educational to compare our number system and the Egyptian number system: which one is easier to learn? Which one is more efficient? Which number system would you choose for doing addition? How about multiplication? Division?

5.2. Discussion of the Day: Problems on Digits Our number system (Hindu-Arabic) is called decimal.Thereisareasonfor this: we count in increments of 10, and decem means 10 in Latin. Probably the most important feature of our system is that position matters:weuse position to indicate the meaning of a digit. The rightmost position (the first one) means ones, the second from the right means tens, the next—hundreds, and so on. Each position is 10 times bigger than the one to the right of it. For example, the numeral2 32 represents 3 × 10 + 2 × 1, and the numeral 23 represents 2 × 10 + 3 × 1. The fact that the place of each digit is important makes a big difference from most of the earlier number systems: Egyptian, Roman, Greek, and others. Because of that, we are able to express any number, nomatterhowlarge,using10symbolsonly: 0,1,2,...,9. Numbersys- tems like ours, where position matters, are called positional number systems.

These days, positional systems are everywhere: beyond the decimal system, we extensively use binary, hexadecimal, and octal systems—these three number systems are popular in computer science. Also, there were periods in the history of humankind when we counted in increments of 12.

2The difference between the terms number, numeral, and digit can be confusing. A number indicates an abstract value. A numeral is a symbol that stands for a number. For example, the same number five can be written as a Roman numeral or Egyptian numeral or decimal. A digit is a single symbol used to make numerals. For example, in the decimal system, we have ten digits: 0, 1, ..., 9. 42 Session 5: Decimal Number System and Problems on Digits

(As relics from this period, we have words like “dozen”, 12 hours on a clock, and 12 inches in a foot.) This knowledge of how our numeral system is organized comes in handy for solving a wide variety of problems.

Problem 1. Replace letters with digits to maximize the expression NO + MORE + MATH. (The same letters stand for the same digits; different letters stand for different digits.) Problem 1 Discussion. Let’s write a decimal representation of each of the addends: NO + MORE + MATH =10× N +1× O +1,000 × M + 100 × O + 10 × R +1× E +1,000 × M + 100 × A +10× T +1× H. Regrouping and taking out the common factors, we get: 1,000 × (M + M) + 100 × (O + A)+10× (N + R + T )+1× (E + O + H). It is already intuitively clear that M should be set to 9. However, let’s run another round of refactoring that would justify this assumption. Combining together some of the coefficients, we get this expression: 2,000 × M + 101 × A + 100 × O +10× (N + R + T )+1× (E + H). Now, it is easy to see that the factor 2,000 is the biggest. Therefore, to maximize the expression, M should be set to 9, the greatest possible value. The factor 101 is the second largest; therefore, A should be set to 8. Next, O should be set to 7. Digits N, R,andT are all multiplied by the same factor, 10. Therefore, they should be set to 6, 5, and 4 in any order. Finally, E and H shouldbesetto3and2inanyorder. Thus, the maximum value of the expression is 2,000 × 9 + 101 × 8 + 100 × 7+10× (6 + 5 + 4) + 1 × (3 + 2) = 19,663.

Next, let’s spend some time exploring what happens to the value of a number when a digit is added to it. Question 1. What happens to the value of an integer number if the digit 0 is added to the right of it? This question is easy to answer: the number becomes 10 times bigger. Thus, if the original number were equal to x, the modified number would be equal to 10 × x. Question 2. What happens to a positive integer if the digit 1 is added to the right of it? The number becomes 10 times bigger AND bigger by 1. Thus, if the original number were equal to x, the modified number would be equal to 10x +1. (This answer is easy to extend to any other digit. If we add 7, for example, the number becomes 10x +7.) 5.2. Problems on Digits 43

Question 3. What happens to a positive integer number if the digit 1 is added to the left of it? The answer is not that easy—it depends on the size (order of magnitude) of the original number. A two-digit number will grow by 100; a three-digit number will grow by 1,000; and so on.

These simple exercises illustrate how modifications to the digits of a number can be described using equations. They give us a starting point for working on more challenging problems.

Problem 2. Adding 0 at the end of a number makes the new number greater by 252. What is the original number?

Problem 2 Discussion. We are going to demonstrate two different ap- proaches for solving this problem. The first solution uses equations. If the original number is x, then the new number is 10 × x. Since the new number is 252 bigger than the original one, we get the equation: 10x = x + 252. Simplifying this, we get 9x = 252; x =28. The second solution demonstrates a more constructive approach: we will use the column addition algorithm to reconstruct the number digit by digit. How do we get started? Since we do not know how big the number is, let’s express it as ...dcba. (The letters stand for the digits of the number. The dots on the left indicate that we do not know where to stop.) Using column addition, we can rewrite the problem as follows: ...dcba + 252 ...dcba0

Looking at the ones column, we observe that a+2 ends with 0. Therefore, a must be equal to 8. Replacing a by 8 both in the addend and in the sum, we get the modified expression. (The picture below illustrates this approach: in the second expression, the digit a has been replaced by 8.) ...dcba ...dcb8 ...dc28 ...d028 + 252 + 252 + 252 + 252 ...dcba0 ...dcb80 ...dc280 ...d0280

Now, let’s try to figure out the value of the next digit, b. Looking at the tens column of the second expression, we see that the digit b added to 5 and to the carried 1 ends with 8. Therefore, b is 2. Replacing b by 2 both in the addend and in the sum, we get the modified problem. (In the third expression in the picture above, the digit b has been replaced by 2.) Next, consider the hundreds column. Since there was no carry from the tens column, c mustbeequalto0.Itiseasytoseethatd is 0 as well, and so on. Thus, we get the same answer 28, but in a more entertaining way. 44 Session 5: Decimal Number System and Problems on Digits

Problem 3. Helena writes a 2-digit number, and Michaela inserts 0 between the 2 digits. The new number is 9 times bigger than the original number. What is Helena’s number?

Problem 3 Discussion. Again, we will demonstrate two different solutions. First solution (equation): Let Helena’s number be ab,wherea and b are digits. We have two numbers then, a0b and ab, the first one being 9 times bigger than the second one. How do we rewrite this relation as an equation? The way to do this is to use the decimal representations of both numbers: a × 100 + b and a × 10 + b. The equation is 100a + b =9(10a + b). Simplifying, we get 100a + b =90a +9b, 10a =8b, 5a =4b. This latter equation has infinitely many integer solutions. However, we need a pair of 1-digit numbers. Therefore, the only possible pair of solutions is a =4and b =5. (Since the left-hand side is divisible by 5, the right-hand side must be divisible by 5 as well. Thus, b has to be 0 or 5. If we assume that b =0,thena should be 0 as well. However, 00 is not a meaningful 2-digit number.) Therefore, the answer is 45. Second solution: We will be using column multiplication to construct the number digit by digit. ab x 9 a0b

By multiplying the ones column, we get that b×9 ends with b. The digit b cannot be 0 (if b is 0, then a is 0 as well), so b =5. Therefore, the carry to the tens column is 4. To get a 0 in the tens column of the product, a × 9 mustendwith6.Therefore,a =4.

Problem 4. Find the biggest 6-digit number such that each of its digits, except for the last two, is equal to the sum of its two right neighbors.

Problem 4 Discussion. Let’s write the unknown number as abcdef. The very important observation is that the 4 leftmost digits of the number are entirely defined by the choice of the 2 rightmost digits e and f. d = e + f, c = d + e =2e + f, b = c + d =3e +2f, a = b + c =5e +3f. Since our goal is to come up with the biggest possible 6-digit number, we should choose e and f so as to make the digit a as big as possible, while keeping it below 10. Using simple trial and error, it is easy to see that we get the greatest possible value of a if e =0and f =3. Therefore, the answer is 963,303. 5.4. Take-Home Problem Set 45

The topic of today’s lesson is fairly technical. Therefore, it would be use- ful for students to work their way through several of the problems suggested below.

5.3. In-Class Problem Set Problem 1. Replace the letters with digits in such a way as to make the sum as big as possible. (Identical letters stand for the same digits; different letters stand for different digits.)

SEND + MORE + MONEY Problem 2. “I will never tell you my secret 4-digit pin code,” Dr. Watson said to Sherlock Holmes. “I remember it since it is symmetrical and the sum of its digits is the same as the number formed by the first two digits.” “Ha,” Holmes replied. “Now I will be able to use your pin.” What is the pin? Problem 3. The last digit of a 3-digit number is 0. If you cross it out, the new 2-digit number is 351 smaller than the original number. What is the original number? Problem 4. Mary wrote a 3-digit number that starts with the digit 9. Paul erased this 9 and wrote it to the right of the number. Paul’s number is 216 smaller. What is the original number? Problem 5. A 3-digit number starts with 4. If this digit is relocated to the end of the number, you get a number that is equal to 0.75 of the original. What is the number?

5.4. Take-Home Problem Set Problem 1. My house number has five digits, and the sum of these digits is equal to my friend Winnie’s age. When I told this to Winnie, he immediately figured out what my house number is. How old is my friend Winnie? Problem 2. R + RR = BOW. What is the last digit of F × A × I × N × T × I × N × G ? (Identical letters stand for the same digits; different letters stand for different digits.) Problem 3. How many 9-digit numbers are there such that going from left to right the digits of this number get smaller? Problem 4. Shmerlin the magician found the door to the Cave of Wisdom. The door is guarded by Drago the Math Dragon and is also locked with a 3- digit lock. Drago agrees to put Shmerlin to the test: Shmerlin has to choose 3 integer numbers, x, y,andz, and the dragon will tell him the value of 46 Session 5: Decimal Number System and Problems on Digits

A × x + B × y + C × z,whereA, B, and C are the 3 secret digits that open the lock. After that, Shmerlin should come up with a guess of the secret digits. If the guess is correct, Drago will let the magician into the cave. Otherwise, Shmerlin will perish. Does Shmerlin have a way to succeed? Problem 5. A six-digit number starts with the digit 1. If this digit is relocated to the rightmost position, the number becomes 3 times bigger. What is the number? Problem 6. Two 1×1 squares are marked in a 10×10 grid. Prove that one can always cut the grid into two identical pieces such that the two marked squares would belong to different pieces. The cuts have to follow the grid lines. Problem 7. Solve: HE × HE = SHE. (Identical letters stand for the same digits; different letters stand for different digits.)

5.5. Additional Problems Problem 1. Olivia, a straight-A student, wrote a number that is composed of all the integer numbers from 1 to 500: 1234567 ...10111213 ...499500. Her friend, Mischievous Mike, erased the first 500 digits from this number. What is the first digit of the resulting number? Problem 2. (a) Find the biggest 6-digit integer number such that each digit, except for the two on the left, is equal to the sum of its two left neighbors. (b) Find the biggest integer number such that each digit, except for the first two, is equal to the sum of its two left neighbors. (Compared to part (a), we removed the “6-digit number” restriction.) Problem 3. In the 100-digit number 12345678901234 ...7890, Ben crosses out all digits that are located at the odd-numbered positions. In the 50-digit number that is left he crosses out all digits that are located at the odd- numbered positions. He keeps doing so until he ends up with a single-digit number. What is this number? Problem 4. The number x is a 3-digit number, and y is the same number written backward. Could it be possible that the sum of x and y is a number that is written using odd digits only? Problem 5. Which 500 consecutive positive integer numbers do you need to write down to get 2,006 digits? Session 6: Binary Numbers I

Children are usually intrigued by the subject of binary numbers. They know that understanding binaries is an important step toward understanding how computers work. However, while most children know the buzzword, they have little idea of what it actually stands for. We will spend the next two lessons discussing binaries. Today’s lesson is organized as follows: - We will start by presenting an “intuitive” explanation of binary num- bers. - Next, we will formalize this explanation and add more rigor to the discussion. - We will finish with a brief conversation about the role of binaries in the digital world.

For Teachers: Expect a lot of impromptu questions from the children during this lesson. It might be useful to brush up on topics that have a high chance of being brought up, such as: “How do we write a number in hex (base-16) system?”, “How is music converted to 0’s and 1’s?”, or “What is an ASCII table?”

Teaching supplies for this session: - A blank “binary numbers” table worksheet (one per student; see Problem 2 on page 53; see also the appendix on page 359). - Printouts of the take-home problem set (one per student). - Optional: two CDs or DVDs, one blank and one with data (to be used during the discussion about applications of binaries).

6.1. Math Warm-up Since we will be discussing binary numbers, it is a good idea to make sure that students are comfortable with exponentiation, especially with raising to the power 0. The warm-up starts with a simple question: what is 34?The answer is easy: 3 × 3 × 3 × 3=81, the number 3 multiplied by itself 4 times.

47 48 Session 6: Binary Numbers I

How about 30? Since there is no obvious interpretation of how to multiply a number by itself 0 times, we will try to come up with a value that allows us to preserve important properties of exponentiation. One obvious property is that whenever an exponent increases by 1, the power of 3 increases trifold: 31 =3, 32 =9, 33 =27,etc. For this to hold true for powers 0 and 1, 30 should be 3 times smaller than 31. Thus, we have to have 30 =31 ÷ 3=1. It is easy to see that the same reasoning works for all other numbers: any number in power 0 must be equal to 1. Possible extension of the discussion: the same pattern can be used to explain negative powers: 3−1 should be 3 times smaller than 30.Thus, − − 3 1 = 1/3 . Similarly, 3 2 = 1/9 ,etc.

For Teachers: Expect your students to ask about 0 raised to the power 0. Is it 0 or 1? One may reason that it must be 1 since anything to the power 0 is 1: 10 =1, 0.10 =1, 0.010 =1, etc. On the other hand, it must be 0 since 0 raised to any power is 0: 01 =0, 02 =0, 03 =0. The real answer is that 0 to the 0 power is impossible to define, exactly because of these reasons.

6.2. Discussion of the Day: Binary Land—an Informal Introduction to Binaries Our introduction to binary numbers starts with a short story that presents an “intuitive” explanation of the concept.1 There used to be a far-away land called Binary Land. In that land, people lived their lives as usual: farmers grew crops, guards defended the borders, and merchants went about their trade of buying and selling. Yet, there was one unusual thing about the merchants: the weights that they used for weighing goods on their two-pan balance scales. All weights in Binary Land came in powers of two: 1, 2, 4, 8, 16, 32, and so on.

1 2 4 8 16 32 64 Such a system is not as inconvenient as one might think. Suppose that a merchant owns the following set of weights: 1, 2, and 4: 1 2 4 The largest quantity he can weigh with these weights is 1+2+4 = 7; the smallest is 1. How about others? Can he balance every integer in between?

1I learned about this great approach to teaching binary numbers from Olga Radko, LA Math Circles. The LA Math Circles website has a bunch of handouts on binary numbers. 6.2. Introduction to Binaries 49

(We assume that when being weighed, an object is placed on one pan of the scales, and the weights go on the other.) - Weighing 2 pounds? We can use a 2-pound weight. - Weighing 3 pounds? We can use 2-pound and 1-pound weights. - Weighing 4 pounds? We can use a 4-pound weight. - Weighing 5 pounds? We can use 4-pound and 1-pound weights. - Weighing 6 pounds? We can use 4-pound and 2-pound weights. - Weighing 7 pounds? We can use 4-pound, 2-pound, and 1-pound weights. So, the set 1, 2, and 4 can balance any quantity in the range from 1 up to 7. Besides, 7 is just one step away from the next weight—weight 8. Next, take a look at the set of weights 1, 2, 4, and 8: 1 2 4 8 How useful is this set? The largest quantity for this set is 1+2+4+8 = 15. Can we balance every quantity in between, or will there be a gap? The students start figuring out how to weigh 9, 10, ..., 14. The results are summarized in the table below. (The numbers in the right column are quantities; the check marks indicate those weights that are used.) While we work on filling in this table, a keen student formulates an important rule that simplifies the search: adding 8 to every combination from1to7getsustotherangefrom9to15.

8 4 2 1 Numbers that we balance  1  2   3  4   5   6    7  8   9   10    11   12    13    14     15 What if we want to weigh larger quantities? Let’s take a look at the set 1, 2, 4, 8, and 16: 1 2 4 8 16 How far will this bigger set get us? The student’s observation helps us to discover the answer: we can balance any quantity from 17 to 31 by adding 16 to each of the 1-to-15 combinations. Thus, the set of 1, 2, 4, 8, and 16 gives us the range from 1 to 31. Great! 50 Session 6: Binary Numbers I

Similarly, adding 32 to each of the combinations from 1 to 31 gives us numbersfrom33upto63. We can summarize our observations in another table: Weights in the set Range 1 up to 2 − 1=1 1 2 up to 4 − 1=3 1 2 4 up to 8 − 1=7 1 2 4 8 up to 16 − 1=15 1 2 4 8 16 up to 32 − 1=31 1 2 4 8 16 32 up to 64 − 1=63

Looking at this table, we see a great pattern: each set of all consecutive powers of 2 adds up to the number that is one below the next power of two. Forexample,weightsfrom1to16addupto32 − 1, weights from 1 to 32 addupto64 − 1,etc. Will this pattern work for bigger numbers? Would weights from 1 to 64 addupto128 − 1? Would weights from 1 to 128 add up to 256 − 1?Etc.? This pattern is indeed true, and the proof of it marks the starting point of a more “serious” discussion of binary numbers. Our goal is to prove that the pattern below holds forever: 1+2+4+8+16=32− 1, 1+2+4+8+16+32=64− 1, 1+2+4+8+16+32+64=128− 1, 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 256 − 1, .... This proof will be a gradual step-by-step activity, like climbing rungs of a ladder: each step that we have just conquered will help us get one step higher. So, we already know that 1+2+4+8+16=32− 1. How can we use this fact to prove that 1+2+4+8+16+32=64− 1? Note that we do not want to verify this equality by a direct calculation since it would be equivalent to jumping up several steps from the ground. Instead, we need the kind of reasoning that we could apply every time to conquer the next step. Let’s do some simple arithmetic: 1+2+4+8+16+32=(1+2+4+8+16)+32. Using the fact that 1+2+4+8+16=32− 1,wecanrewritetheabove expression as (1+2+4+8+16)+32=32− 1+32=2× 32 − 1=64− 1. Wow, we proved it; we climbed to the next rung! 6.3. Binary Number System 51

Let’s use this rung to get one level higher: to prove that 1+2+4+8+ 16 + 32 + 64 = 128 − 1:

1+2+4+8+16+32+64 = (1 + 2 + 4 + 8 + 16 + 32) + 64 =64− 1+64=2× 64 − 1 = 128 − 1.

Hurray! We did it! We can continue this way forever, getting to larger and larger powers of two. So, we can prove that each of these series of powers of 2 always sums up to the number that is 1 below the next power of 2.

Thus, we proved that the Binary Land weights 1, 2, 4, 8, 16, 32, . . . form a very handy set indeed: - Each set of weights from 1 to 2n allows us to weigh any quantity from 1 to 2n+1 − 1, and, whenever we add the next weight to the set (weight 2n+1), we increase the range to 2n+2 − 1. Therefore, any integer quantity can be balanced with some combination of these weights.

6.3. Binary Number System Because of the Binary Land story, we learned аbout very important proper- ties of powers of 2: - Any integer can be expressed as a combination of distinct powers of two: 20, 21, 22 , 23 , 24 , 25 , 26, etc .... - Moreover, such a combination is always unique; for any integer, there is just one way to choose the numbers. (This can be proven, but we will skip the proof for now.) These two properties are at the core of the binary number system. The idea is very simple: to write a number in binary, we express it as a combination of distinct powers of 2. Next, we encode this combination using two symbols: 0 and 1. The Binary Land table with numbers and corresponding sets of weights (on page 49) gives us an excellent starting point. In each row, let’s mark with a 1 each weight that is used, and mark each weight that is not used—with a 0. Next, for every row, let’s combine these 0’s and 1’s into a number. The table below illustrates this idea. The first column is filled with base-10 numbers. The column under each picture of a weight keeps track of whether this weight goes into a number. The last column is filled with the resulting combinations of 0’s and 1’s. 52 Session 6: Binary Numbers I

Number Number in 32 16 8 4 2 1 in base 10 binary 32 (= 25) 16 (= 24) 8(=23) 4(=22) 2(=21) 1(=20) 1 1 1 2 1 0 10 3 1 1 11 4 1 0 0 100 5 1 0 1 101 6 1 1 0 110 Now, we get: - The weight that makes 1 is encoded as “1”. - The weights that make 2 are encoded as the combination “10”. - The weights that make 3 are encoded as the combination “11”. - The weights that make 4 are encoded as the combination “100”. - The weights that make 5 are encoded as the combination “101”. - And so on .... Every number can be encoded this way. Such a way of representing numbers is called a binary number system. Since it is so important to have a solid understanding of binaries, let’s repeat one more time what binary numbers stand for: - First, we express a decimal number as a combination of distinct powers of 2. - Next, we write this combination down using two symbols—“0” and “1”. (Symbols “1” are used to mark the powers that go into the number, symbols “0”—those that are not.) This way, we get the corresponding binary number. It works the other way around as well! Given a sequence of 0’s and 1’s (a binary number), we can match these with corresponding powers of 2. So, we can reconstruct the original decimal number. This new way of writing numbers is a cool one! We can express any number using two digits only: 0 and 1. The digits from 2 to 9 can now retire. Now that we have learned what the binary number system is about, it’s practice time! Let’s start by converting several binary numbers into decimals. A table with powers of 2 in the header makes mapping binary digits to the right powers of 2 much easier. 128 64 32 16 8 4 2 1

Example: Convert 1001101 into decimal. Penciling the digits of 1001101 into this table, we see that the corre- sponding base-10 number is 64+8+4+1=77. 128 64 32 16 8 4 1 2 1 0 0 1 1 0 1 6.5. Computers and Binary Numbers 53

Problem 1. Write these binary numbers as decimals: 110011, 10000000, 1000101, 111111, 111110. Another great starting point for a binary “newbie” is to do it other way around—convert a bunch of base-10 numbers into binary. Problem 2. Expand and fill in the table below with numbers from 1 to 32 and with their binary equivalents: Number Number in 32 16 8 4 2 1 in base 10 binary 32 (= 25) 16 (= 24) 8(=23) 4(=22) 2(=21) 1(=20) 1 1 1 2

For Teachers: Even though this task looks a bit mundane, it’s a VERY useful exercise. Moreover, while filling the table, students will have a chance to observe many interesting patterns related to the structure of binary numbers. You can create a similar table yourself or simply copy it from the back of this book (on page 359). If you do not want to interrupt the flow of the lesson, you can hand out the table together with the problem set.

6.4. Binary Notation Suppose that a teacher writes the number 101 on the board. Being familiar with binary numbers, we can interpret 101 in 2 different ways: as a “regular” base-10 number or as a binary number (which would be equal to 5). How do we know which is right? To get rid of this ambiguity, mathematicians came up with a special notation: a subscript that indicates the base of a number: - 1012 and 111112 are binary numbers, for example. We have not studied other bases yet, but they do exist. Thus, 1013 would mean a base-3 number; 1014 wouldmeanabase-4number;etc. Our regular base-10 numbers can be marked with subscript 10 as well. However, by default base-10 subscript can be omitted: 101 = 10110. We learned plenty about binary numbers today. Let’s finish the lesson with a short discussion about the importance of binaries in the digital world.

6.5. Computers and Binary Numbers We all know that computers remember everything in binary. But how exactly does this happen? For example, how can a word or even a single letter be encoded as a sequence of 1’s and 0’s? 54 Session 6: Binary Numbers I

The question proves to be challenging to students. After a period of incorrect guesses, Jackie comes up with an idea of assigning a number to each character. We develop the idea further, saying that we can create a special table of symbols and their binary encodings. If everyone agrees to use this table, then we can encode letters and decode them back. (This idea clicks with Anton, who recalls hearing about something called the ASCII table from his dad.) Draw a sample table that illustrates how letters and symbols could be assigned binary equivalents. Character Binary representation a 00000001 b 00000010 c 00000011 d 00000100 e 00000101

Stress that this table is just a model. In reality, of course, such tables look different, and things are more complex overall. Now that we know how information can be encoded with 0’s and 1’s, the next question is what is happening inside a machine. How are these 0’s and 1’s actually represented in computer memory (or on a CD or on a drive)? The most important idea is that there are no 0’s and 1’s inside a computer. Instead, there are billions of tiny switches. Such a switch, called a “bit”, can store a tiny bit of information—whether it is “on” or “off”. Suppose we decide that “on” stands for 1, and “off”—for 0. Then a sequence of switches can be used to store a sequence of 0’s and 1’s. A bit is the smallest building block of storage; however, it is too small to be of much use. Therefore, bits are always grouped together into blocks of 8; these blocks are called bytes. We can store different numbers and characters by setting bits of a byte into different combinations of 0’s and 1’s: 01101111, 0100000, etc. How many distinct values (symbols or numbers) can we represent with one byte? The slot rule can be used to calculate the answer: there are 8 positions, and each can take one of 2 values. Therefore, the total number of possible arrangements is 28, which is 256. Would this ability to encode 256 symbols be sufficient? At first glance, it looks like the answer is “yes”. Indeed, we use quite a limited number of characters day-to-day: there are just 26 letters in the English alphabet. If we also allow for capital letters, for ten digits (from 0 to 9), and for punctuation signs, we are still way below 256. It worked this way for many years—symbols were encoded into byte- sized data. However, there are many languages in the world, and altogether the number of characters is way more that 256. Therefore, for different 6.6. Take-Home Problem Set 55 languages, different encoding tables had to be used, which created a lot of confusion with data interpretation. To solve this problem, computer scien- tists came up with a different standard, called Unicode. Unicode allocates 2 bytes per character; this way, it can provide unique encoding for every character in the world. Another useful observation is that we can use symbols other than “0” and “1” for communicating with a computer. All we need are labels to mark the two states of a bit. Thus, we can use any other pair of characters: “A” and “B”, or “+”and“−”. For example, if we use A and B, then we would encode the number 5 not as 101, but as ABA, and we would encode number 8 not as 1000, but as ABBB. It is also interesting to know that different types of digital media use different ways to store data. While computers use tiny electronic switches, audio CDs and DVDs store data optically. For these, 0’s and 1’s are signaled by tiny pits burned into the surface of a CD. Because of these pits, different parts of the surface reflect light differently. A “read laser” bounces the light beams on the surface. It detects these differences and converts them into 0’s and 1’s. For Teachers: At this point, it is a good idea to demonstrate to students a pair of CDs or DVDs, a blank one and one with data. Of course, the blank CD will have a shiny surface, as it does not have any data burned on it yet.

6.6. Take-Home Problem Set Problem 1. Convert the following numbers from binary (base 2) to decimal (base 10): (a) 102 (b) 1012 (c) 1112 (d) 10002 (e) 11012 (f) 100000002 (g) 11111112 Problem 2. Convert from decimal to binary: (a) 3 (b) 8 (c) 15 (d) 32 (e) 31 (f) 40 (g) 53 56 Session 6: Binary Numbers I

Problem 3. (a) Which binary number is 1 bigger than 1000000002?Whichis1 smaller? (b) Which binary number is 1 smaller than 11111111112?Whichis2 smaller? Which is 2 bigger? Problem 4. (a) How can one tell if a binary number is even or odd? (b) How can one tell if a binary number is divisible by 4? (c) If a binary number ends with 10, what is the remainder when this number is divided by 4? Problem 5. Joe the Gold Miner has 30 golden nuggets worth 1, 2, ..., 30 dollars. Which 5 of these nuggets should he take with him if he wants to be able to pay any integer amount ranging from 1 dollar to 30 dollars? Problem 6. Julia is buying a new laptop. She pays $260 of her own money, and her dad, sister, and brother are helping her with the rest of the sum. Her sister gave her 1/8 of the price of the laptop. Her brother gave her 1/4 of the price, and her dad gave her 1/2 of the price of the laptop. What is the price of the new laptop? Problem 7. You have a sack of flour, a 1-gram weight, and a box of light plastic bags. Can you measure 1,000 grams of flour in 10 weighings on a balance scale? Problem 8. Five pirates—Archie the Captain, Bob the First Mate, Chad the Gunner, Don the Rigger, and Eamon the Cook—got a chest of gold coins. Archie took half of all the coins and half of a coin; Bob received half of the remaining coins and half of a coin; Chad’s share was half of the remaining coins and half of a coin, and Don got half of the remaining coins and half of a coin. Finally, when Eamon took half of what was left and half of a coin, there was no gold left. How many gold coins did the pirates originally have? (The pirates did not cut any coins in half.)

Problem 9. Merlin the Sorcerer has built his castle next to the dwelling place of the mighty Dragon Shmok. Every morning with the first rays of the rising sun the Dragon flies out of his lair, heading toward one of the four nearby towns, which are located to the north, south, east, and west of the castle. Merlin’s task is to warn the townspeople where to expect Shmok today. The castle has three towers topped with magic spheres; one is made out of ruby, the other of emerald, and the third one is made out of sapphire. When the magic spheres are lit up, their radiance is seen from the farthest corners of the land. So it has been agreed that by these lights Marlin sends his signal, using some code to indicate where the Dragon is heading. 6.6. Take-Home Problem Set 57

The spheres’ lights, however, tend to flicker randomly at night, and the morning may find any combination of them turned on or off. And, because of his old age, Merlin will have the strength to climb only one tower to manipulate its light (to turn it on or off). Thus, starting from a random combination, Merlin can change the state of no more than one sphere. After that, the townspeople should be able to read where the Dragon is heading by seeing which lights are on. Can you help Merlin come up with such a code?

Session 7: Binary Numbers II

Today is the second lesson on binary numbers. Last time, we learned how to read and interpret binary numbers and how to convert binaries to decimals. Today, we will learn how to do arithmetic operations on binaries, and we will discuss two different algorithms for converting decimal numbers to binary.

For Teachers: This session contains a lot of material. For a group of younger kids, you may decide to split this lesson into two or to postpone presenting the second (more complex) algorithm for converting decimals to binary until next year.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

7.1. Math Warm-up Warm-up 1. Which shape should replace the question mark? (Choose from A, B, C, D, E.)1 + = + = ?

(A) (B) (C) (D) (E)

1This problem was given to 2nd graders at one of the Math Olympiads in St. Petersburg, Russia (School #30 Math Olympiad). Be prepared to think out of the box!

59 60 Session 7: Binary Numbers II

7.2. Discussion of the Day: Binary Arithmetic We start the lesson with the discussion of math operations and binaries.

How to add binary numbers

How do we calculate 1110012 + 111012? One idea that comes to mind is to convert both numbers to decimals, sum them up, and convert the answer back to base 2. While this approach works, it seems to be highly inefficient. Instead, we can use the algorithm for column addition of binary numbers, which is very similar to the algorithm for adding decimals. As with decimals, we should start by learning how to add one-digit binary numbers. Take a look at the base-2 addition table below, which is pretty straightforward. (We know enough about binaries by now to understand that 1+1=102.) + 0 1

0 0 1 1 1 10

To get two binary numbers ready for column addition, we align them as if we were adding decimals. Next, we start with the two digits in the far right column. If these two digits add to 0 or 1, we write the answer below. If they add to 102, we write 0 below and keep 1 as a carry for the next column. We keep adding the digits column by column, moving from right to left. Remember that we need to add any carry and that 1+1+1=112. The addition 1110012 + 111012 would play like this: 1 1 1 111001) 111001 111001 111001) 111001) 111001 + 11101 + 11101 + 11101 + 11101 + 11101 + 11101 0 10 110 0110 10110 1010110

How to subtract binary numbers Binary numbers can be subtracted just like decimal numbers, using column subtraction with borrowing. For the sake of brevity, we are skipping the detailed description. However, it may be a good idea to work through several subtraction problems. Subtract: 1101102 − 100102, 101112 − 11112, 100002 − 10112.

How to multiply binary numbers The algorithm for binary multiplication is like the algorithm for column multiplication for decimals, but easier. The multipliers contain only 0’s and 7.3. How to Convert Decimals to Binary 61

1’s. So each multiplication step produces either 0, or the copy of the first term. You can practice binary multiplication on a couple of simple examples. Multiply: 10012 × 112, 10112 × 1012. It is very educational to discuss what happens to a binary number when it is doubled. In the binary world, “doubling” means multiplying by binary ten (the number 102). Therefore, doubling a binary affects it in the same way as multiplying by 10 affects a base-10 number: all digits are shifted one place to the left, and 0 is added on. Examples: - Doubling 1001112,weget10011102. - Doubling 111112,weget1111102. By the same reasoning, multiplying by 4 (which is binary 100) is equiva- lent to shifting a binary number 2 places to the left and adding on 2 zeroes; multiplying by 8 (which is binary 1000) is equivalent to shifting 3 places and adding on 3 zeroes, etc. Examples: -Thenumber111002 is 4 times larger than 1112. -Thenumber10010002 is 8 times larger than 10012. -Thenumber111011100002 is 16 times larger than 11101112. It is interesting to compare the difficulty of multiplication in base 10 versus base 2. To be able to multiply multi-digit numbers in base 10, one has to know how to multiply one-digit decimals, which requires memorizing the 1-to-9 multiplication table. In the binary world, multiplication is much simpler: you can start multiplying right away—all you have to know is how to add and how to shift. For example, to multiply by 101, you have to shift two places to the left and add on 2 zeroes to the end of the original number; next, you need to calculate the sum of this new number and the original number. This is precisely how computers do multiplication internally. On the hardware level, it is easy to implement binary additions and shifts. There- fore, computer engineers exploit this approach: they implement multiplica- tion through shifts and additions.

7.3. How to Convert Decimals to Binary During the previous lesson, we learned how to, given a binary number, rewrite it as a decimal: all we have to do is add up all powers of 2 that correspond to digits “1”. However, we have never discussed the reverse procedure—how to convert a decimal to a binary. Indeed, how would you get started with converting 123,456,789 to binary, for example? Today, we will introduce two decimal-to-binary algorithms. You will be able to compare them and decide which is better for you. 62 Session 7: Binary Numbers II

Converting Decimal to Binary: A Greedy Approach We present the first algorithm using the number 358 as an example. (The algorithm would work the same way on any other number.) Recall what we learned during the previous lesson: the binary system is about expressing a number as the sum of distinct powers of 2. Thus, we need a procedure that would result in rewriting 358 as the sum of powers of 2. Let’s start by figuring out the biggest power of 2 that fits into 358. It would be 256 = 28. Next, do the same for the difference of 358 and 256. - The biggest power of 2 that fits into 358 − 256 = 102 is 26 =64. Keep repeating this procedure until we get to 0: - The biggest power of 2 that fits into 102 − 64 = 38 is 25 =32. - The biggest power of 2 that fits into 38 − 32 = 6 is 22 =4. - The biggest power of 2 that fits into 6 − 4=2is 21. - The difference between 2 and 21 is 0. Stop Hurray! Step by step, we managed to express our number as the sum of the powers of 2: 358 = 256 + 64 + 32 + 4 + 2 =28 +26 +25 +22 +21.

We are ready to rewrite the number 358 as a binary: it is 1011001102. It is easy to see why we call this approach “greedy”. For each step, we are making a decision that provides the most obvious benefit, which is to choose the biggest power of 2 possible. What is your opinion of this algorithm? It does have some advan- tages; for example, it is very intuitive. Does it have disadvantages? Yes, it does—imagine that you are asked to convert a huge number, such as 1,000,000, into binary. How would you calculate the biggest power of 2 that goes into 1,000,000? The task looks scary. The second algorithm addresses this problem—it is much easier to work with large numbers. However, it is more challenging to demonstrate how it works.

Converting Decimal to Binary: Division by 2 Algorithm For this algorithm, we will learn how to, given a decimal number, construct its binary representation, digit by digit, starting from the rightmost digit and making our way to the left. (To the contrary, the first algorithm was working from left to right, from higher to lower powers.) As before, we will present the algorithm using a specific number, and then we will generalize. Starting with the number 358, let’s generate a string of 0’s and 1’s as follows: - Step 1: 358 is even; therefore, we add up “0”. - Step 2: Divide 358 by 2: 358 ÷ 2 = 179. The number 179 is odd. Add a 1 to the left; we get “10”. 7.3. How to Convert Decimals to Binary 63

- Step 3: Subtract 1 from 179, and then divide by 2: (179 − 1) ÷ 2=89. The number 89 is odd. Add a 1 to the left; we get “110”. - Step 4: Subtract 1 from 89, and then divide by 2: (89 − 1) ÷ 2=44. The number 44 is even. Add a 0 to the left; we get “0110”. - Step 5: Divide 44 by 2: 44 ÷ 2=22. The number 22 is even. Add a 0 to the left; we get “00110”. - Step 6: Divide 22 by 2: 22 ÷ 2=11. The number 11 is odd. Add a 1 to the left; we get “100110”. - Step 7: Subtract 1 from 11, and then divide by 2: (11 − 1) ÷ 2=5. The number 5 is odd. Add a 1 to the left; we get “1100110”. - Step 8: Subtract 1 from 5, and then divide by 2: (5 − 1) ÷ 2=2.The number 2 is even. Add a 0 to the left; we get “01100110”. - Step 9: Divide 2 by 2: 2 ÷ 2=1. The number 1 is odd. Add a 1 to the left; we get “101100110”. - Step 10: Subtract 1 from 1, and then divide by 2: (1 − 1) ÷ 2=0.We get the number 0. STOP. Take a look at the string that we got: 101100110. This is 358 in binary!!! So, apparently, the procedure above generated the base-2 representation of a number. But why? Let’s examine why this procedure works. Digit by digit, right to left, we will explain why it results is a binary representation of a decimal. Justification of Step 1. We do know that the parity of a decimal number defines the last digit of its binary representation. Since the number 358 is even, it follows that the rightmost digit of its binary counterpart must be 0. Justification of Step 2: Dividing an even binary number by 2 is equivalent to erasing the rightmost 0. Therefore, the binary representations of 358 and 358 ÷ 2 = 179 should match, except that 358 should end with an extra 0. So, the last binary digit of 179 must be equal to the second-to-last binary digit of 358. The number 179 is odd; so, it follows that the second binary digit of 358 is 1. Justification of Step 3: Subtracting 1 from an odd binary number is equivalent to replacing the rightmost digit 1 of this binary number by the digit 0. Therefore, the binary representations of 179 and 178 should match, except for the last digit (179 ends with 1, and 178 ends with 0). It follows that the binary representations of 179 and 178 ÷ 2=89should match as well, except that 179 should end with an extra 1. So, the last binary digit of 89 is equal to the second-to-last binary digit of 179. This second-to-last digit is, in turn, equal to the third-to-last digit of the original number 358. The number 89 is odd; so, it follows that the third binary digit of 358 is 1. We already see the pattern. At every step, we generate a new, smaller, number such that its binary representation matches the binary representation 64 Session 7: Binary Numbers II of the current number with the last digit erased. To get this number, we adjust the current number for parity and then divide it by 2. The parity of the new number allows us to learn another digit of the original number. This is the main idea of the algorithm: by repeatedly dividing a decimal number by 2 and adjusting the intermediate results for parity, we can get all the digits of the corresponding binary number one by one, right to left!

The “formal” description of the “Division by 2” algorithm Starting from an original decimal number, keep repeating the two steps below. This way, you will be generating digits of the corresponding binary number, right to left. • Calculate the next binary digit: this digit is 1 if the current decimal number is odd; it is 0 if the current number is even. • Divide the number by 2, subtracting 1 beforehand if the current number is odd. If the result of this division is 0, stop: you have the entire base-2 number. Otherwise, use it for the next iteration. Let’s run one more demonstration of this method using the number 713 as an example. The intermediate results and the final answer are collected in the table below. Next Original and Parity Binary binary digit intermediate representation of 713 numbers 713 odd 1 ______1 356 = (713−1)÷2 even 0 ______01 178 = 356 ÷ 2 even 0 ______001 89 = (178 − 1) ÷ 2 odd 1 ______1001 44 = (89 − 1) ÷ 2 even 0 ______01001 22 = 44 ÷ 2 even 0 _____001001 11 = 22 ÷ 2 odd 1 ____1001001 5=(11− 1) ÷ 2 odd 1 ___11001001 2=(5− 1) ÷ 2 even 0 __011001001 1=2÷ 2 odd 1 _1011001001 0=(1− 1) ÷ 2 DONE!!!

We get the binary representation: 713 = 10110010012. For Teachers: This algorithm can easily be extended to convert a decimal to any base. Be prepared to demonstrate how to use it to convert a decimal to base 16 or some other weird number base. (Your students are surely going to ask about it!)

It is interesting to ask students to compare the two algorithms. Some of the differences are easy to point out: the first algorithm works left to right, from high to low powers. The second algorithm generates digits right 7.4. Take-Home Problem Set 65 to left. While the key operation for the first algorithm is multiplication, for the second one it is division. Also, the mechanics of the first algorithm are easier to understand, while the second algorithm is much simpler to run on bigger numbers.

7.4. Take-Home Problem Set Problem 1. Add these binary numbers using the column addition algo- rithm: (a) 10002 + 1012 (b) 110112 + 1111112 (c) 10111002 + 101012 (d) 111110112 + 1111111112 Problem 2. (a) Double these binary numbers: 10012, 111111111012. (b) Write a binary number that is 4 times bigger than 1110001112. (c) Write a binary number that is 64 times bigger than 1112. Problem 3. Convert these numbers to binary. (Use the conversion algo- rithm of your choice.) (a) 80 (b) 152 (c) 401 (d) 522 (e) 1023 Problem 4. The first water lily in the Lily Pond blossomed on June 1st. Since that day, the number of flowers has doubled every day. On June 15th, the flowers covered the pond completely. If two flowers (instead of one) started blooming on June 1st and the number of flowers doubled every day, when would the pond become completely covered in flowers? Problem 5. To get to the Stone of Wisdom, a young wizard must solve а puzzle. She is given a 7×7 square that she has to cut into 9 smaller rectangular pieces. Using these pieces, she should be able to tile any integer rectangle that fits into the 7 × 7 square: 1 × 1, 1 × 2, 1 × 3,..., 1 × 7, 2 × 2, 2 × 3,..., 7 × 6,and7 × 7. Solve this puzzle. (All cuts should follow grid lines. “To tile” means to cover without gaps and overlaps.) Problem 6. Brother Fox and Brother Rabbit are planting beets and carrots in their vegetable patch. The patch has 20 rows, with spots for 7 plants in each row. They plant as follows: Brother Fox chooses the next seedling (beet or carrot), and Brother Rabbit chooses a free spot where to plant it. They keep doing this until they fill all the spots. Brother Fox and Brother Rabbit agree to divide the crops as follows: Brother Fox can take the yield from as many rows as he wants, as long as all rows he claims to himself are planted according to different patterns. 66 Session 7: Binary Numbers II

For example, if 4 rows are planted as in B B B B B B C the picture on the right, Brother Fox gets C B B B B B B the yield from 3 rows. ("B" and "C" stand for "beet" and "carrot".) B B B B B B C What is the largest number of rows B C B C B C B Brother Rabbit can always secure for himself no matter how smartly Brother Fox chooses what to plant?

Problem 7. In the picture, you can see the map of the Old City, with streets heading east-west and north-south. At each intersection of two streets, there is a small plaza. A tourist would like to take a walk from the train terminal (A) to his hotel (B). He would like to take the longest route possible without visiting any of the plazas twice. Draw such a route and prove that a longer route cannot be found.

B

A Session 8: Mathematical Dominoes Tournament

Math entertainment is an important part of a mathematical circle curricu- lum. A well-prepared mathematical contest serves multiple purposes: it educates students and motivates them. Finally, it gives students a chance to work as a team and to get to know each other. Today, we have our first in-circle mathematical contest. It is going to be Mathematical Dominoes, which is an engaging and easy-to-learn tournament that is loved by students of all ages. The detailed description of the game can be found in the “Mathematical Dominoes” chapter (page 241). The great things about Dominoes are: – Every student is engaged in active problem solving from the start until the end of the game. – The children can work at their own pace, adjusting the difficulty of the problems to their team’s standing. – There are enough risk and unknown elements in the game to keep students thrilled. – The game can be played for as long as needed and can be stopped at any moment.

Teaching supplies for this session: - One set of Math Dominoes problem cards, which have been printed, cut, and folded. - Score tables (one score table per team). - Printouts of Dominoes problems with answers (one per teacher). - Printouts of the take-home problem set. - Prizes for the contest participants are optional. However, the children will enjoy small rewards such as candy and chocolates. Also, remember that you may need a helper or two to assist with checking the answers. (The good news is that helpers do not have to know the problems; they check the students answers off the list.)

67 68 Ssession 8: Mathematical Dominoes Tournament

8.1. Math Warm-up Since time is valuable, we use the warm-up time to explain the rules of the Mathematical Dominoes game to the students.

8.2. Rules of Mathematical Dominoes Let’s start with a brief review of the game rules. Math Dominoes is a small-team (or individual) contest in problem solv- ing. Each team works on problems at its own pace, selecting them one by one from the pool of available problems. For every problem, the team has two attempts to present an answer. Points are awarded depending on whether the problem was solved on the first attempt (full score), second attempt (partial score), or not solved (a fine). A Math Dominoes problem is written on a card that is similar to a domino tile: it has a pair of numbers (domino values) on one side and a problem on the other. This pair of numbers defines the points a team can earn for the problem: the sum of the two numbers for the full score, the bigger of the two for the partial score, the smaller of the two for the fine. For example, the problem below brings 5+3 =8 points if it is solved on the first try, 5 points if solved on the second try, and a fine of 3 points if the second attempt fails. Draw a polygon The The “problem” with 10 vertices “points” side of a that can be split side of a domino into 5 triangles with domino card 5 : 3 one straight cut. card

Moreover, the same pair of numbers predicts the difficulty of a problem. Therefore, depending on their team’s standing, the kids can plan various kinds of strategies: they can go for more difficult and high-risk problems or for easier “sure win” ones. (The goal of the game is to earn the most points.) Children like the Dominoes game: they work together on fun problems, they strategize, and they take risks. Besides, the fact that the problems require only answer, no explanations, is a welcoming reprieve. For Teachers: Make sure that you read the chapter about Math Dominoes on page 241. It contains the detailed rules of the game and also a lot of useful advice on how to prepare and run the game. The answers to the Domino problems can be found at the end of the book.

Planning the Class Time A mathematical contest usually requires plenty of time to run. The good new is that the Dominoes game can be stopped at any moment (with a 5- minute warning and with a ban on taking new cards). Still, today’s game 8.3. Mathematical Dominoes Problems 69 has around 40 problems, which is plenty for a big group and a long game. For a shorter game, feel free to use only half of the problems. The second halfcanbeusedinafuturegame. Plan to allocate some time on logistics: an explanation of the game rules, splitting kids into teams. (Two students per team is the best size. An occasional team of 3 or 1 works fine as well.)

The Contest After the rules have been explained, the students have been split into teams, and the teams choose their names, the game begins. We place the cards domino-side up on a big table that is easy to access. After a team takes a problem, it fills in the “problem number” and “problem score” sections of the score table and starts working on the solution. To present an answer, students write it in the score table and show it to a judge. When the team is ready for the next problem, they put the first problem back on the table and choose a new one.

8.3. Mathematical Dominoes Problems

# PROBLEM SCORE A barrel will be completely filled with water if you pour in either 6 small buckets of water, 3 medium buckets and 1 large bucket of 1 water, or 2 small, 1 medium, and 3:0 3 large buckets of water. How many large buckets of water would completely fill the barrel? Find two integer numbers such that: - Their sum equals 165. 2 - If the rightmost digit of the 5:2 bigger number is erased, the numbers will become equal. 70 Ssession 8: Mathematical Dominoes Tournament

A birthday cake, which has the shape of a 4 × 4 rectangle, is decorated with 4 chocolate roses. Cut this cake into 4 pieces, so that аll these pieces have the same shape and the same area 3 and each piece is decorated with arose. 3:3

Mr. and Mrs. Smith have several children. Their son Jack says that he has the same number of brothers and sisters, while their 4 daughter Mary claims that she 1:0 has three times as many brothers as sisters. How many boys and how many girls are there in the family? Cowboy Joe had a coil of rope. Hiswifeusedhalfofthisropeas a clothesline to hang her laundry. Joe used half of the remaining rope to tie his horse to the tree. 5 Finally, he used two-fifths of the 1:1 leftover rope to tie up Billy the Bandit. Joe was left with 1.5 yards of rope. How much rope was in the coil? How many different values can you get if you add parentheses to the expression below? (You may 6 add as many pairs of parentheses 6:0 as you want to.) 1+2× 3+4 8.3. Mathematical Dominoes Problems 71

In the expression below, every star stands for a digit. Moreover, every number in this expression is a palindrome—it reads the same way from left to right and from 7 right to left. (For example, the 5:0 numbers 2,332 and 191 are palindromes). Decrypt the expression. ∗∗+ ∗∗∗= ∗∗∗∗ The bathroom scale is unbalanced. (The arrow on the dial is not pointing to zero.) When Mary steps on the scale, the arrow points to 40 kg. For 8 John, the arrow points to 30 kg. 7:0 When Mary and John step on the scale together, the scale shows 80 kg. How much do John and Mary really weigh? Insert several mathematical operation symbols (“ + ”, “ − ”, “ ÷ ”, ” × ” )tomake the equation true: 1234567=13. 9 (You do not have to use all four 7:1 operations. You may use several of the same kind. Combining digits is OK. Parentheses are not to be used.) Two boys are watching a smith make a sword. Looking at his watch, one of the boys says to his friend: “The time interval 10 between the 1st and 4th strike is 2:1 12 seconds.” How many seconds will pass between the 1st and the 12th strikes? 72 Ssession 8: Mathematical Dominoes Tournament

The parliament of a certain country has 100 members. At least one of them is dishonest. 11 However, for any pair of 4:0 members, there is at least one honest person. How many parliamentarians are dishonest? When Brandon was asked how old he was, he said: “I’m three times younger than Dad, but 12 three times older than my 5:3 younger brother Eamon.” Little Eamon is 40 years younger than Dad. How old is Brandon? Look at the number 126. All of its three digits start with different letters. Next, look at the number 123. Two of its three digits start with the same letter ( “two” and 13 “three”). Now, let’s call a 6:2 three-digit number “cool” if ALL of its three digits start with the same letter. Finally, the problem: calculate how many three-digit numbers are “cool”. Eight trees are planted in a single row 5 meters apart from one another. There is a well next to the rightmost tree. Joe the Gardener is standing with an 14 empty bucket next to the well. 7:2 He plans to water all the trees, one full bucket per two trees, and to get back to the well. What is the length of the shortest possible route for Joe? A baby alligator was 5 cm long at birth. In a year, it grew to be 25 15 cm. By what percentage did it 4:1 grow? 8.3. Mathematical Dominoes Problems 73

A 28-km-long road is split into three unequal parts. The distance between the centers of the first 16 and last parts is 16 km. Find the 2:2 length of the middle stretch of the road. Each of the two identical iron wires was formed into a chain. The first chain contains 80 identical links, and the second 17 one contains 100. Each link of the 7:5 first chain is 5 grams heavier than each link of the second one. What was the weight of each wire? A string of digits is written out in such a way that any two adjacent digits form a number divisible 18 either by 17 or by 23. The first 8:3 digit is 9. What could the 1001st digit be? Find all answers. It is known that it is not true that a fruka is both big and round. Which of these are correct: (a) Any fruka is small and not round. (b) Any fruka is small and has 19 corners. 8:2 (c) Any fruka is either not big or not round or both. (d) Any fruka is either not big or not round but not both. (e) If a fruka is big, then it is not round. 74 Ssession 8: Mathematical Dominoes Tournament

Kolya, who owns a supermarket chain, plans to start an ad campaign with four slogans: - Everything that is inexpensive tastes bad! - Everything that tastes bad is inexpensive! 20 - Everything that tastes good is 9:1 expensive! - Not everything that tastes good is inexpensive! A savvy marketing manager claims that two of these slogans say the same thing. Which ones? An Olympiad has 10 problems for which 5 points are given for every correctly solved problem and 3 21 are deducted for every unsolved 2:0 one. Teddy got 34 points. How many problems did he solve correctly? The floor of a square pool is covered with 900 square tiles of two colors, as shown in the picture. What is the positive difference between the numbers of 22 white and black tiles? 7:3

Inabox,thereare12marbles, identical in all but color: 6 red, 3 white, 2 green, and 1 black. 23 What is the smallest number of 5:1 marbles to take out of the box so that you end up with at least 3 marbles of the same color? 8.3. Mathematical Dominoes Problems 75

What is the greatest number of times a polyline made of 7 segments can intersect itself? (A polyline is a connected series of segments, each new one starting 24 at the endpoint of the previous 7:4 one. Common endpoints of segments don’t count as intersections. The first and the last segments do not have to be connected.) Fifty links identical to the one shown in the picture are used to form an open chain. The hole in each link is 12 mm long, and the thickness of the link is 3 mm. 25 How long is the chain? 6:4

3mm 12mm

Cut this shape into two identical pieces. (Cuts should follow grid lines and diagonals of small squares.) 26 4:2 76 Ssession 8: Mathematical Dominoes Tournament

If you pet a borogove, it becomes mimsy. If a borogove is mimsy, then a mome that is nearby would rath. Which of these are true: (a) If you do not pet a borogove, then a mome nearby would not rath. 27 (b) If you pet a borogove, then a 5:4 mome nearby would rath. (c) A mome that is far away cannot rath if a borogove is petted. (d) If a mome nearby is rathing, then some borogove is mimsy. Thetimethathaspassedsince10 hours before midnight last night is the same as the time that will 28 be left 2 hours from now until 0:0 midnight tonight. What time is it now? Samuel and Lucas were given two identical rectangles; each boy cut his rectangle into two pieces. Samuel got 2 rectangles, each 29 with a perimeter of 40 in., and 8:1 Lucas got 2 rectangles, each with a perimeter of 50 in. What was the perimeter of the original rectangle? Laura is twice as old now as Angela will be when Collette 30 turns the age that Laura is now. 3:2 Which of the girls is the oldest? Which is the youngest? Tom spies Jerry teasing him from 30 meters away and runs after him. How far apart will they be 31 in 5 minutes if Jerry runs 500 4:3 meters a minute and Tom runs only 450? 8.3. Mathematical Dominoes Problems 77

Two consecutive two-digit numbers were added, and then the digits of the sum were 32 reversed. The resulting number 7:6 was the greater of the two original numbers. What were the numbers? Amith has a pet monkey that likes munching on bananas. Every day she eats exactly twice her own weight of bananas, and every night she loses 2/3 of her weight. On such a diet, the 33 monkey is happy. One morning, 4:4 before going off on a 4-day vacation, Amith leaves 40 kg of bananas, which is just the right 4-day supply to keep the monkey happy. How much does the monkey weigh this morning? Threepeoplewereplayinga game. Each of them wrote down 100 different words, and then the 3 lists were compared. If a word appeared in 2 or more of the lists, it was crossed out from all lists. 34 Thefirstplayerwasleftwith61 8:0 unique words, the second with 80 words. What is the smallest possible number of words that the third player could have ended up with? Move 2 matches to make the equality correct. 35 3:1

The sequence of digits 123456789123..., whichhas 2011 digits total, is written out in a 36 row. Where in this row should 6:5 you put a “+” sign to make the smallest possible sum? 78 Ssession 8: Mathematical Dominoes Tournament

Seven knights and liars sit around the round table. Each of them states: “One of my neighbors is a 37 knight, and the other is a liar.” 6:1 How many knights are at the table? In a round-robin soccer tournament, each team plays every other team once. At one 38 such tournament, one-fifth of the 5:5 teams scored 0 points. How many teams took part in this competition? The elevator was broken, so Mr. Nathan the CEO had to climb up the stairs of his corporate skyscraper. It took him 10 seconds to run the flight of stairs 39 from the first floor to the second. 6:3 From then on, every new flight took him 1 second longer than the previous one. Between which two floors will Mr. Nathan the CEO be in 10 minutes?

8.4. Take-Home Problem Set Problem 1. Two brothers went mushroom-picking together. In the forest, they split up. There was a road going through the forest, and the brothers crossed it from time to time. By the end of the day, the older brother crossed the road 3 times as often as the younger brother. Did the brothers end up on the same side or different sides of the road? Problem 2. Said the devil to a lazy man: “Every time you cross this enchanted bridge, your money will double. For this advice, you will have to pay me 40 coins every time you cross it.” The lazy man crossed the bridge three times and ended up having no money at all. How many coins did he have before the deal? Problem 3. Emily had 24 dolls, 26 stuffed animals, and 25 cars. Eventu- ally, she decided to give these toys to her younger sister Rachel. To make it more fun, she started to present Rachel with two toys at a time, once a week: a doll and a car, or a doll and an animal, or a car and an animal. Whenever little Rachel received her gift of 2 toys, she would give Emily a toy in return. If she got a doll and a car, she would give back a stuffed animal; if she got 8.4. Take-Home Problem Set 79 a doll and an animal, she would give back a car; if she got a car and an animal, she would present a doll. (Initially, Rachel had enough toys to keep this exchange going.) Finally, Emily was left with a single toy. (a) For how many days did this exchange take place? (b) What was Emily’s last toy? Problem 4. The cubic die has numbers from 1 to 6 written on its six faces. The first time Sasha tossed this die, the sum of the numbers displayed on the four side faces was equal to 12. The second time, it was equal to 15. What number is written on the face that is opposite to the face with the number 3? Problem 5. The road between the villages of Holy and Smoke has mile- posts placed at every mile. One side of each post shows the distance to Holy and the other—the distance to Smoke. Peter noticed that the sum of all the digits on each milepost is equal to 13. How far is Holy from Smoke?

Session 9: Pigeonhole Principle

Today we will study a method called The Pigeonhole Principle. The name of this principle sounds funny, and the idea behind it will seem to be almost trivial. However, the principle itself is immensely powerful. It describes a pattern of reasoning that can be used to prove a wide variety of problems ranging from very simple to extremely advanced. Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

9.1. Math Warm-up Warm-up 1. Take a look at the sequence of sentences below: starting from a correct statement, we end up with the conclusion that 1=2.What is wrong with this proof? Suppose that x =1and y =1.Thenwecanwrite: x = y, x × x = x × y, x2 = xy, x2 + x2 = x2 + xy, 2x2 = x2 + xy, 2x2 − 2xy = x2 + xy − 2xy, 2x2 − 2xy = x2 − xy, 2(x2 − xy)=x2 − xy, 2=1.

9.2. Discussion of the Day: Pigeonhole Principle Let’s start by discussing methods in mathematics: what are methods and why do we need them? When working on different problems, certain types of proofs and certain reasoning patterns come up again and again. The most important and

81 82 Session 9: Pigeonhole Principle most frequently used proofs and patterns are often formalized and given names. Consequently, they can be reused over and over again like building blocks. When reasoning about a problem, we can use these blocks as handy shortcuts, without spending time on the intricacies of their proofs. Here is a good analogy: an expert handyman always arrives with a toolbox full of tools. When getting ready to work on a difficult task, he looks for the best tool for the job. Maybe he will have to try several tools before finding the right one—the one that will make the job easier, faster, and more enjoyable. It is hard to imagine what a handyman’s job would look like if he had to build a saw or a hammer from scratch every time before starting a new job. The Pigeonhole Principle, the method that we are going to learn today, is so intuitive that it seems almost trivial. Yet, it is a very effective problem-solving method that can be used to prove a lot of interesting and compelling results. The method is sometimes called “Dirichlet’s Box Prin- ciple” in honor of the French mathematician who was the first to formalize the idea. We start the discussion by presenting a problem to the children. The goal of it is to explain the intricacies of the Pigeonhole Principle using an example with specific numbers. Problem 1. Suppose that 6 pigeons occupy 5 pigeonholes. Is there anything that can definitely be claimed about the number of pigeons in the holes? Problem 1 Discussion. A student replies there must be a hole with 2 pigeons in it. I present a counterexample: if the first 3 holes contain 1 bird each and the fourth hole contains 3 and the fifth hole is empty, then none of the holes have exactly 2 birds. 1 1 1 3 0 Another student suggests that there will definitely be a hole with exactly 1 pigeon. However, this is not true as well. If the birds are huddling 3 per hole, there will be no hole with 1 pigeon. 3 0 0 3 0 Keeping the conversation going, we come to the following conclusion: whatever number we set on, we could fail to find a hole that contains exactly this many pigeons. What can we claim then? Since precise numbers do not work, we prob- ably should resort to a claim that uses the term “at least”. Let’s try this approach, as it looks promising. Can we claim that there is a hole with at least 6 pigeons? Not necessarily, since it may happen that each hole hosts fewer than 6 birds. How about a hole with at least 3 pigeons? Not necessarily, because the birds may sit 1 or 2 per hole. Will there be a hole with at least 2 pigeons in it? This time, the majority of students in the room nod “yes”. To prove the existence of such a hole, let’s use the proof by contradiction approach. Suppose that each hole is occupied by no more than 1 pigeon. (Please note that we cannot say “occupied by 1 pigeon” as 9.2. Pigeonhole Principle 83 some holes may be empty.) If this is the case, these 5 holes together contain no more than 5 pigeons. (See the picture.) <_ 1 <_ 1 <_ 1 <_ 1 <_ 1

<_ 5 However, we have 6 pigeons total. This fact contradicts our assumption! Therefore, at least 1 hole should contain more than 1 pigeon! Now that we discussed the specific case of 5 holes and 6 pigeons, we are ready to formulate the Pigeonhole Principle.

Pigeonhole Principle: Suppose that pigeons are sitting in pigeon- holes and there are fewer pigeonholes than pigeons. Then there will be at least one hole with at least two birds in it.

Pigeonhole Principle Proof: This “generic” principle can be proved similarly: if we assume no more than 1 bird per hole, then the total number of pigeons must be no more than the number of holes. However, we know that the number of pigeons is greater than the number of holes. We arrive at a contradiction.  Let’s practice the Pigeonhole Principle on several problems. Quite often, we will be able to find the solution by simply identifying what “pigeons” are and what “holes” are. It is worth pointing out that the students may suggest other perfectly correct solutions for some of the problems below. However, since our goal for today is to master a new technique, let’s finish the discussion of every problem by demonstrating the solution that uses the Pigeonhole Principle. Problem 2. At a party, 8 children each took a piece of candy from a candy jar that contains 7 different types of candy. Prove that at least 2 of these kids got candy of the same kind. Problem 2 Discussion. In this problem, let’s assume that the candy types play the role of pigeonholes and children play the role of pigeons. Let’s assign a pigeon (a child) to a pigeonhole (a candy type) if the child chooses this type of candy. We have 8 pigeons and 7 holes; thus, according to the Principle, there must be a hole with at least 2 pigeons in it. This means that there must be at least 2 kids who have candy of the same type. While this problem is not difficult and there are a lot of ways to solve it, the Pigeonhole Principle works really well for it. Problem 3. Sunny Hill Middle School has 400 students. Prove that at least 2 of them celebrate their birthdays on the same day. Problem 3 Discussion. For this problem, let’s present two solutions. The first is a proof by contradiction, and the second one is the Pigeonhole Prin- ciple. Both are correct, but the second one is shorter and more elegant. 84 Session 9: Pigeonhole Principle

Proof by contradiction: If no more than 1 student celebrates a birth- day on each specific day, then there should be no more than 366 birthdays altogether. However, there are 400 students in Sunny Hill. Thus, there must be at least 1 day when 2 or more students celebrate their birthdays. Pigeonhole Principle: The students’ birth dates play the role of pigeons, and the days of a year play the role of pigeonholes. There are 400 pigeons and 366 pigeonholes. Therefore, a pigeonhole (a day) can be found that has at least 2 pigeons in it (dates of birth). Problem 4. One million pine trees grow in a forest. It is known that no pine tree has more than 600,000 pine needles. Prove that at least 2 pine trees in the forest have the same number of pine needles. Problem 4 Discussion. Eva suggests a solution: “If 1 tree has 1 needle, another tree had 2 needles, and so on until 600,000, then we still have 4,000,000 trees left.” Unfortunately, her solution has a pitfall. How do we know that a tree with every assortment of needles can be found in this forest? Maybe a tree with 1 needle does not grow there. The same is true about any specific number of needles—it is possible that a tree with this many needles does not exist. Eva also forgets about a minor detail: there could be a tree with 0 needles. Her solution could be fixed. However, let’s solve this problem using the Pigeonhole Principle. Let’s pretend that the trees play the roles of pigeons. Two “pigeons” belong to the same “pigeonhole” if they have the same number of needles. The number of pigeonholes, 600,001, is less than the number of pigeons, 1,000,000. Therefore, there must be 2 trees that belong to the same pigeonhole (have the same number of needles). At this moment, Andrew asks whether he should use proof by contra- diction or the Pigeonhole Principle when working on problems of this kind. This question is important: let’s reiterate that the Pigeonhole Principle is a method, a handy shortcut. While each of these problems can be explained using proof by contradiction, a Pigeonhole solution would be shorter and easier to present. Problem 5. Fifteen girls have registered for the Girl Scouts summer camp. Some of them know each other, while others do not. Prove that two of the girls know the same number of campers. Problem 5 Discussion. The students readily suggest using the Pigeonhole Principle: the girls will be pigeons and all possible numbers of friend— pigeonholes. At this very moment, children get stuck: there are 15 pigeons and15pigeonholes(0,1,2,..., 14). Thenumberofpigeonsisthesameas the number of pigeonholes. We cannot apply the Principle Principle then! The children are puzzled, and so I throw out a hint: can all 15 pigeonholes be occupied at the same time? This hint is sufficient for a breakthrough. A student shouts out that if there is a girl who is friendly with all 14 kids, then everybody knows her and nobody can have 0 friends. Also, if there happens 9.3. Take-Home Problem Set 85 to be a girl with 0 friends, then nobody can be friendly with all 14 kids. Thus, the number of pigeons is, in fact, greater than the number of holes, and the Pigeonhole Principle can be applied.

Problem 6. Prove that from the first 101 powers of two (21, 22, ..., 2101)a pair of numbers can be found such that the difference of the two numbers is divisible by 100.

Problem 6 Discussion. The fact that we would like to prove seems to be very elusive. How can we claim anything about these big unknown numbers? However, let’s start reasoning. When would the difference of 2 numbers be a multiple of 100? Only when the last 2 digits of these numbers are the same. Therefore, only the last 2 digits matter. Let’s create 100 pigeonholes and tag them with the numbers 00, 01, 02, ..., 99. Let’s sort the powers of 2 as follows: the last 2 digits of a number would define its pigeonhole. This way, 2 numbers end up in the same hole whenever their last 2 digits are the same. Since we are placing 101 numbers into 100 pigeonholes, there will be a hole with at least 2 numbers in it. This means that the list 21, 22, ..., 2101 contains a pair of numbers whose difference is a multiple of 100.

Problem 7. Prove these stronger versions of the previous problem: (a) Prove that from the first 51 powers of 2 (21, 22, ..., 251)apairof numbers can be found such that the difference of numbers in the pair is a multiple of 100. (b) Prove that from the first 41 powers of 2 (21, 22, ..., 241)apairof numbers can be found such that the difference of numbers in the pair is a multiple of 100.

9.3. Take-Home Problem Set Problem 1. Cut the figure in the picture into three equal parts. (You can cut along the grid lines and diagonals of small squares.)

Problem 2. Wizard Land Middle School offers a new elective this year: an astrology class. Fifteen students have registered for this course. Prove that at least 2 of these students were born under the same zodiac sign. (There are 12 zodiac signs in total.) 86 Session 9: Pigeonhole Principle

Problem 3. Eight knights took part in a 3-contest tournament. They competed in archery, sword fighting, and lance throwing. For each contest, a knight was awarded 0, 1, or 2 points. Prove that at least 2 of these knights earned the same total number of points.

Problem 4. In a group of 12 politicians, some are supporting each other; some are not. Prove that it is possible to find 2 politicians in this group who have the same number of supporters within the group. (Note that “to support” is a mutual relationship: if A supports B, then B supports A.)

Problem 5. With a red marker, Margareta marked 3 points with integer coordinates on a number line. With a blue marker, Angelina marked a midpoint for every pair of red points. Prove that at least 1 of the blue points has an integer coordinate.

Problem 6. The halls of the Haunted Labyrinth can be walked to the right and upward only. Each room of the Labyrinth (marked by a circle) is inhabited by a magical creature—an elf, a leprechaun, or a fairy. If you pass through a room where an elf lives, he’ll give you 3 coins; if you pass through a fairy’s room, you’ll get 6 coins; and a leprechaun will give you nothing. Twelve kids enter the labyrinth. Prove that at least 2 will exit on the other side with the same number of coins.

Exit

Entrance

Problem 7. A team of three math circle students—Ashley, Betty, and Cindy—takes part in the “Best Logician” championship. Here is their challenge: - They enter an entirely dark room with a box of 2 red, 2 yellow, and 3 green hats. Each of them randomly chooses a hat, puts it on, and steps out of the room. Now, each student can see the color of her friends’ hats but is unable to see her own hat. - Next, Ashley will be asked to guess the hat color that she definitely is not wearing. She will have the choice of guessing the color or staying silent. After that, it will be Betty’s turn, and then Cindy’s. If the first guess is correct, the team wins; otherwise, the team loses. When Ashley is asked about the color she does not have, she chooses to stay silent. Next, Betty decides to stay silent as well. Now, it is Cindy’s turn. What should her reply be? 9.4. Additional Problems 87

9.4. Additional Problems Problem 1. Alexander randomly filled a 3×3 table with the numbers 0, 1, and 2 (one number for every cell). Then he counted all the row, column, and diagonal sums in this table. Prove that at least 2 of these sums are equal.

0 1 2 1 1 2 0 0 1

Problem 2. The city of Seattle has more than 5 million inhabitants. Show that 2 of these people must have the same number of hairs on their heads if it is known that no person has more than 1 million hairs on his or her head. Problem 3. Prove that out of any 11 numbers, 2 can be found such that their difference is a multiple of 10. Problem 4. Today, 70 students took 3 tests each—in math, English, and social sciences. The tests are scored on a scale from 1 to 4. Is it true that in this group there always be 2 students whose results are identical? (Simplified version: 20 students and 2 tests.) Problem 5. Alice took a red marker and marked 5 points with integer coordinates on a coordinate plane. Miriam took a blue marker and marked a midpoint for each pair of red points. Prove that at least 1 of the blue points has integer coordinates. Problem 6. The 7th-grade math circle student Emilio wrote a computer program for his house robot, Basil. Starting from 1, Basil should keep writing bigger and bigger numbers formed by 1’s: 1, 11, 111, etc. The program terminates when Basil writes a number that is a multiple of 19. Prove that the program will terminate in fewer than 20 steps.

Session 10: Geometric Pigeonhole Principle

Last time, we studied the Pigeonhole Principle—a simple but immensely powerful idea that can go a long way. Today, we’ll be learning how to apply it to geometric problems.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - Grid paper would come in handy for today’s session since several of today’s problems are problems on a grid.

10.1. Math Warm-up Warm-up 1. A piece of rope takes exactly 2 hours to burn from end to end, but it burns unevenly: some sections may burn faster, other—slower. How can you measure out exactly 1 hour and 30 minutes using 2 such ropes and a box of matches?

Warm-up 2. Do the same problem; however, now the challenge is to measure out 45 minutes using 3 such ropes.

10.2. Discussion of the Day: Geometric Pigeonhole Let’s start the discussion by presenting a problem.

Problem 1. What is the largest number of kings that can be placed on an 8 × 8 chessboard so that no 2 kings can attack each other?

Problem 1 Discussion. The discussion of this problem in my group usually follows the same route: a student comes to the board and demonstrates a

89 90 Session 10: Geometric Pigeonhole Principle regular placement of 16 kings similar to the one presented in the first picture below.

The student argues that this placement is the best since it is so uniform and since it is not possible to add more kings to this specific arrangement. However, it is easy to come up with a counterargument to this statement: other, less uniform, placements of 16 kings are possible as well. (See the picture on the right.) What if we could come up with such a tricky way to place 16 kings that we would be able to squeeze in 1 more? After kindling this discussion for some time, I suggest a hint: I highlight the 8 lines that split the grid into 16 2 × 2 squares. (See the picture.)

How many kings can be placed inside a single 2 × 2 square? Not more than 1 king, as 2 kings located on the same 2 × 2 square definitely put each other in check. Since the chessboard is made up of 16 such squares, it cannot indeed accommodate more than 16 kings altogether. Therefore, any solution with 16 kings demonstrates the best possible placement.

Let’s highlight the important moments of this simple and clever approach that we will be reusing over and over again. We came up with the solution that seemed to be the best; however, it was challenging for us to prove this fact. Indeed, with so many ways to put the kings on the board, how do we know that a better way cannot be found? Therefore, to prove that our solution is the best, we divided the board into several smaller sectors. Since each sector cannot fit more than 1 king, the total number of kings cannot be more than the number of sectors. Therefore, any solution with 1 king per sector is indeed the best possible one.

Problem 2. What is the largest number of kings that can be placed on a 9 × 9 chessboard so that no 2 kings can attack each other? 10.2. Geometric Pigeonhole 91

Problem 2 Discussion. This problem is definitely similar to the problem we’ve just discussed. Therefore, let’s try a similar approach: divide the board into several sectors that would each hold no more than 1 king. Then, ifwecancomeupwithaplacementthathas1kingineachofthesesectors, we will have the best possible solution! We already know that any 2 × 2 square cannot hold more than 1 king. Since a 9 × 9 square cannot be divided into 2 × 2 squares, let’s do the cuts as shown. We have 25 sectors total, each one having space for no more than 1 king. Therefore, it is impossible to put more than 25 kings on the board. At the same time, it is easy to find a way to place 25 kings. (We are leaving it to the reader to figure out how.) Problem 3. This is the map of Grid City. The lines are the roads that split the city into 2 km by 2 km square blocks. All the side street A 2 km 2 km 1 km are 1 km long. What is the biggest number of taxi stands that can be placed on the streets of Grid City so that any 2 taxi stands are located at least C 2.2 kilometers apart? (The distance between taxi stands is measured as “taxicab distance”, which is the smallest number of city blocks that it would B take to travel from one stand to another. For 1 km 2 example, the taxicab distance between point A and C is 6 kilometers, and between points A and B it is 7 kilometers.) Problem 3 Discussion. As in the previous problems, the children will easily come up with a way to place 9 stands. However, it will be difficult for them to prove that 9 is the best possible answer. The students will probably argue that each north-south street would hold no more than 3 stands. Therefore, 3 north-south streets would hold no more than 9 taxi stands total. The counterargument is that we are not using east-west streets at all. Could we possibly find a way to add an extra stand onto one of the east-west streets if we are creative enough with the placement of the 9 stands on the north-south streets? To come up with the rigorous proof, let’s try to use a familiar approach: divide the map into 9 sectors such that each sector would be able to hold not more than 1 taxi stand. Such a partition is presented in the picture: the streets are divided into 9 identical cross-shaped sectors. Since the maximal distance between any 2 points within a single cross is 2 miles, there should be no more than 1 stand 92 Session 10: Geometric Pigeonhole Principle per cross and no more than 9 stands altogether. One possible placement of 9 stands is shown in the same picture. (The taxi stands are marked by dots.) Problem 4. The landing dock of a space station is a 10×10 grid. A landed spaceship of the class “Dark Spectrum” would always occupy three squares of the grid that are shaped like the letter L, aligned with grid lines. (“L” can point in any direction.) Since space smugglers favor Dark Spectrum ships, you plan to install sensors that would help detect any landing Spectrum. (Sensors are installed 1 per square; a sensor triggers an alarm if a ship lands on it.) What is the smallest number of sensors sufficient to detect any landing Spectrum? Where should they be installed? Problem 4 Discussion. The answer to this problem, which is 50 sensors, is easy to come up with but is not as easy to justify. Let’s paint the dock in a checkerboard pattern. Then any pirate ship will be occupying at least 1 black square. Therefore, if we install sensors at all 50 black squares, we will be able to detect any landing ship. Next, we should prove that we cannot go with fewer than 50 sensors. Suppose that we cut the board into 25 2 × 2 squares. It is easy to see that every 2 × 2 square should have at least 2 sensors installed. Therefore, the entire board should have at least 50 sensors.

10.3. Take-Home Problem Set Problem 1. Place 6 positive numbers (not all equal) around the circle in such a way that every number is a product of its 2 neighbors. Problem 2. Divide the figure into 3 parts of the same shape and size. (All cuts should follow grid lines.)

Problem 3. A 10-mile by 10-mile square of Martian land is inhabited by 100 settlers from Earth. Each settler owns a plot that has the shape of a 1-mile by 1-mile square. More than a quarter of these settlers come from Seattle. Prove that at least 2 settlers from Seattle are neighbors. (Neighbors are those settlers whose plots share a side or a vertex.) Problem 4. Prove that if you pick 50 different numbers from the integers 1 to 98, then 2 of them must add up to 99. Problem 5. Sam and Brendon are playing Battleship on an 8 × 8 grid. Sam hides a single 4 × 1 battleship somewhere on the board. Brendon can 10.4. Additional Problems 93 pick squares on the grid and fire upon them. What is the smallest number of shots Brendon has to fire to guarantee at least 1 hit on the battleship? (In Battleship, a hit means a shot fired to a square that belongs to a ship.) Problem 6. There are 25 flies sitting on a table. It is known that out of any 3 of them, 2 can be found that are less than 1 foot apart. Prove that at least 13 of these flies can be swatted with a single strike of a fly swatter with a hoop of radius 1 foot.

Problem 7. Intelligent cacti from the planet Karellia are happy if they are planted at least 2 meters apart from each other. The Seattle zoo has an exhibit of Karellian cacti. The exhibit has a circular shape 20 meters in diameter, and 20 cacti have been planted there in such a way that they all are happy. Prove that is it possible to plant 1 more Karellian cactus in such a way that all the cacti will be happy.

10.4. Additional Problems Problem 1. Cowboy Joe fired 15 shots into a 4 × 4 carpet and made 15 holes in it. Is it always possible to cut a 1 × 1 square rug out of the ruined carpet that has no holes in it? (Bullet holes are tiny and point-like, but they don’t look good.) Problem 2. A scorpion cannot tolerate another scorpion if they are less than 2 meters apart. How many angry scorpions can cohabit a wireframe cube with side length 1 meters? (The scorpions measure the distance between 2 points along the edges of the cube.)

Session 11: Mathematical Olympiad I

Today is the day of our first in-circle mathematical Olympiad. The “Mathematical Olympiad” chapter (page 251) has a lot of information on organizing and running this type of competition. Today, we set out on an oral Olympiad. It is more interesting for children to participate in an oral contest than in a written one. Since the participants receive immediate feedback on their solutions, they can correct and perfect solutions during the contest. Besides, an oral Olympiad also presents a valuable opportunity for the teacher to discuss problems one-on-one with most of the students in the group. All these factors make an oral Olympiad quite an educational event.

Teaching supplies for this session: - Printouts of the Olympiad problems (one per student). - Prizes for the contest participants (optional).

11.1. Event of the Day: Mathematical Olympiad This Olympiad is composed of 9 problems. The problems are listed in an increasing order of difficulty (roughly) and printed in two sets: the first 6 problems in one set, the last 3 in another. The two additional problems are included as a safeguard against a bright and fast-thinking student who would solve everything quickly. At the start of the Olympiad, everybody gets the first set of problems. A student who solves any four of these problems receives the second set.

95 96 Session 11: Mathematical Olympiad I

For Teachers: Today’s problem set can be used for a written Olympiad as well. However, a written Olympiad should have fewer problems, and it is better to exclude the problems where the first version of the solution has a high chance of being incorrect.

Prior to handing out the problems, let’s emphasize several important rules of the upcoming contest. – An Olympiad is an individual competition. Therefore, no conversations with neighbors are allowed. – The problems can be solved and answered in any order, with up to three attempts per problem. – If all the teachers are busy talking to other pupils, the student should add his name to the waiting list on the board. For Teachers: We don’t have homework on the days of the Olympiads. Thus, this session does not include a work-at-home problem set. Stu- dents are welcome to work on the unsolved Olympiad problems at home.

11.2. Mathematical Olympiad I. First Set of Problems Problem 1. To begin, 25 sparrows sat in 2 bushes. Then 5 sparrows flew from the first bush into the second one, and 7 sparrows flew away from the second bush. After that, there were twice as many sparrows in the second bush as in the first one. How many sparrows were in each bush originally? Problem 2. How much time will it take for an ant to go around the outer perimeter of the figure composed of 3 squares? (See the picture.) The ant’s speed is 1 in 1 minute. (The exact placement of the smaller square is unknown.)

7 3 5

3

Problem 3. A wicked witch placed 7 apples in a circle. Of these, 3 apples are poisoned, and these 3 are located next to each other. You have a magic tester that can compare the poison levels in any 2 apples and tell you if one has more poison than the other. (If both apples are good or both are poisoned, the tester will show them as “equal”.) Show how you can leave with 2 good apples after using the tester only once. Problem 4. One tea bag can be used to brew 2 or 3 cups of tea. Mila and Lila each bought 1 box of tea bags. Mila brewed 57 cups and Lila had 83 cups of tea before the box ran out. How many tea bags are in a box? 11.4. Additional Problems 97

Problem 5. Can you fill an 8×8 board with natural (counting) numbers so that: - whenever 2 squares share a side, the numbers in these squares differ by 1and - whenever 2 squares can be connected by 1 move of a chess knight, the numbers differ by 3? Problem 6. The 25 pirates from the pirate ship “Shameful Shark” spent 2 days playing cards (and losing money) in a tavern on Valeo Island. On the first day, all 25 pirates lost different numbers of gold doubloons ranging from 1 to 25. (No 2 pirates lost the same number of doubloons.) On the second day, the same thing happened: all pirates lost different sums ranging from 1 to 25. The ship captain entered the total 2-day losses of each pirate into the ship ledger. Prove that the product of the 25 numbers in the ledger is even.

11.3. Mathematical Olympiad I. Second Set of Problems Problem 7. Two hungry number-eaters had numbers from 1 to 1,000,000 for lunch. The first number-eater ate all numbers that were divisible by 8 but not divisible by 11. The second number-eater ate all numbers that were divisible by 11, but not by 8. Which of the two monsters gulped more numbers down? Problem 8. According to the laws of the Kingdom of Chess, a piece can live on the chessboard as long as it stays on a square where it does not attack other pieces and is not under attack. Six surly rooks live on a chessboard. Can they find themselves squares to live in, in such a way that no chess knight will be able to settle on the same chessboard? Problem 9. We have 99 numbers written around a circle. It is known that in each pair of neighbors one number is divisible by the other. Prove that one can find a pair of numbers with the same property where these numbers are not neighbors.

11.4. Mathematical Olympiad I. Additional Problems Problem 10. Prove that 111111...1 (81 ones) is divisible by 81. Problem 11. Let’s call a 5-digit number unbreakable if it is not a product of 2 3-digit numbers. What is the longest possible continuous stretch of unbreakable numbers?

Session 12: Combinatorics I. Review

Combinatorics, a branch of mathematics that is devoted to the art of count- ing things, is an enjoyable topic that has many applications in mathematics and computer science. At the same time, working on a good combinatorics problem is as close to puzzle solving as math can get. For the next several lessons, we will be studying combinatorics. While we will learn several useful formulas, our primary goal is not to memorize them, but to develop an understanding of where these formulas come from. We also will be solving problems that promote understanding of combinatorics principles, not the direct application of the formulas. Thus, our goal is to teach children meaningful problem solving and to develop their combinatorial reasoning and intuition. Our first lesson is a review—we will go over several basic combinatorics principles like slot rule and permutations, and we will be practicing creative applications of these formulas.

Teaching supplies for this session: - Printouts of the in-class problem set (on page 105). - Printouts of the take-home problem set.

12.1. Math Warm-up Warm-up 1. Can you divide this figure into two identical pieces? (The figure is one-half of the well-known “Yin Yang” shape. It is formed by a half-circle of diameter 2R on top and two half-circles of diameter R on the bottom.)

99 100 Session 12: Combinatorics I. Review

Warm-up 2. Let’s use the second warm-up problem to refresh the stu- dents’ knowledge of factorials because we will be using factorials today. Depending on the level of your audience, you can be more or less detailed. Here is a sample set of questions you might ask: -Whatare10!, 100!, n!? 10! 100! n! - How do we simplify 9! , 95! , (n−2)! ? - How would you shorten the following expressions using factorials: 10 × 9 × 8 × 7 × 6, 100 × 99 ×···×45, n × (n − 1) ×···×(n − 7) × (n − 8)?

12.2. Discussion of the Day: Review of Combinatorics Techniques Slot Rule Problem 1. Polly is a talking parrot who speaks in 3-word sentences. A Polly’s sentence always starts with a pronoun, which is followed by a verb, and then by a noun. Polly knows: - 2 pronouns: I and WE, - 3 verbs: LOVE, WANT, and COOK, - 4 nouns: FOOD, CRACKER, FRIEND, and SHMOLLAR. How many different phrases can Polly the parrot say? Problem 1 Discussion. Let’s start constructing one of Polly’s sentences word by word. After Polly settles on a pronoun, she has 3 ways to extend it into a 2-word phrase by adding a verb. (For example, if Polly chooses the pronoun “I”, she can extend it into “I LOVE”, “I WANT”, “I COOK”.) Therefore, the number of her 2-letter phrases is 3 times greater than the number of 1-letter phrases. Thus, it is equal to 2 × 3=6. Similarly, for every 2-letter sentence, a noun can be added in 4 ways. Therefore, the number of 3-letter phrases is 4 times as big as the number of 2-letter ones. Thus, Polly can say 2 × 3 × 4=24phrases.

This problem about Polly the Parrot serves as an easy review of the slot rule—the core combinatorial problem-solving technique. The key idea of the rule is that if we have several slots which can be filled independently of each other, then the total number of ways to fill these slots is equal to the products of the number of options for each.

The next problem provides more slot rule practice.

Problem 2. Polly’s friend Dolly the Parrot can talk as well. A Dolly’s sentence always starts with an adjective, which is followed by a noun, and then by a verb: - 3 adjectives: HAPPY, HUNGRY, and LONELY, - 2 nouns: PARROT and CROCODILE, - 3 verbs: SINGS, CRIES, and WORKS. 12.2. Review of Combinatorics Techniques 101

(a) How many different sentences can Dolly the Parrot say? (b) Polly and Dolly are creating a two-phrase story. Each parrot contributes a sentence. How many different stories can they come up with?

Problem 2 Discussion. (a) This is another application of the slot rule, and the answer is 3 × 2 × 3=18. (The answer can be explained along the lines of the previous problem.) (b) This part is a bit trickier. Children usually reason that each Polly’s phrase can be extended by Dolly’s in 18 ways; therefore, they come up with the answer 24 × 18, which is incorrect. Indeed, the answer takes into account only the stories that start with a phrase by Polly. However, if Dolly’s phrase comes first, we get another 18 × 24 options. Thus, the final answer is 18 × 24 × 2 = 864.

Problem 3. Lady X has 3 different black skirts and 5 different jackets—3 blue and 2 green. She also has 10 different hats—6 blue and 4 green. Lady X’s outfit consists of a skirt, a jacket, and a hat of the matching color. In how many ways can Lady X choose her outfit?

Problem 3 Discussion. If we straightforwardly multiply the number of skirts by the number of blouses and by the number of hats (3 × 5 × 10), we get an incorrect answer. Indeed, this formula would count all possible combinations of hats and jackets, including the mismatched ones. In reality, Lady X can put on only a “blue jacket, blue hat” combination OR a “green jacket, green hat” combination. Therefore, the numbers of blue outfits and green outfits should be counted separately and added together. The number of blue outfits is 3 × 3 × 6, and the number of green ones is 3 × 2 × 4.The answer is 3 × 3 × 6+3× 2 × 4=78.

The goal of the previous problem is to remind us of the important role of addition in combinatorics. How do we know when to add and when to multiply? Suppose that an outcome can be thought about as a sequence of events happening one after another. In this case, we need to multiply together the options for each event. (For example, if we choose a green jacket AND follow by selecting a green hat, we multiply.) However, when the problem can be broken into several cases that are mutually exclusive, such as choosing a green outfit OR a blue outfit, we should add together the options for each case.

Permutations Let’s use the next problems to review another important concept that we studied in our Year 1 circle—permutations . (For a more detailed review of permutations and slot rule, the reader is referred to Year 1 [1].) 102 Session 12: Combinatorics I. Review

Problem 4. Let’s call a number super-odd if it is made of odd digits only. (For example, numbers the 5, 33, 13,573 are all super-odd.) How many 3-digit super-odd numbers with all digits different are there?

Problem 4 Discussion. In this problem, we have 3 slots that are to be filled with digits. However, this is not a “regular” slot rule problem: these slots cannot be filled independently of each other. For example, if digit 1 goes into the first slot, we cannot reuse it for the second or third. However, we can use similar reasoning. The number of ways to fill the first slot is 5 (we can use the digits 1, 3, 5, 7, 9). So, for every choice of a digit for the first slot, there will be 4 ways to settle on a digit for the second one. Thus, there exist 5 × 4=202-digit super-odd numbers made of different digits. Also, whichever way we chose to fill the first two slots, there will be 3 ways to settle on a digit for the third slot. Thus, the answer is 5 × 4 × 3=60.

This kind of reasoning works for an entire class of problems that are called permutation problems. A couple more examples of those are presented below.

Problem 5. Suppose that we want to have 10 girls sitting in 10 chairs placed in a row. In how many ways can we do it? Problem 5 Discussion. The answer is 10 ×9 ×8 ×7 ×6 ×5 ×4 ×3 ×2 ×1. Indeed, the first seat can be filled in 10 ways, the second—in 9 ways, etc. This formula can be shortened using factorial notation: 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1. Problem 6. How many ways are there to award 1st, 2nd, and 3rd place prizes among 100 contestants? Problem 6 Discussion. The answer is 100 × 99 × 98. Indeed, a candidate for the first place can be selected in 100 ways, for the second—in 99 ways, for the third—in 98 ways. Using factorials, we can rewrite the answer as 100!/97!.

Before we get to the general formula for permutations, let’s solve several exercises that illustrate the ideas that we just discussed. Problem 7. A damaged robot named R2 remembers 5 digits only: 1, 2, 3, 4, and 5. (a) How many 4-digit numbers can robot R2 write using these digits only? (b) How many 4-digit numbers with exactly 1 digit “3“ can it write? (c) How many 5-digit numbers with exactly 2 digits “3” that are 1 apart? (d) How many 4-digit numbers with all digits different? 12.2. Review of Combinatorics Techniques 103

(e) How many 4-digit numbers with all digits different that start with an odd digit? (f) How many 4-digit numbers with all digits different that end with an even digit? (g) How many 5-digit numbers with alternating odd and even digits?

Problem 7 Discussion. (a) We have 4 slots, with 5 options for each slot (5 digits). Thus, the answer is 5 × 5 × 5 × 5 = 625. (b) Let’s start by choosing a slot for the digit 3 and filling the rest of the slots afterward. If we place 3 into the first slot, there will be 3 slots left, with 4 options for each. Thus, there are 4 × 4 × 4=64numbers with 3 at the first position. Also, 3 can be at the second or third or fourth place. For each of these cases, the number of ways to fill the rest of the slots is 64. Therefore, the total is 4 × 64 = 256 numbers. (c) Let’s start by placing the 2 digit 3’s one apart and filling the rest of the slots afterward. These 2 digits can be set in 3 different ways: (3 _ 3 _ _), ( _ 3 _ 3 _), and (_ _3 _ 3). For each placement, there are 4 × 4 × 4=64 ways to fill the rest of the slots. Thus, the answer is 3 × 64 = 192. (d) This is a permutation problem: 5 × 4 × 3 × 2 = 120. (e) The first digit can be selected in 3 ways. Whichever way we choose the first digit, there are 4 ways to choose the second, 3 ways to choose the third, and so on. Thus, the answer is 3 × 4 × 3 × 2=72. (f) Let’s start building the number backward from the last digit, which can be selected in 2 ways. After we settle on the last digit, we can choose the third one in 4 ways, the second one in 3 ways, and the first one in 2 ways. Thus, the answer is 2 × 4 × 3 × 2=48. (g) Suppose that the 1st, 3rd, and 5th digits are odd. We can choose these 3 digits in 3 × 3 × 3=27ways. After that, we can fill the rest of the spots in 2 × 2 ways. Thus, there are 27 × 4 = 108 numbers of this kind. Next, suppose that the 1st, 3rd, and 5th digits are even. There are 2 × 2 × 2 × 3 × 3=72numbers like this. The final answer is 108 + 72 = 180.

Permutation Problems, Generalized Let’s use Problems 4 to 6 to sum up what all the permutation problems share in common: - We start with a collection of different objects. - We choose several of them in such a way that the order of these objects matters: as we are selecting the objects, we are arranging them in a row, one after another, in the same order as we pick them. So, if the same collection of objects is selected in 2 different ways, we end up with 2 distinct rows of objects. This is the “order matters” selection. - Finally, let’s introduce two variables: n for the total number of objects and k for the number of objects we would like to choose. 104 Session 12: Combinatorics I. Review

Permutation problem: “From the set of n different objects, we would like to choose k in such a way that the order matters and the objects cannot repeat.Inhowmanywayscanthisbedone?” Because this problem occurs over and over again in a wide variety of theoretical and practical settings, mathematicians came up with a special notation for it. Notation: P (n, k) stands for the number of ways to arrange k objects out of n.1 (“Arrange” is an abbreviation for “choose in such a way that the order matters.”) Thus, in Problem 4 we computed P (5, 3), in Problem 5 we calculated P (10, 10), and in Problem 6 we found P (100, 3).

How to compute P (n, k) Applying the same reasoning as in Problems 4 to 6, we can deduce that: - P (n, k) should be expressed as a product of k multiplicands because we have k slots. - The first multiplicand of this product must be n. - Each new multiplicand must be 1 smaller than the one before. Therefore, the formula for the number of ways to arrange k objects out of n is P (n, k)=n × (n − 1) × (n − 2) ×···×(n − k +1).

This formula needs more clarifications. First, how do we know that the last multiplicand must be n − k +1? Because we can see the pattern: the first multiplicand is n, the second is n − 1,thethirdisn − 2, etc. Following the pattern, we conclude that the k-th is n − (k − 1) = n − k +1. Next, this formula is quite lengthy. However, today’s warm-up problem helps us realize how to shorten it down: n! P (n, k)= . k!

For Teachers: Let’s emphasize one more time that understanding of the permutation formula is way more important than it’s memorization. Therefore, it is a good idea to encourage younger kids to think in terms of the slot model and write their answers as lengthy and more intuitive “20 × 19 × 18 × 17 × 16” products rather than more efficient “20!/15!” formulas.

1 Another popular notation is nPk. 12.3. In-Class Problem Set 105

The best way to master combinatorics techniques and to gain intuition is to practice. Therefore, we continue the lesson with the in-class problem set.

12.3. In-Class Problem Set

Problem 1. (a) In how many ways can you punch the number 206 on the digital lock (see the picture) if you start from 666 the button in the center and every next button should be 6 00 6 touching the button you just punched? 6 002 6 (b) The same question for number 2,066. 6 00 6 (c) The same question for number 2,006. 666

Problem 2. Gabby the Gnome has 3 cloaks of different colors: blue, green, and brown. He also has 5 different hats: 3 yellow and 2 red. Finally, he owns 6 different pairs of shoes: 2 yellow and 4 red. Gabby is selecting an outfit: a cloak, a hat, and a pair of shoes. In how many ways can he do it if he wants the color of his shoes to match the color of his hat?

Problem 3. Extraterrestrials from the planet Mumba-Umba use 4 letters: “A,” “B,” “M,” and “U.” Any combination of these letters makes a word in the Mumba-Umba language. (For example, AUUA and UUU are both words of the Mumba-Umba language.) (a) How many 2-letter words are in this language? How many 3-letter words? (b) How many 3-letter words with all letters different? (c) How many 4-letter words that end with A? (d) How many 4-letter words with all letters different that start with a vowel? (e) How many 4-letter words with all letters different that end with a consonant? (f) A Mumba-Umba first name is a 4-letter word with 2 consonants in the center and 2 vowels on the sides. (Examples: AMBA, UMMA.) How many different first names do Mumba-Umbians have? (g) A Mumba-Umba last name is a 3-letter word with all letters different and with a vowel in the center. (Examples: BUM, UAB.) How many different last names do Mumba-Umbians have?

Problem 4. Mollie’s mom would like to buy 16 balloons. The balloons come in 3 colors: red, green, and blue. In how many ways can she buy these balloons if she would like to get at least 4 of every color? 106 Session 12: Combinatorics I. Review

12.4. Take-Home Problem Set Problem 1. Mr. and Mrs. Jones have 6 kids—3 boys and 3 girls. Today, a photographer is taking pictures of the family. (a) In how many ways can the daughters be seated in a row for a photo shot? (b) In how many ways can the kids be seated in a row so that all the girls are on the left and all the boys are on the right? (c) In how many ways can the Jones kids be seated in a row so that girls and boys alternate? (d) All the girls must be sitting together, all the boys must be sitting together as well, and the parents must be either together in the center or one on each side.

Problem 2. In how many ways can you match 40 wizards and 40 brooms in such a way that every wizard gets a broom?

Problem 3. (a) A palindromic number is a number that reads the same backward and forward. (For example, 13,531 is palindromic.) How many 5-digit numbers are palindromic? (b) How many 5-digit numbers are palindromic and consist of distinct digits? (c) How many 5-digit numbers consist of distinct digits and end with 2? (d) How many 5-digit numbers are odd and consist of distinct digits?

Problem 4. One Mathematician has a spouse and three kids, and all members of that family celebrate their birthdays on the same day. Once, the Mathematician said: – When our first child was born, the sum of the ages in our family was equal to 45. A year ago, when our third child was born, it was equal to 70. And now the sum of the ages of our 3 kids is equal to 14. Determine the ages of the Mathematician’s kids.

Problem 5. (a) A 2×2 square is divided into 4 1×1 squares. We would like to cover it with 8 right triangles (2 triangles per square) that are either black or white. A “right” covering is the one where two neighboring triangles never have the same color. (Two examples of “right” coverings are presented below.) How many “right” coverings are there?

(b) Answer the same question for a 3×3 square. 12.5. Additional Problems 107

12.5. Additional Problems Problem 1. In how many different ways can you trace the word BOOM on the drawing below?

O M M O

OOOO B

O M M O

Problem 2. An ogre has 25 prisoners in his dungeon. (a) In how many ways can he choose 1 for lunch and 1 for dinner? (b) The ogre promised his bride to free some of his 25 prisoners. In how many ways can he choose 2 prisoners to set them free?

Problem 3. In how many different ways can you trace the word BOOGIE in the table below? (You can move from cell to cell if they share a side or a corner.)

E I G I E I G O G I G O B O G I G O G I E I G I E

Problem 4. In how many ways can you arrange digits 1, 2, 3, 4, 5, 6, 7 into a 4-digit number so that: (a) all digits are different and the number starts with an even digit? (b) all digits are different and the number ends with an odd digit?

Problem 5. You are in the robot-selling business on the Tau Ceti planet, where you own a small store. You just received a big shipment of household robots and nanny robots. You also have 1 medical robot and 1 supervisor robot—you would like to sell them as well. Your store window display has space for 6 robots. In how many different ways can you arrange this display if: (a) you plan to display household and nanny robots only? (b) you plan to display 5 household and nanny robots, and the medical robot? (c) you plan to display 5 household and nanny robots, and 1 robot of another type? 108 Session 12: Combinatorics I. Review

Problem 6. Mary, who wrote an online computer game, plans to assign every user a unique password. (a) Her current plan is to have passwords that are 8 symbols long and are all made from lowercase letters a, b,andc. How many different passwords can Mary generate? (b) Her friend Brandon suggests this modification: use 8-symbol pass- words made from the letters a, b, and c, with exactly 1 capital letter. How many times more passwords can Mary generate now? (c) Finally, Mary decides that her passwords will be 9 symbols long, made from 1 digit (0 to 9) and from the letters a, b, and c, with exactly 1 capital letter. How many times more passwords can she generate compared to the original plan? Session 13: Combinatorics II. Combinations

So far, we’ve been working on permutation problems—problems where the order of objects matters. The goal of today’s lesson is to introduce combinations—problems where we need to count the number of outcomes where the order does not matter. Compared to permutations, combinations are much trickier to explain because it is much more difficult for children to see where the formula for combinations comes from. Therefore, we will spend the first part of this lesson exploring the combinations rule, and we will try to give the children plenty of “hands-on” experience with it. Next, we will introduce and explain the combinations formula, and we will finish the lesson by solving a bunch of combination problems.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

13.1. Math Warm-up Warm-up 1. Drury Lane has 10 houses; all houses are evenly spaced. Mulberry Lane has 100 houses, with all houses being evenly spaced as well and with the distance between neighboring houses being the same as on Drury Lane. How much longer would it take to walk from the first to the last house on Mulberry Lane than on Drury lane?

Warm-up 2. Is it possible that several numbers add up to 10 and the sum of their squares is less than 0.2?

Warm-up 3. How would you define 0!?

109 110 Session 13: Combinatorics II. Combinations

13.2. Discussion of the Day: Combinations Combinations and the Letter-Eating Bird Let’s start the discussion by solving a collection of problems about a letter- eating bird.

Problem 1. Every morning, a letter- eating bird named Nancy comes to a neighborhood store that sells letters of the PRIME word PRIME. She chooses a 3-letter word made out of 3 different letters of PRIME and brings this 3-letter word to her children for dinner. Since Nancy’s children want every meal to be distinct from all of their previous meals, she tries not to repeat the words that she buys. (For words, the order of the letters matters: for example, PRI and RPI are 2 different words, even though they are constructed from the same letters.) How many different meals can Nancy buy for her children at the PRIME shop?

PR I

Problem 1 Discussion. This problem can be solved by a simple applica- tion of the slot rule: the first letter of the word can be chosen in 5 ways, the second—in 4 ways, and the third—in 3 ways. Thus, the answer is P (5, 3) = 5 × 4 × 3=60. (This is a problem on permutations ;weare already familiar with this type of problem.)

Problem 2. Nancy’s children became spoiled. They claim that if 2 words are made from the same set of letters, they taste the same. (For example, the words PRI and IRP would have the same taste for them.) How many different meals can Nancy buy at the PRIME shop for her children now?

Problem 2 Discussion. Note the difference: in the new problem, it doesn’t matter which letter was chosen first and which was last. As long as Nancy leaves the store with the same set of letters, they are considered by the kids to be the same meal. This type of problem is unfamiliar to us, and we do not know how to solve it. Nancy has fewer options to choose from with this new criteria. By how many? 13.2. Combinations 111

We can start solving this problem by trying to list all of the different meal options that Nancy’s children have now. If we list the sets correctly, we get 10 different combinations of letters: “P, R, I”, “P, R, M”, “P, R, E”, “P, I, M”, “P, I, E”, “P, M, E”, “R, I, M”, “R, I, E”, “R, M, E”, “I, M, E”. (One way to create this list in an orderly fashion would be to start from writing down all of the combinations that include the letter P, then to follow up with all the combinations that include R, but not P. After that, there’s just one combination left: IME.) What would be a more efficient way to get to the same answer? Let’s take a look at 1 of these 10 sets of letters—“P, R, I,” for example. Out of these 3 letters, 6 different meals for unspoiled children can be made. You can get this number by listing all the possibilities (see the picture below) or by using the permutations formula for the number of ways to arrange 3 letters: P (3, 3) = 3 × 2 × 1=6.

P PRI, PIR, IRP, IR IPR, RIP, RPI

Similarly, any other meal for the spoiled children would correspond to 6 meals for the unspoiled ones. We see that the number of meals for the spoiled children is 6 times less than the number of meals for the unspoiled ones. Therefore, to get the number of all different sets of 3 letters one has to: - calculate the number of ways to arrange 3 letters out of 5: P (5, 3) = 5 × 4 × 3 - and divide this quantity by the number of ways to arrange 3 letters: P (3, 3) = 3 × 2 × 1. Thus the answer is P (5, 3) ÷ P (3, 3) = 5 × 4 × 3/(3 × 2 × 1) = 10.

The same approach would work for the entire collection of similar prob- lems about the letter-eating bird.

Problem 3. Suppose that Nancy goes to a store that sells the letters A, B, C, D, E, F. In how many different ways can Nancy choose 4 letters for her spoiled children at this store?

Problem 3 Discussion. Let’s use the same approach: if the children were unspoiled and the order of the letters mattered to them, then Nancy would have been able to buy P (6, 4) = 6 × 5 × 4 × 3 different 4-letter words. However, the order does not matter; therefore, all that Nancy cares about is the set of 4 letters. Thus, she has much fewer choices: each unique set of letters (“A, D, E, F,” for example) corresponds to 4 × 3 × 2 × 1=24 words that can be made from these letters. Therefore, there are 24 times 112 Session 13: Combinatorics II. Combinations as many words made up of 4 letters than 4-letter sets. Thus, the answer is P (6, 4)/P (4, 4) = 6 × 5 × 4 × 3/(4 × 3 × 2 × 1) = 15. Poor Nancy can buy only 15 different meals at this store!

Combinations Generalized We do understand that the bird and the letters were just an example. Now, we are going to generalize the problem to objects of any kind. First, let’s emphasize the important difference between two ways of counting the number of variants. - Suppose that our process goes as follows: as we are selecting the objects, we are placing them in a neat row, one next to another, in the same order as we pick them. In this case, if the same collection of objects is selected in 2 different ways, we end up with 2 distinct rows of objects. This model describes the selection when order matters. This process, which we already studied, describes a permutations model. - Assume now that we use a different process: as we are selecting the objects, we are tossing them into a big bag. Therefore, while it matters for us which objects end up in the bag, it is not important in which order these objects were tossed in. Such a model describes the selection when order does not matter. This type of problem reappears in a wide variety of different real-life scenarios. It is so important that it has a name of its own—it’s called combinations. Combination problem: From a set of n different objects (letters, in our case), we would like to choose k objects in such a way that the order does not matter.Inhowmanywayscanthisbedone? Notation: Combinations problems have their unique notation as well. If we want to choose k objects out of n, we write C(n, k). It is often called n “n choose k”. The other popular notations are and C k n k

More Practice on Combinations Let’s spend some time learning to recognize, name, and solve problems on combinations.

Problem 4. In how many ways can we buy 3 different pastries from a pastry shop that carries 6 different types of pastries? Problem 4 Discussion. In this problem, the order we buy the pastries in does not matter. As long as we leave the shop with the same set of pastries in a box, we count it as the same variant. 13.2. Combinations 113

Therefore, this is a problem on combinations. The answer is equal to C(6, 3). To calculate the answer, let’s use the technique that we already developed: - If the order mattered, the answer would have been 6 × 5 × 4. - However, since the order does not matter, we have to divide by the number of ways to arrange 3 pastries: 3 × 2 × 1.Thus,theansweris6 × 5 × 4/(3 × 2 × 1) = 20. Problem 5. A certain magician has 10 magical ingredients. Any 6 of these ingredients combined can be brewed into a magic potion. How many different magic potions can this magician make? Problem 5 Discussion. Since the order in which we add ingredients does not matter, this is a “10 choose 6” combination problem. The answer is C(10, 6) = 10 × 9 × 8 × 7 × 6 × 5/(6 × 5 × 4 × 3 × 2 × 1). The last answer is lengthy. There is a way to shorten this formula: 10 × 9 × 8 × 7 × 6 × 5 can be replaced by 10!/4! . Therefore, the formula can be rewritten as: 10! C(10, 6) = 6!×4! . For Teachers: Using factorials makes the formula for combinations more compact. However, the longer formula is easier for children to learn since it reflects the computational idea. The right approach is probably to keep presenting both formulas until students become proficient with them.

Problem 6. Six girls—Ashley, Betty, Cindy, Donna, Eve, and Fiona—are members of the school math club. In how many different ways can you pick 4 of these girls to participate in a math contest? Problem 6 Discussion. Since the order in which we choose girls does not matter, this is a problem on combinations: “6 choose 4”. The answer is C(6, 4): 6! C(6, 4) = 6 × 5 × 4 × 3/(4 × 3 × 2 × 1) = . 4! × 2! Problem 7. Nancy, the letter-eating bird, goes to a store that sells the letters A, B, C, D, E, G. She would like to buy a 3-letter word made out of distinct letters that appear in alphabetical order. In how many ways can she do it? Problem 7 Discussion. A minor insight is needed for solving this problem: every set of 3 letters corresponds to exactly 1 arrangement of these 3 letters in alphabetic order. For example, the combinations “G, A, F” is ordered as AFG, the combination “F, B, C”—as BCF, etc. Therefore, the number of alphabetic orderings is equal to the number of ways to choose 3 letters from 6. Therefore, the answer is “6 choose 3”: C(6, 3) = 6 × 5 × 4/(3 × 2 × 1) = 20. 114 Session 13: Combinatorics II. Combinations

For Teachers: If your students are ready to use the generalized com- binations formula, you are welcome to introduce it: n! C(n, k)= . k! × (n − k)! We are not going to use it here since we want the material to be accessible for younger readers.

For Teachers: What should an answer to a combinatorial problem be: a formula, like 100 × 99 × 98, or a number (numerical value of such a formula)? We always insist that students should accompany their numerical answers by formulas. A formula illustrates the logic behind a solution and makes it much easier to track mistakes.

13.3. Take-Home Problem Set Problem 1. Is it possible that a fraction with the numerator smaller than the denominator is equal to another fraction with the numerator greater than the denominator?

Problem 2. Tom’s dad built a 9-board-long fence, which Tom’s mother painted white. Tom, who has 3 different cans of paint—red, green, and blue—would like to decorate the fence. (a) If he paints every second board (boards 2, 4,...),inhowmanywayscanhedoit? (b) If he paints every second board and if exactly 1 of the boards should be red, in how many ways can he do it? (c) If he paints every board, if exactly 3 boards should be red, and if the fence should be symmetrical, in how many ways can he do it?

Problem 3. The Sunny Hill Middle School girls’ gymnastics team has 20 students, with Masha and Sasha being the only 7th graders. How many different ways are there to choose 8 girls to participate in a meet if at least 1 of the 7th graders has to be included?

Problem 4. Someone chose 10 points on a plane such that no 3 points are on the same line. How many triangles with vertices in these points are there? 13.3. Take-Home Problem Set 115

Problem 5. (a) In how many different ways can 13 girls be seated in a row? (b) In how many different ways can 13 girls be seated in a row if 3 of these girls—Ashley, Betty, and Cindy—would like to sit next to each other? (They can sit next to each other in any order.) (c) In how many different ways can 13 girls be seated in a row if 2 of these girls—Masha and Dasha—do not want to sit next to each other?

Problem 6. Several equilateral triangles have been made out of wood and fixed on a wall. We then fitted a piece of string around them. (See the picture.) Prove that if the string forms a triangle, then that triangle is equilateral.

Session 14: Mathematical Auction

Today, students will be competing in a Mathemat- ical Auction tournament. Mathematical Auction is an exciting team contest. The game starts with a period of problem solving that is followed by a round of solution trading. The teams bid, scheme, and strategize for the right to present the solutions to the problems. For our students, Auctions top the list of their favorite tournaments. The detailed rules of the game can be found in the “Mathematical Auc- tion” chapter (page 235).

For Teachers: Make sure that you spend enough time familiarizing yourself with the Auction rules. The game has some turns and twists, and it is not a good idea to get lost in the middle.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - Printouts of the Mathematical Auction problem set (one per stu- dent). - Craft matchsticks for the Warm-up problems (optional). - Grid paper would come in handy since several of the auction prob- lems are set on a grid. - Prizes for the contest participants (optional).

117 118 Session 14: Mathematical Auction

14.1. Math Warm-up Warm-up 1. In each of these problems, move one match to make a correct equation. (The matches show Roman numerals.)

14.2. Event of the Day: Mathematical Auction Game Planning the Class Time A mathematical contest usually requires more time than a lecture. Moreover, an Auction cannot be stopped midway without the risk of making students unhappy. Therefore, the teacher should plan the time well on the day of a contest. Your students are, probably, already familiar with the rules of the game. (Year 1 [1] includes several Auctions.) If not, plan to allocate extra time for explaining the rules. Approximate timeframe for today’s game is 5 minutes for refreshing the rules and formation of the teams, 30 minutes for problem solving, and another 30 minutes for the actual auction. The total running time of the game is close to an hour.

The Contest After the rules have been explained and the children have been split into 2 teams, the game starts. The teams receive problems, and the students start working on them. When problem-solving time is over, team names are announced, and team captains are introduced. The teacher fills in the headers of the score table with the team names. For Teachers: A mathematical auction is a contest. Moreover, auc- tion problems are open-ended. Therefore, the solutions to the auction problems are not published in this book. 14.3. Mathematical Auction Problems 119

For Teachers: For an important comment about the solution of Prob- lem 3, check the Answers section.

For Teachers: You can set the price of each problem in this Auction to 100 shmollars. In this case, each team should have 200 shmollars at the start of the game.

14.3. Mathematical Auction Problems Problem 1. In the country of Shmolrandia, they use 1-, 2-, 5-, and 10- shmollar coins. Using several of these coins and also parentheses and arith- metic operation signs (“+”, “−”, “/”, “∗”), you can construct a mathematical expression. The price of such an expression would be the total value of the coins used in it. Write such an expression that is equal to 2,009 and that costs as little as possible. A team has a stronger solution for this problem if it can come up with a less expensive expression. Problem 2. Cut a 10×10 square into as many “brackets” (see the picture) as possible:

A team has a stronger solution for this problem if it can fit more brackets. Problem 3. Sixteen points are located at the vertices of a square grid (see the picture). What is the smallest number of points that can be erased from this picture in such a way that no 4 of those that are left would form asquare? ......

A team has a stronger solution for this problem if it has a solution with fewer points erased. Problem 4. On an infinite chessboard, draw a shape of the biggest possible area such that: - The shape is bounded by a line that follows grid lines and does not cross itself. - The shape contains not more than 9 black squares. 120 Session 14: Mathematical Auction

A team has a stronger solution for this problem if it can draw a shape with a bigger area.

14.4. Take-Home Problem Set Problem 1. Solve the encrypted problem: (AA + AA +1)× A = AAA. (The same letters stand for the same digits.) Problem 2. Can you come up with two convex quadrilaterals such that the first one is located inside the second one and the sum of the diagonals of the first one is bigger than the sum of the diagonals of the second one? (A quadrilateral is convex if all of its angles are less than 180°.) Problem 3. Two travelers started from A to B on foot. The first trav- eler walked half of the distance at 4 miles/hour and the second half at 6 miles/hour. The second traveler walked half of the time at 4 miles/hour and the rest of the time at 6 miles/hour. What was the average speed of both travelers? Who will arrive at B first? (The average speed is calculated as total distance divided by the total time used for travel.) Problem 4. Arowofnumbers1,2,..., 100iswrittenontheboard. Each minute, a professor erases 3 numbers next to each other and replaces them with numbers that are one bigger. Can the professor make all these numbers be equal to 1,000? Problem 5. Roberto has 13 foam bricks of size 1×1×2. (a) Can he glue them into a solid 3×3×3 cube without a 1×1×1 corner? (b) Can he glue them into a 3×3×3 cube with a 1×1×1 hole in the middle?

Problem 6. Barons, dukes, and counts at Prince Lemon’s court started dueling each other. Each duel resulted in a fatality, and, strangely enough, barons would only kill dukes, dukes would only kill counts, and counts killed only barons. It is also known that no one won in more than one duel. In the end, only Baron Orange was left alive and victorious. What was the title of the first victim if originally Prince Lemon had 100 courtiers?

Problem 7. Several jewelry boxes contain 2,000 pearls altogether. Prove that you can remove some pearls and some boxes so that all the remaining boxes contain the same number of pearls and the total number of remaining pearls is at least 100. Session 15: Combinatorics III. Complements. Snake Pit Game

In combinatorics, mastery comes with practice. Therefore, this lesson is organized as follows: we will spend the first 15 minutes discussing the simple but important problem-solving technique of complements.Fortherestof the lesson, we will have problem-solving practice. To make it more fun, we will organize this practice as a Mathematical Snake Pit Game. The rules of the game can be found on page 247.

Teaching supplies for this session: - Printouts of the take-home problem set. - Snake Pit problems, one set per team. - Snake Pit score tables, one per team. (A score table is easy to make. For a sample table, consult the rules.) - Snake Pit answer key, one per teacher. (The answer key for this game can be found in “Solutions” section.) - Craft matchsticks (optional, for the Warm-up).

15.1. Math Warm-up For today’s Warm-up, we keep working with matchstick puzzles.

Warm-up 1. Move exactly 3 matches to get 4 squares (no loose ends and no overlapping matches).

121 122 Session 15: Combinatorics III. Complements. Snake Pit Game

Warm-up 2. Move exactly 2 matches to get 4 squares (no loose ends and no overlapping matches).

15.2. Discussion of the Day: Complements Problem 1. Out of 15 employees of the “Fix My Roof!” corporation, 5 are roofers, and 10 are managers. How many ways are there to choose a team of 5 employees to fix a leaking roof if the team should include at least 1 roofer?

Problem 1 Discussion. Our goal is to count all teams that include 1 or 2 or 3 or 4 or 5 roofers. The first idea that comes to mind is to calculate the number of teams for each possible number of roofers and then to add the results together. For example, there are C(5, 1) × C(10, 4) teams of 1 roofer and 4 man- agers, and there are C(5, 2) × C(10, 3) teams of 2 roofers and 3 managers. Thus, the formula for the answer is

C(5, 1) × C(10, 4) + C(5, 2) × C(10, 3) + C(5, 3) × C(10, 2) + C(5, 4) × C(10, 1) + C(5, 5) × C(10, 0).

However, this formula looks clumsy, and the numerical answer is not easy to calculate. The good news is that there is a better way of solving this problem. Let’s start by calculating the following 2 quantities: - the number of all 5-employee teams, which is C(15, 5), - the number of 5-employee teams that include no roofers, which is C(10, 5). Do you see how these 2 quantities could help? Their difference is equal to the number of teams that have at least 1 roofer! (See the picture.) It is precisely the quantity that we are looking for!

All Teams

teams teams with without a at least one roofer roofer 15.2. Complements 123

Thus, the alternative formula for the same answer is C(15, 5) − C(10, 5). This formula is not only more compact, but it is also much easier to compute:

C(15, 5) − C(10, 5) = 15 × 14 × 13 × 12 × 11/(5 × 4 × 3 × 2 × 1) − 10 × 9 × 8 × 7 × 6/(5 × 4 × 3 × 2 × 1) =3,003 − 252 = 2,751.

When working on this problem, we applied the complement prin- ciple. We used the fact that the complement and the original set together add up to the total number of possibilities. This way, we were able to express a difficult-to-calculate quantity through the difference of two easier ones—the total and the complement.

Problem 2. In how many ways can one choose 4 cards out of a deck of 52 in such a way that at least 1 ace would be chosen?

Problem 2 Discussion. We introduce two solutions: the first one does not use complements, and the second one does. Solution without complements: “At least 1 ace” means either 1 or 2 or 3 or 4 aces. Let’s count the number of ways to choose cards for each of these options and sum up all the answers: - four cards, 1 ace included : C(4, 1) × C(48, 3), - four cards, 2 aces included: C(4, 2) × C(48, 2), - four cards, 3 aces included: C(4, 3) × C(48, 1), - four cards, 4 aces included: C(4, 4) × C(48, 0). The total is

C(4, 1) × C(48, 3) + C(4, 2) × C(48, 2) + C(4, 3) × C(48, 3) + C(4, 4) × C(48, 0).

Instead of computing the value of this formula, let’s get to the second solution. The solution that uses the complements principle: To count the sets of cards with 1 ace, we: - count the total number of sets, - count the number of sets without any aces. The difference between these 2 quantities will be the number of sets with at least 1 ace:

C(52, 4) − C(48, 4) = 52 × 51 × 50 × 49/(4 × 3 × 2 × 1) − 48 × 47 × 46 × 45/(4 × 3 × 2 × 1).

This number, which is equal to 76,145, is much easier to calculate using the complements formula than using the first formula. 124 Session 15: Combinatorics III. Complements. Snake Pit Game

Our next activity is the problem-solving game on combinatorics. Dur- ing this game, students will get plenty of practice with different types of combinatorics problems, including complements.

15.3. Activity of the Day: Snake Pit on Combinatorics Mathematical Snake Pit Game is a fast-paced problem-solving game. To- day’s Snake Pit is composed of 3 sets of problems (3 snakes). The children will be working their way through these problems, scoring points for correct answers.

Snake Pit, Snake 1 The Neanderthal man Foma was able to make 5 sounds: the vowels O and A and the consonants R, K, and F. A word in his language is any combination of these sounds. Problem 1. Foma reserved all 5-letter consonant- only words for the names of dangerous animals— RRRFF and FRFKF, for example. How many dangerous animals can Foma name? Problem 2. The name of a harmless animal is formed from 4 letters with 2 vowels in the center—RAOK or KAAO, for example. How many harmless animals can Foma name? Problem 3. Foma plans to use 4-letter words with alternating vowels and consonants to name his future sons. For example, RAFA and AROR are possible names for them. How many sons can Foma name? Problem 4. To name his future daughters, Foma plans to use 5-letter words that are made up of a double-R and 3 vowels. For example, RRAOA, ARROA, or AARRO could be girls’ names. How many daughters can Foma name? Problem 5. Foma calls a word “magic” if it reads the same forward and backward. For example, AKA and FRRF are magic words. How many words in his language are 5-letter magic words with a vowel in the center? Problem 6. Foma uses 5-letter words that end with a double-A and have exactly 3 vowels to describe food. For example, ARRAA, ROFAA, and FROAA could be the names of different dishes. How many words for food does Foma have? Problem 7. How many 5-letter words are there in Foma’s language such that the letters standing next to each other are different? 15.3. Snake Pit on Combinatorics 125

Problem 8. How many 5-letter words are there in Foma’s language that include at least 1 letter A?

Snake Pit, Snake 2 Problem 1. A group of 10 hikers is planning a backpacking trip. They need to choose a group leader, a coordinator, and a sweep. (A sweep is a person hiking last in the group and keeping count of the hikers.) In how many ways can they do it? Problem 2. While on the trail, the 10 hikers decide to send a delegation of 3 into a nearby village to buy snacks for the group. In how many ways can they choose this delegation? Problem 3. There are 11 kids in the Smith family: 6 girls and 5 boys. In how many ways can Mr. Smith choose a group of 2 girls and 3 boys to do the chores? Problem 4. There are 11 kids in the Smith family: 6 girls and 5 boys. Two girls, Annie and Fannie, just quarreled. In how many ways can Mrs. Smith choose a group of 4 girls and 2 boys if she does not want Annie and Fannie to be in this group together? Problem 5. Find the number of triangles with vertices in the marked points.

Problem 6. There are 12 kids who would like to stand in a circle for a Maypole Dance. In how many ways can they do it if 2 of them, Abigail and Fiona, would like to stand next to each other? Problem 7. There are 10 merchants in the city of Burgerhoff. Two of them belong to the Bakers Guild, 5 are members of the Goldsmith Guild, and the rest are Traders. The Burgerhoff town council has 5 open positions—3 senior counselors and 2 junior counselors. In how many ways can these positions be filled if every guild plans to claim 1 senior position? Problem 8. How many ways are there to split 9 kids into 3 teams of 3?

Snake Pit, Snake 3 Problem 1. How many 5-digit numbers do not contain any zeroes? (It is fine to leave the answer as an expression.) Problem 2. How many 5-digit numbers have at least 1 zero? (It is fine to leave the answer as an expression.) Problem 3. Out of a group of 12 hikers, 4 know where to go, and 8 don’t. How many ways are there to choose a team of 4 hikers? 126 Session 15: Combinatorics III. Complements. Snake Pit Game

Problem 4. Out of a group of 12 hikers, 4 know where to go, and 8 don’t. How many ways are there to choose a team of 4 that includes at least 1 hiker who knows where to go? Problem 5. A cat and a dog are planning to take a ride on a train that has 10 cars. They do not want to sit in the same car or in the 2 cars that are next to each other. In how many ways can they choose the cars? Problem 6. Pirates Ash, Bash, Cash, and Dash have 7 identical gold coins. In how many ways can they divide these coins if each pirate must get at least 1 coin? Problem 7. How many ways are there to place a black and a white rook on an 8 × 8 chessboard so that the rooks do not threaten each other? (It is fine to leave the answer as an expression.) Problem 8. How many ways are there to place a black and a white king on an 8 × 8 chessboard so that the kings do not threaten each other? (It is fine to leave the answer as an expression.)

15.4. Take-Home Problem Set Problem 1. Three karate masters come to the martial art school where 20 students are apprenticing in karate. The school teacher must choose 3 students to pair up with the masters for individual sessions. In how many ways can these 3 pairs be chosen? Problem 2. There are 20 kids and 3 counselors in Camp Colman, located on the left bank of the river. In how many ways can they choose a group of 10 to visit Camp Orka, which is located on the other bank if at least 1 counselor should stay in Camp Colman? Problem 3. We would like to count 6-digit numbers with at least 1 even digit. How many such numbers are there? Problem 4. In how many ways can you arrange the digits 1, 2, 3, 4, 5 into a 5-digit number such that: (a) All the even digits are placed next to each other. (b) The even digits are separated from each other by at least 1 odd digit. Problem 5. In a 1,000×1,000 grid-aligned square, several border-to-border lines have been traced along the grid lines. The rectangles of the resulting pattern have been colored in checkerboard order. Prove that the total area of all black rectangles is an even number.

Problem 6. Several segments have been marked on a line. The left half of each segment has been colored red, the right half—blue. It turns out that 15.4. Take-Home Problem Set 127 all the left halves form 1 continuous red segment, and all the right halves form 1 continuous blue segment. The red segment is 20 cm longer than the blue one. Prove that out of the original segments it is possible to find 2 such that 1 will be at least 40 cm longer than the other.

Session 16: Combinatorics IV. Combinatorial Conundrum

During the past several lessons, we have been learning combinatorial rules and principles. We learned a couple of formulas as well; however, our primary goal was not to memorize the formulas but to develop an understanding of where these formulas came from. By now, the students have had enough practice to understand that a variety of techniques can be applied to the same combinatorics problem. The real art is to be able to construct the best combinatorial model of the problem, the one that would generate an efficient and elegant solution. Thus, our goal was to teach them meaningful problem solving and to develop their combinatorial reasoning and intuition. The topic of today’s lesson is closely aligned with this goal. We will discuss several combinatorial problems of the types we have not seen before. We will demonstrate how an insightful way of thinking about a problem would allow us to restate it as a different (yet familiar) problem that we know how to solve.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - Craft matchsticks (optional, for the Warm-up).

16.1. Math Warm-up Warm-up 1. Move two matches to turn the fish.

129 130 Session 16: Combinatorics IV. Combinatorial Conundrum

Warm-up 2. Move one match to turn the donkey.

Warm-up 3. Move two matches so that this cow is looking to the left.

16.2. Discussion of the Day: Combinatorial Craftiness The first three problems showcase one example of combinatorial craftiness —the art of transforming a more difficult problem into an easier one.

Problem 1. How many distinct arrangements of the letters F, B, I, S, P, Y, D, O, G are there?

Problem 1 Discussion. The problem is straightforward; the kids quickly come up with the answer: 9 × 8 × 7 × 6 ×···×2 × 1=9!.

Problem 2. In how many ways can the same nine letters F, B, I, S, P, Y, D, O, G be arranged to contain the word DOG? (For example, the arrangement B, I, F, S, Y, D, O, G, P contains the word DOG.)

Problem 2 Discussion. The children suggest the answer 7 × 6! (which is equal to 7!) and offer the following explanation: first, list all the letters except D, O, and G. (There will be 6! ways to do it.) Next, insert “DOG” into 1 of the 7 possible spots. (For example, if the 6 letters form the sequence “SPYFBI”, then we can insert DOG as DOGSPYFBI, SDOGPYFBI, and so on. (See the picture.) Thus, the answer is 6! × 7=7! S PYF B I

DOG DOG DOG DOG DOG DOG DOG

Problem 3. In how many ways can the same set of letters F, B, I, S, P, Y, D, O, G be arranged so as to contain the words DOG and SPY? (Example: B, S, P, Y ,I,F,D, O, G.) 16.2. Combinatorial Craftiness 131

Problem 3 Discussion. Paulina suggests listing the letters F, B, and I (it can be done in 3 × 2 × 1 ways) and then inserting DOG and SPY into the spots between the letters. This seems to be a long shot since DOG and SPY can be together or can be separate; also, they can come in this order or in reverse order. Instead, let’s get back to Problem 2 and take a different look at it. Suppose that instead of 9 letters we have 7 tokens: the first 6 tokens come with the letters F, B, I, S, P, and Y on them, and the last one has the word DOG on it. (See the picture.) FB I SPYDOG Now, the original problem can be restated as follows: “In how many ways can these 7 tokens be rearranged?” This new problem is easier: 7 objects can be rearranged in 7! different ways. (And, yes, we get the same correct answer!) Would this new approach work for Problem 3 as well? Yes, it would! Suppose that we have 5 tokens: the first 3 with the letters F, B, I, and the last 2 with the words SPY and DOG. Then all we need is to find the number of ways to rearrange these 5 tokens—the answer is 5!. FB ISPY DOG

This was our first demonstration of how combinatorial problems can be transformed into each other. Now, it’s time to discuss the next group of problems.

Problem 4. The school gymnastics team has 8 girls. In how many ways can we choose 3 girls to be a team treasurer, a team coordinator, and a team captain?

Problem 4 Discussion. This is a simple permutations problem: the trea- surer can be selected in 8 ways. After that, the coordinator can be selected in 7 ways, and the captain—in 6 ways. Thus, the answer is 8 × 7 × 6. (Alternative: P (8, 3) = 8!/5!.)

Problem 5. The school gymnastics team has 8 girls. In how many ways can we choose 3 of these girls to participate in a meet?

Problem 5 Discussion. This type of problem is familiar to us as well. As in the previous problem, we have to select 3 girls. However, this time the order does not matter: whether we choose “Ashley, Betty, Cindy” or “Cindy, Betty, Ashley”, the result is the same since the same 3 girls will go to the meet. Thus, we are talking about combinations here. Therefore, the correct answer is 8×7×6/(3×2×1) = 56. (An alternative way to write this answer is C(8, 3) = 8!/(5! × 3!).) 132 Session 16: Combinatorics IV. Combinatorial Conundrum

Problem 6. Which number is bigger: the number of ways to choose 3 girls from a team of 8 or the number of ways to choose 5 girls from the same team? Problem 6 Discussion. The first reaction is: “Five is bigger than 3; thus, there are more ways to choose 5 girls.” So, I ask: “What is bigger: the number of ways to choose 3 girls for the meet or the number of ways to choose 5 girls to stay home?” Now, Bella exclaims that to choose 3 for the meet is THE SAME as to choose 5 to stay home. Thus, the number of ways to choose 3 girls out of 8 is the same as the number of ways to choose 5 girls out of 8! We illustrate this useful fact with a drawing: the check marks indicate the 3 girls that will head for the meet, and crosses indicate those 5 who will stay home. This way, it is very easy to see that every set of 3 girls corresponds to a complementing set of 5 girls.

✔ ✘ ✘ ✔ ✔ ✘ ✘ ✘

A student asks if applying the combinations formula would prove that these two quantities are equal? Thus, we run a short calculation: the number of ways to choose 5 girls out of 8 is (8 × 7 × 6 × 5 × 4)/(5 × 4 × 3 × 2 × 1). Canceling 5 × 4,weget(8 × 7 × 6)/(3 × 2 × 1), which is exactly the number of ways to choose 3 girls out of 8. Thus, indeed, the formula also proves that these numbers are the same.

The problem above illustrates a very important idea:thenumber of ways to choose k objects from a set of n objects is the same as the number of ways to choose n − k objects from the same set.

Let’s move on to the next group of problems. Problem 7. Little Alex has 3 orange and 5 blue beads. How many distinct patterns can he make out of these beads? (A pattern is a string of 8 beads. For example, OOBOBBBB and BBBBOBOO are 2 different patterns.) Problem 7 Discussion. Mary states that the answer to this problem must be 28. Why? Because each of the 8 positions can be filled in 2 different ways. Immediately, she corrects herself—this would be true if we had plenty of beads of each kind. Next, Vadim comes up with 23 × 5.Why23?Because there are just 3 orange beads. Why 5? He is not sure. This answer is not correct either. To give the kids a push, I suggest getting back to the problem of selecting 3 girls for the meet. Let’s introduce the new system for keeping track of the girls: give orange cards to the 3 girls who will go, and give blue cards to those 5 who will stay. I modify the drawing: replace 3 check marks 16.2. Combinatorial Craftiness 133 by 3 orange circles, and replace 5 crosses by 5 blue circles. Next, I invite the kids to take a good look at the drawing.

B O B O O B B B

This is an Aha! moment—the kids start seeing the similarity between the two problems. The row of 8 girls, with 3 of them holding orange cards and 5 holding blue cards, is the same as the row of 8 beads with 3 of them orange and 5 blue. Therefore, the number of ways to make patterns of 3 and 5 beads is the same as the number of ways to choose 3 objects from 8. These problems are identical, and the answers are the same: 8 × 7 × 6/(3 × 2 × 1). (Alternative: C(8, 3).)

Therefore, the number of ways to make a pattern of k objects of one kind and n-k objects of another is the same as the number of ways to choose k objects from n.

Problem 8. Downtown MathHattan has a grid pattern, with 4 streets going east-west and 6 going north-south. All streets are one-way: a car can go north or east. We are located at corner A (the school) and are planning to take a taxi to head for corner B (the movie theater). How many ways are there for the taxi to get from A to B?

B

A

Problem 8 Discussion. Max points out that this problem can be solved step by step. We could gradually calculate the number of ways to reach every intersection, starting from the closest to corner A. This approach is correct; however, it would be nice for us to find a shortcut. Suppose, for example, that the grid is 100 × 100; in this case, it would take us forever to solve the problem in this way. Let’s attack this problem by answering the following series of questions: - How long would a route from A to B be (we measure it by the number of blocks)? 134 Session 16: Combinatorics IV. Combinatorial Conundrum

- How many horizontal and vertical segments could there be on such a route? - Can we come up with an effective notation for these routes? (Basically, this notation should work like a set of directions: given the directions, we should be able to retrace the route.)

B

A

The answers to these questions are going to help us to find the solution. First, let’s observe that any route from A to B has length 8 and is composed of 5 horizontal and 3 vertical segments. Next, let’s decide that we are going to describe a route using two letters: U for “up” and R for “right”. In this case, the black and dotted routes in the picture would correspond to the strings URURURRR and RRURRURU. Do these strings remind us of something? Yes, this is a reincarnation of the problem about all possible patterns from 8 beads with 5 beads of one color and 3 of another. In the MathHattan problem, we have to find all possible patterns made up from 3 letter U’s and 5 letter R’s. Thus, the answer to this problem is C(8, 3) = 8×7×6/(3×2×1).

So, surprising as it sounds, we have 3 beautiful and distinct combinatorics problems that are all described by the same model. We finish the discussion by adding two cute modifications to the previous problem. Can you solve these problems?

Problem 9. Your goal is to get from point A to point B. However, this time you want to visit the corner where your favorite ice cream shop is located (see the picture). How many different routes can you take?

B

Ice Cream

A

Problem 10. Your goal is to get from point A to point B. However, you would like to avoid the corner where your enemy, Rowdy Rick, usually hangs out (see the picture). How many different routes can you take? 16.3. Take-Home Problem Set 135

B

Rowdy Rick A

16.3. Take-Home Problem Set Problem 1. Strangestun Air Force has 10 spy planes. (a) On Monday, 4 of these 10 planes should fly a secret mission to Fingalia. In how many ways can these 4 planes be chosen? (b) On Tuesday, 4 of these 10 planes should fly a secret mission to Tartaria, 4 planes—to Rosalia, and 2 planes—to Santinia. In how many ways can these planes be chosen and assigned to the missions?

Problem 2. (a) How many different patterns can you make from 10 precious stones— 4 sapphires and 6 rubies? (A pattern is a distinct sequence of stones.) (b) How many different patterns can you make from 4 sapphires, 4 rubies, and 2 emeralds? (c) How many different patterns can you make from 4 sapphires, 3 emeralds, 4 rubies, and 1 onyx?

Problem 3. Ashley, Betty, and Cindy were working on a set of problems. To add some zest, they agreed that the child who is the first to solve a problem receives 4 pieces of candy, the second child receives 2 pieces of candy, and the third child receives 1 piece of candy. As a result, each child solved all the problems, and there were no ties. The children claim that each of them received 20 pieces of candy. Prove that they are mistaken.

Problem 4. Tim the Ant lives on a 3D cubical grid (lattice) with dimen- sions 4 × 4 × 1 (see the picture). In how many ways can Tim crawl from the lower left front corner (Point A) to the upper right back corner (Point B) of the lattice if he wants to take the shortest route possible? 136 Session 16: Combinatorics IV. Combinatorial Conundrum

Point B

Point A

Problem 5. (a) A coin is tossed 20 times. How many different outputs (sequences of heads and tails) can you get? (b) A hoppy rook stands at the leftmost square of a 20-square-long strip. In a single hop, the rook can jump to the right over any number of squares. In how many different ways can the rook hop to the last square of the strip? (Examples: The rook can get there in one 19-square-long hop, or in one 2-square-long hop followed by one 15-square hop, and by one 2-squares hop, and so on ....)

Problem 6. Let’s call a counting number “cute” if it is smaller than any other counting number with the same sum of digits. What is the 200th cute number?

16.4. Additional Problems Problem 1. Downtown MathHattan has a grid pattern—it has 6 east-west streets and 9 north-south streets. All streets are one-way: a car can go north or east. (a) How many different routes are there from your house to the movie theater? (b) How many different routes are there from your house to the movie theater that pass through the Lucky Corner? (c) How many different routes are there from your house to the movie theater that avoid Unlucky Corner? (d) How many different routes are there from your house to the movie theater that pass through the Lucky Corner and avoid Unlucky Corner? 16.4. Additional Problems 137

Downtown Mathhattan

Movie Theater Lucky Corner Unlucky Corner

Your House

Problem 2. (a) In how many ways can you place 7 different coins into 3 pockets? (b) In how many ways can you place 7 identical coins into 3 pockets?

Session 17: Magic Squares and Related Problems

Today’s lesson about magic squares is a combination of a theoretical discus- sion and a hands-on activity.1 We will be constructing magic squares and exploring a whole bunch of interesting problems that naturally arise from this activity. These problems will highlight important ideas and illustrate several creative and useful problem-solving techniques. We will start the lesson with a short detour into the history of magic squares. We will follow with the hands-on activity of constructing the squares. Next, we will present and solve several interesting problems about these squares. Finally, we will discuss other types of magic squares: squares of bigger size, multiplicative squares, etc. The more advanced students will probably sail through the hands-on part. However, magic square problems will still be interesting and challenging for them. Teaching supplies for this session: - Several sets of cards with numbers from 1 to 10. (These cards will come in handy for constructing magic squares. You can use cards from games like Uno or simply a deck of playing cards.) - Painter’s tape. (This is optional: the tape will be useful for a visual demonstration of the double counting problem-solving technique.) - Printouts of the take-home problem set.

17.1. Math Warm-up For today’s warm-up, let’s use the math puzzle that will illustrate another creative combinatorial insight. Warm-up 1. In how many ways can you write a number that contains no 0’s and has the sum of its digits equal to 6? Warm-up 1 Discussion. This is a challenging problem, and students come up with several different answers. Which one is right?

1This lesson follows Mark Saul’s presentation on magic squares [15].

139 140 Session 17: Magic Squares and Related Problems

To figure out the correct answer, we ask the kids to solve several easier versions of the same puzzle: the sum of the digits that is equal to 2, to 3, and to 4. Working on these easier problems, the students start seeing the pattern in the answers. However, it takes us some time to explain and justify this pattern. For the answer and the explanation, check the “Solutions” section.

17.2. Discussion of the Day: Magic Squares from 1 to 9 Definition. A magic square is a square grid filled with numbers, where the numbers in each column, each row, and each diagonal all add up to the same number. This number is called the magic constant of the square.

History: For hundreds and hundreds of years, magic squares have been considered a fascinating and entertaining outlet for creating mathematical knowledge—as well as a source of divination and magic. The first record of magic squares dates back to ancient China, more than 3,000 years ago. From China, magic squares most likely traveled to India, the Arab countries, and Europe. In all these countries, magic squares were used in philosophy, alchemy, astrology, and art. For example, this 4×4 magic square appears in the 15th-century painting of Albrecht Durer, the famous German artist. (The magic constant of this square is equal to 34. The numbers 15 and 14 in the bottom row indicate the year the painting was created—1514 AD.) At the same time, mathematicians took a serious interest in researching the properties of magic squares. 16 3 2 13 They extended magic squares to 3 dimensions, came up 5 10 11 8 with a series of rules that could be used to construct magic squares, and so on. Today, magic squares are 9 6 7 12 studied in relation to several branches of mathematics. 4 15 14 1 A lot of math hobbyists have treated and still treat magic squares as a source of both enlightenment and amusement. Young Benjamin Franklin, the future president of United States, entertained himself by devising 8×8 and 16×16 magic squares.

So, what are we waiting for? Let’s construct our own 3 × 3 magic square! The silliest way to make a magic square is to put the same number into every cell of the grid. To make the problem more interesting, let’s assume from now on that all the numbers in our magic squares should be different. I tell the children that we will be constructing a 3×3 magic square using all the numbers from 1 to 9. I split them into small groups (2 or 3 students each) and hand out the cards. Each group receives 9 cards: all cards ranging from 1 to 9. (If you are using a deck of 52 playing cards, an ace can serve 17.2. Magic Squares from 1 to 9 141 as the number 1.) The final goal for each group is to arrange its set of cards into a magic square. We will be moving toward this goal in gradual steps. The first challenge is to construct a square with equal sums across all rows. As these squares are being constructed, we discover that row sums are the same in all groups—they are equal to 15. When asked why, the children come up with the explanation: the sum of the numbers in all 3 rows is equal to the total sum of all the numbers in the squares, which is 45 (45 = 1 + ···+9). Since all 3 sums must be the same, the sum across each row should be equal to one-third of the total, which is 15. Thus, we just learned how to calculate the magic constant of any square: we simply divide the total sum of all the numbers by the number of rows (or columns)! The next challenge is to modify the square to set all column sums to be equal as well. Since by this time the children already know what the magic constant is, this task does not take long. The last challenge is to fix the sums on the diagonals. This part is the most difficult one. Therefore, you may need to help the students by pointing out which card needs to be placed in the most strategic position—in the central cell. After each group finishes constructing its square, I invite the group representatives to draw them on the board. (Some of the possible squares are shown below.) This collection of squares immediately triggers a discussion.

4 9 2 6 1 8 6 7 2 3 5 7 7 5 3 1 5 9

8 1 6 2 9 4 8 3 4 Question 1. Why do all the squares on the board have the same number in the center? Discussion. We will provide two explanations of this fact, each demon- strating a very important idea. The first one will be using the constructive trial and error approach to eliminate all possible candidates, except the number 5. The second explanation, which is shorter and more elegant, will illustrate an extremely useful double-counting technique. - Constructive trial and error. Once we check all possible candidates for the number in the center, we will prove that nothing but 5 works. Suppose that the number 9 is in the center. Where can the number 8 go then? If we place 8 in a corner, it will share a diagonal with 9; if we put it on a side—it will share a row or a column with it. Then the sum across this diagonal (or row or column) will be at least 8+9=17,whichisway more than the magic constant of 15. Therefore, 9 cannot be in the center. Can 8 be in the center? No, since it will have to share a row, a column, or a diagonal with 9. For the same reason, neither 7 nor 6 can be in the center. (Both 7+9and 6+9are greater than 15.) 142 Session 17: Magic Squares and Related Problems

How about 1? If 1 is in the center, where should 2 go? Wherever 2 goes, the sum of 1 and 2 is 3. To get this sum to 15, it needs to be complemented by 12. However, 12 does not belong to our table. Using the same logic, we can explain that 2, 3, or 4 cannot be in the center. Therefore, 5 is left as the only possible candidate for the central square. - Double counting. Let’s concentrate on 4 sets of numbers—numbers in the middle row, the middle column, and the two diagonals. The numbers in each set add up to the magic constant 15. Therefore, the total sum of these 4 sets of numbers should be 4 times bigger: 4 × 15 = 60. Since the middle row, the middle column, and the two diagonals intersect, the central square has been counted more than once. It has been counted 4 times, while all the other numbers in the table were counted exactly once. (See the picture below.) Therefore, this sum is equal to the sum of all the numbers in the table plus 3 copies of the number in the center. The total sum of all the numbers in the table is 45. Therefore, 60 − 45 = 15 is equal to 3 times the number in the center. Thus, the number in the center is 15/3=5.

For Teachers: Sometimes, understanding the double-counting ap- proach does not come easily. To help the children visualize the solution, I have a roll of blue painter’s tape on hand. (Painter’s tape sticks to a whiteboard but does not leave any residue.) I draw an empty 3×3 table on the board and apply 4 strips of tape to it, as in the picture above. This way, it is very easy for the children to see that the central cell has been counted 4 times, while all the other cells have been counted once. A tape is way more visual and palpable than a marker. Also, by the end of the lesson the children get tired; tape comes as a welcoming reprieve that helps the idea to sink in.

Question 2. Take a look at all the magic squares on the board—each square can be transformed into another one by rotation, reflection, or a combination of these operations. Why are all these squares so similar? Discussion. We already know that 5 has to be in the center. Now, let’s explain why 1, 3, 7, and 9 cannot be positioned at the corners. Each corner number belongs to 3 different groups—the row, the column, and the diagonal. However, for each of the numbers 1, 3, 7, and 9, we can bring the sumto15in2 ways only: - 9 and (1, 5) or (2, 4), - 7 and (2, 6) or (3, 5), - 3 and (4, 8) or (5, 7), - 1 and (5, 9) or (6, 8). 17.3. More on 3 × 3 Magic Squares 143

Therefore, 1, 3, 7, and 9 should be placed on the sides, and 2, 4, 6, and 8 should be in the corners.

Using this knowledge, let’s see how many different magic squares we can construct. We start by drawing a blank 3 × 3 square and placing 5 in the central cell. Next, we start filling the rest of the cells. Suppose that we decide to start from the upper-right corner. Suppose that out of 4 candidates, the numbers 2, 4, 6, and 8, we picked number 2. Number 8 has to go in the opposite corner. We are now left with 2 empty corners and with 2 numbers—4 and 6. We can position 6 in 2 ways—clockwise or counterclockwise from 2. After that, we have no choice in where to place 4, 1, 3, 7, and 9. This process is reflected in the picture below:

2 2 6 2 6 2 6 7 2 5 5 5 5 1 5 9 8 8 8 4 8 3 4

As you can see, we have little flexibility when constructing a 3 × 3 magic square. First, there are 4 ways to fill in the first corner. After that, there are just 2 ways to fill the corner next to it. That is it—we are out of choices! This explains why there are just 4×2=8different magic squares! Moreover, they are not so different because each square can be rotated (or flipped and rotated) into another. We are finished with exploring 3 × 3 magic squares built out of the numbers 1 to 9. Still, there is a lot more to explore when it comes to magic squares.

17.3. More on 3 × 3 Magic Squares I ask each group to set aside the card with the number 1, and I hand out cards with the number 10 instead. Can a magic square be built from the cards with the numbers 2 to 10? Pretty soon, several students have their AHA! moments: if all the numbers in the original 1–9 magic square are increased by 1, the result will be a 2–10 magic square. Therefore, there exist 8 2–10 magic squares as well! I pose a few more questions: Question 1. What is the magic constant of the new square? Question 1 Discussion. Each number became 1 bigger. Therefore, the sum in each row became bigger by 3. The new magic constant is 15+3 = 18. Question 2. We have just created a new magic square by adding 1 to each entry of the original square. Can you think of other ways to create new magic squares? Question 2 Discussion. First, we can use addition. If we add the same number to all the entries of a magic square, the new square will be magic as well. The second idea is to use multiplication. If we multiply all the entries of a magic square by the same number, the new square will be magic as well. 144 Session 17: Magic Squares and Related Problems

Also, we can add magic squares to each other, and we can even multiply these squares by various numbers before adding them—the squares that we get will all be magic.

17.4. Magic Squares Extended Next, if there is time left, we can discuss other types of magic squares. How about larger and smaller magic squares? Do 2 × 2 magic squares exist? We leave it to the reader to prove that all entries of a 2 × 2 magic square must be the same.

Do large magic squares exist? Indeed, they do. For example, we started this lesson by presenting a 4×4 square. It is also possible to construct larger squares—5×5, 6×6, 1,000,000×1,000,000, and so on. Mathematicians have invented algorithms for constructing squares of all sizes!

Can we come up with a magic square that uses multiplication instead of addition? Such a square, if found, would be called a multiplica- tive magic square. Given a regular 3 × 3 magic square, how can it be transformed into a multiplicative one? The idea is simple: replace each number by 2 raised to this power. For example, write 24 instead of 4, 25 instead of 5. It is left to the reader to justify that we get a multiplicative square indeed. And also this approach generates a bunch of questions: - If you use another number as a base, would you get a multiplicative square? - If you already have a multiplicative square, would you get another one if you add a number to each entry? How about multiplying each entry by a number? - Can you add multiplicative squares? Can you multiply them?

17.5. Take-Home Problem Set Problem 1. Can a 3 × 3 magic square be constructed from the first 9 prime numbers? Either present such a square or explain why such a square is impossible.

Problem 2. Prove that in any 3 × 3 magic square the sum of the numbers in the corner cells is equal to the sum of the numbers in the side cells. (In the picture, the side cells are marked by dots, and the corner cells—by crosses.)

X O X O O X O X 17.5. Take-Home Problem Set 145

Problem 3. Prove that in a 4 × 4 magic square: (a) The sum of the numbers in the 4 central and 4 corner cells is equal to twice the magic constant of this square. (In the picture on the left, these cells are shaded.) (b) The sum of the numbers in the central 2 × 2 square is equal to the magic constant of this square. (In the picture on the right, these cells are shaded.) a) b)

Problem 4. Ten daughters of King Dodon wanted to learn new skills. They enrolled in the “Perfect Princess” Academy where they signed up for three classes—cooking, poetry, and martial arts. Each princess either passed or failed each of these classes. Prove that at least two princesses learned the same set of skills. Problem 5. (a) What angle does the minute hand of a clock swipe in a minute? (b) What is the angle between the hour and minute hands at 5 minutes past midnight? (c) What is the first time after midnight when the hour and minute hands will be pointing in opposite directions? (d) What is the first time after midnight when the hour and minute hands will be pointing in the same direction? Problem 6. Knights of the Round Table were eating pies with raisins. Merlin, the Magician, made sure that each knight ate either twice as many raisins or 10 raisins less than his right neighbor. Prove that the knights could not have eaten exactly 1,001 raisins.

Problem 7. The 4 × 4 magic square was filled with the numbers from 1 to 16. Some of these numbers were erased. Restore the square.

4 15 5 8 7

Session 18: Double Counting, or There Is More than One Way to Cut a Cake

Today, we will be working on the method of double counting,or counting in 2 different ways. The idea behind this technique is to find a way to look at a problem from two different perspectives and to count the same thing in two distinct ways. Stating that two expressions are equal—because they stand for the same quantity—often gives you an unexpected insight, or lets you formulate an equation that solves the problem.

In fact, we have used the method of double counting plenty of times without explicitly naming it. During this session, we will discuss the method and will demonstrate on a broad range of problems how useful and versatile double counting can be. Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - For the in-class Problem 6 (the soccer ball problem) bring a soccer ball or a picture of a soccer ball. It will come in handy for explaining the soccer ball geometry. (Most likely, if you try to sketch a soccer ball on the board, you will fail miserably.) If you bring a real ball, bring some painter’s tape as well. The tape could be used to mark those edges that will be double counted.

18.1. Math Warm-up Warm-up 1. Suppose that you have 21 identically looking coins. Of these, 20 are real, and 1 is counterfeit—it is slightly lighter than a real one. How can you determine which coin is counterfeit if you are allowed just 3 tries on a 2-pan balance scale? Warm-up 2. In an entirely dark room, there is a table with 30 coins. Of these coins, 12 are heads up, and the rest are tails up. Your goal is to

147 148 Session 18: Double Counting separate the coins into 2 groups so that both groups have the same number of coins heads up. (In the dark, you cannot see or feel if a coin is heads up or tails up. However, you may move the coins and turn them over.)

18.2. Discussion of the Day: Double Counting The first problem is composed of two parts that we will be solving and discussing one by one.

Problem 1. (a) Orcs and goblins, 40 creatures altogether, are standing in a rect- angular formation of 4 rows and 10 columns. Is it possible that the total number of orcs in each row is 7, and in every column 3? (b) A group of Girl Scouts is standing in a rectangular formation of 12 rows. Each girl is wearing several badges. It is known that the total number of badges in every row is 10, and in every column it is 8. How many columns of girls are there?

Problem 1 Discussion. (a) Let’s calculate the total number of orcs in 2 ways —row by row and column by column. When counting row by row, the total number should be equal to 4 × 7=28. However, when counting column by column, the same number should be equal to 10 × 3=30. Therefore, such an arrangement is impossible.

7 goblins in each row

3 in every column

(b) The total number of badges worn by all the girls can be counted column by column or row by row. Since there are 10 badges in every row, this total is 12 × 10 = 120. However, the same quantity should be equal to the sum of the badges counted column by column. Since there are 8 badges in each column, the number of columns must be 120/8=15.

Before moving on, we bring the technique that we just used to the students’ attention: in each of the problems above, we found two different ways to calculate the same quantity. Since the results must be identical, we ended up with an equation that allowed us to solve the problem. Let’s solve several more problems that demonstrate the power of this double-counting approach. 18.2. Double Counting 149

Problem 2. A group of Martians and a group of Venusians got together for an important talk. At the start of the meeting, each Martian shook hands with 6 different Venusians, and each Venusian shook hands with 8 different Martians. It is known that 24 Martians took part in the meeting. How large was the delegation from Venus? Problem 2 Discussion. Let’s start by trying to figure out which quantity in this problem can be calculated in 2 different ways. How about calculating handshakes? Since each handshake involves a Martian and a Venusian, the total number of handshakes made by Martians should be the same as the total number of handshakes performed by Venusians. We know that each Martian shook hands with 6 Venusians; therefore, the total number of handshakes made by Martians was 24 × 6 = 144. It follows that the total number of handshakes made by Venusians was 144 as well. Each Venusian made 8 handshakes; therefore, the number of Venusians is 144 ÷ 8=18. Problem 3. On the picture below, you can see the map of Cannon Island with all its roads and fortresses. The star in the center of the island marks Grand Fortress, the capital. The 10 circles mark 10 smaller fortresses. The island has 4 roads, which all run shore to shore, and all pass through the capital. It is known that the total number of cannons in all the fortresses located on the east-west road is 130, and the total number of cannons in all the fortresses located on each of the remaining 3 roads is 80. Also, it is known that altogether the island has 280 cannons. How many cannons does Grand Fortress have? (Different fortresses may have different numbers of cannons.)

Problem 3 Discussion. Which quantity can potentially be counted in 2 different ways? We already know the total number of cannons—it is 280. Can we think of another way to calculate this total? If we add cannons road by road, the sum would be 3 × 80 + 130 = 370. In this sum, cannons in each smaller fortress are counted once, and cannons in Grand Fortress are counted 4 times. (Grand Fortress is located at the intersection of 4 roads.) Compared to the first total, 280, this sum includes 3 extra copies of the Grand Fortress cannons. Therefore, Grand Fortress has (370 − 280)/3=30 cannons. Once again, a smart application of double counting allowed us to find the number of cannons without making a single attempt to place the cannons according to the rules. 150 Session 18: Double Counting

Problem 4. This is a map of a castle. The 8 circles stand for the 8 towers, with a prisoner being held in every tower. The towers are connected by 12 walls. Soldiers, which are positioned on each wall, are guarding the prisoners. Every prisoner is guarded by all soldiers positioned on all 3 walls connected to his tower. Twelvegroups of guards, containing 1, 2, 3, ..., 11, and 12 people each are to take guard on the castle walls, 1 group per wall. Can you position these 12 groups in such a way that every prisoner would be guarded bythesamenumberofguards?

Problem 4 Discussion. The answer to this question is negative, and we will use double counting to prove this fact. We will start by assuming that such a placement can be found. Which quantity can be counted in 2 different ways? Let’s count the total number of guards. The first way to count the guards is straightforward—we count them wall by wall: 1+2+···+11+12 = 78. (The easy way to approach this calculation is to regroup the sum: (1 + 12) + (2 + 11) + ···+(6+7)=13× 6=78.) Another way to calculate the same quantity is to count the guards tower by tower. If we assume that each prisoner is guarded by x guards, then 8 prisoners altogether are guarded 8x guards. However, since each guard is guarding 2 prisoners, each guard was counted twice. Thus, the real number of guards is 8 × x ÷ 2=4x. Therefore, 78 = 4x. It follows from this equation that x =78/4=39/2, which is not an integer number. However, since we are counting guards, the answer has to be an integer. Therefore, the assumption that we can position the guards leads to a contradiction. Problem 5. There are 5 directors of 5 banks sitting at a round table. Some of these banks have a negative balance (they owe more money than they have); others have a positive balance (they have more money than they owe). It is known that for any 3 directors sitting next to each other, their 3 banks together have a positive total balance. Prove that all 5 banks together have a positive balance. Problem 5 Discussion. The only data at our disposal are the next-to- each-other totals. What if we add all 5 of these totals together? The picture below helps us to see that the balance of every bank is included in 3 of these 5 totals. (In this picture, D1, D2, D3, D4,andD5 mark the directors.) For 18.2. Double Counting 151 example, the balance of D1 is included in (D4,D5,D1),(D5,D1,D2),and (D1,D2,D3) combinations. Thus, if we add all 5 totals, we get a number that includes 3 copies of a balance of every bank. Thus, this sum of these 5 totals is equal to 3 times the total balance of all the banks: 3 × (D1+D2+ D3+D4+D5). Since each of these next-to-each-other totals is positive, their sum is positive. It follows that the sum of the balances of all the banks is positive as well.

D1 D5 D2

D4 D3

We finish with the classic problem about the number of black and white patches on a soccer ball. Problem 6. A soccer ball is stitched together from several black pentagons and white hexagons. These are arranged in such a way that at the sides of each black pentagon there are 5 white hexagons. Also, at the sides of each white hexagon, there are alternating black pentagons and white hexagons. How many pentagons and how many hexagons make a soccer ball if there are 32 polygons (panels) altogether?

Problem 6 Discussion. We are looking for some quantity that can be counted in 2 ways. What could it be? Let’s take a look at the edges that are shared by panels of different colors. (Teacher: visualize the description by marking (taping) several of these edges on the soccer ball or by highlighting them on the picture.)

First, let’s find a way to count these edges via black panels. Suppose that we have x black panels. Each black panel borders 5 white panels; thus the total number of black-white edges is 5x. Next, let’s concentrate on the 152 Session 18: Double Counting white panels. The number of white panels is 32 − x, and each white panel has 3 black panels on its sides. Therefore, the number of white-black edges is 3(32 − x). We counted the same quantity in 2 different ways, and we have an equation! 5x =3(32− x), 8x =96, x =12. Therefore, the number of black pentagons is 12, and the number of white hexagons is 20.

For Teachers: Unless you are teaching an advanced group, you will not get to the soccer ball problem during a single lecture. Also, this problem may be too difficult for younger students. However, the problem is such a classic example of double counting that it would have been unfair not to mention it. Use this problem at your discretion.

Now, it’s time for independent problem solving. It takes experience and intuition to recognize a double-counting problem and to figure out which quantity should be double counted. Therefore, to get on a solid footing with the double-counting method, students need a lot of practice. Double- counting problems make up the majority of today’s problem set. Also, the follow-up section contains a list of additional problems.

18.3. Take-Home Problem Set Problem 1. Can you decorate an 8 × 8 cake with chocolate roses in such a way that any 2 × 2 piece would have exactly 2 roses on it and any 3 × 1 piece would have exactly 1 rose? Either draw such a cake or explain why this is not possible. Problem 2. All the pirates of the Black Pearl ship wear tricorn hats. Each hat is decorated with gold tassels: 1 tassel at the front corner and 2 and 3 tassels at each of the 2 back corners. Every evening, the pirates stack their hats neatly into a 3-corner tower. (The front corners of the hats can, possibly, face different directions.) One night, when Captain Barbarossa was unable to sleep, he added up all the tassels for every corner of the hat tower. There were 25 tassels total at each corner. After a short consideration, the captain figured out that at least 1 tassel was lost. Is he correct? Problem 3. (a) Arrange all 7 integer numbers from 1 to 7 in such a way that the 3 numbers on each of the 3 lines would add up to 12 and the 3 numbers on each of the 2 concentric circles would add up to 12 as well. (b) Could you find another solution such that the number in the center is different? 18.4. Additional Problems 153

(c) Would you be able to solve this puzzle for a number other than 12?

Problem 4. Sixty people were riding a tram. Out of this group, there were several conductors and several fake conductors (people who were im- personating conductors), several inspectors and several fake inspectors, and perhaps some regular passengers as well. The total number of impersonators (fake conductors and fake inspectors) was 4 times smaller than the total number of real conductors and inspectors. The total number of inspectors (real and fake ones) was 7 times greater than the total number of conductors (real and fake ones). How many of the tram riders were regular passengers? Problem 5. Several films were nominated for the “Best Math Movie” award. Each of the 10 judges secretly picked the top movie of his or her choice. It is known that out of any 4 judges, at least 2 voted for the same film. Prove that there exists a film that was picked by at least 4 judges.

Problem 6. An 8 × 8 chessboard has 30 diagonals total (15 in each direction). Is it possible to place several chess pieces on this chessboard in such a way that the total number of pieces on each diagonal would be odd? (Hint: The black/white coloring of the board helps solve this problem.)

18.4. Additional Problems Problem 1. Francesca, Isabella, and Lorenzo played chess together. Each child played 10 rounds. (a) What was the total number of rounds? (b) Is it possible that Lorenzo played more rounds with Isabella than with Francesca? Problem 2. Thirteen happy toddlers came to the Sunny Bunny Childcare this morning. Every toddler brought in 3 toys: a doll, a stuffed animal, and a car. From time to time, a pair of toddlers exchanged a toy with each other. Could it happen that each toddler went home with all toys of the same kind: either all dolls, all animals, or all cars? Problem 3. There are 36 warrior tomcats standing in a 6 × 6 square formation. Each cat has several daggers strapped to his belt. Is it possible for the total number of daggers in each row to be more than 50 and for the total number of daggers in every column to be less than 50? 154 Session 18: Double Counting

Problem 4. Farmer John is very proud of his pigs. (a) John has recently noticed that out of his 8 best pigs, each 4, put together, weigh at least 1,000 pounds. Prove that all 8 pigs weigh at least 2,000 pounds (b) John has sold some pigs, and he now has only 6 out of which each 4, put together, weigh at least 1,000 pounds. Prove that all 6 pigs weigh at least 1,500 pounds. Problem 5. A dark wizard assembled a battalion of orcs and goblins. During the first day together, each orc quarreled with 10 goblins and 5 orcs, and each goblin quarreled with 9 orcs and 6 goblins. Were there more orcs or goblins in this battalion? (Each quarrel involves 2 creatures and is 2-sided.) Problem 6. Mrs. Smith has some $10 bills and $20 bills. If she uses all her $10 bills, she is $60 short of buying 4 raspberry pies. If she uses all her $20 bills, she is $60 short of buying 5 raspberry pies. If she uses all her $10 bills and $20 bills, she is $60 short of buying 6 raspberry pies. What is the price of one raspberry pie? Problem 7. Several graduate students registered for several math courses each. Altogether, 7 courses were offered: mathematical logic, proofing meth- ods, combinatorics, number theory, graph theory, cryptography, and strate- gic games. It turned out that each student took an odd number of courses and each course had an odd number of participants. Was the total number of students odd or even? Problem 8. (a) Six coins are placed together to form a triangle (see picture A). It is known that the total value of any 3 coins that are all bordering each other (making a triangle) is equal to 100 shmollars. What is the total value of all 6 coins? (The coins are identical in size, but they may be of different values.) (b) Look at picture B. Under the same conditions as in (a), what could the possible total value of all 10 coins be? (Either calculate this total or give ехamples of 2 different totals.)

A B

Problem 9. Last weekend, 10 presidential candidates were holding 2-day rallies, with the goal of receiving endorsements. On day 1, the candidates received a different number of endorsements each, ranging from 1 to 10. The same outcome took place on day 2. Also, in 2 days, no 2 politicians got the same total number of endorsements. Prove that one of these 10 candidates is exactly 10 endorsements ahead of another. 18.4. Additional Problems 155

Problem 10. Canyouplaceall10numbers0, 1, ..., 9 inthecirclesin such a way that the sums of 3 numbers along each segment would be the same?

Problem 11. Out of 7 integer numbers, the sum of any 6 is a multiple of 5. Prove that each number is a multiple of 5. Problem 12. Monique tiled a grid-aligned rectangle with 2 × 1 dominoes. She noticed that every grid line cuts through a number of dominoes that is divisible by 4. Prove that at least 1 side of this rectangle is divisible by 4. Problem 13. A 4 × 4 table is filled with numbers as shown in the picture. Each number is assigned a “+”ora“−” sign so that there are exactly 2 pluses and 2 minuses in each row and each column. Prove that the sum of all the numbers taken with their assigned signs will always be equal to 0. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Problem 14. Yesterday, 27 British gentleman got together. Each of them belongs to no more than 2 clubs. Moreover, any 2 of these gentlemen belong to the same club. Prove that at least 18 of these gentlemen are members of thesameclub.

Session 19: Mathematical Olympiad II

Our second in-circle mathematical Olympiad is today. Teaching supplies for this session: - Printouts of the Olympiad problems (one per student). - Prizes for the contest participants (optional).

19.1. Event of the Day: Mathematical Olympiad You can read more about organizing an Olympiad in the “Mathematical Olympiads” chapter of this book (page 251). Today’s Olympiad is structured in the same way as the first one. The problems are listed in increasing order of difficulty and printed in two sets. At the start of the Olympiad, everybody gets the first set of problems. A student who solves any four of these problems receives the second set.

19.2. Mathematical Olympiad II. First Set of Problems Problem 1. Bob and Mob were coming down from the top of the mountain. Bob was walking, and Mob was skiing 20 times faster than Bob’s walking speed. Halfway down the slope Mob broke her skis and continued at half of Bob’s speed. Who will reach the bottom first? Problem 2. A hat rack had 20 hats on it. As 25 people approached the rack, some took a hat from the rack, and some put a new hat on it. Is it possible that 10 hats would remain on the rack after that? Problem 3. A dandelion opens in the morning and blooms yellow for 2 days. Then on the morning of the third day, it turns white, and by the end of the day, the little parachutes fly off. Yesterday a meadow had 20 yellow

157 158 Session 19: Mathematical Olympiad II dandelion flowers and 14 white ones; today it has 15 yellow ones and 11 white ones. (a) How many yellow flowers were there the day before yesterday? (b) How many white flowers will be there tomorrow?

Problem 4. Can you place all the integer numbers from 1 to 6 at the edges of a tetrahedron in such a way that the sums of the numbers at all the vertices will be the same?

Problem 5. Sasha draws 6 segments on a piece of paper and marks all their intersection points with a blue marker. It turns out that exactly 2 segments intersect at each marked point. Also, the first segment contains 3 of these points, the second segment contains 4 of them, and each of the third, fourth, and fifth segments contains 5. How many of the marked points belong to the sixth segment?

Problem 6. An eating contest lasted for 2 days. During the first day, each participant ate as many hot dogs as all other participants combined ate on the second day. Prove that each participant ate the same number of hot dogs.

19.3. Mathematical Olympiad II. Second Set of Problems Problem 7. There are 55 kids in the summer camp, and out of each 10 there are at least 5 of the same age. Prove that there are at least 25 kids at the camp who all are of the same age.

Problem 8. Count Dracula has 100 golden thalers, and he wants to distrib- ute them between 3 charitable causes: Necromancy Legalization, Defense of Cannibalism, and Blood Drives. He always gives a whole number of thalers, and he wants to make sure each organization is supported. In how many ways can Dracula make his donation?

Problem 9. Someone placed 8 rooks on a chessboard such that no 2 rooks attack each other. Prove that the number of rooks placed on the black squares is even. 19.4. Additional Problems 159

Problem 10. A box contains tennis balls of 10 colors. It is known that one can take 100 balls out of the box in such way that, after that, it would contain the same number of balls of each color. Prove that you can add 900 balls to the box so that it would contain the same number of balls of each color.

19.4. Mathematical Olympiad II. Additional Problems Problem 11. The numbers 1, 2, 3, and 4 are placed around the circle (in this order). You are allowed to add 1 to any pair of numbers that are next to each other. Can you make all the numbers equal? Either show how or prove that this is not possible. Problem 12. Last week, 11 people came to a party. It turned out that for each group of 5 people there was someone at the party who knew them all. Prove that 1 person at the party knows everyone else. Problem 13. Yesterday, 101 pairs of white rabbits and gray rabbits went to a Cabbage Patch party. All the gray rabbits came at 7 PM sharp. Some white rabbits came before 7 and had to wait, and the rest came after 8, so their gray friends had to wait for them. Prove that if all the gray rabbits came at 8 PM instead, the total time everyone spent waiting would be different.

Session 20: Divisibility I. Review

It’s now time to approach a really important topic: divisibility and re- mainders. This topic, while interesting and important on its own, is also a gateway to a branch of mathematics called number theory. Number theory was developed to study the general properties of numbers, especially integers. This branch of mathematics, which was originally researched for its own sake, turned out to be indispensable for computer science, software engineering, cryptography, and a broad spectrum of other theoretical and applied disci- plines. Divisibility and remainders also make a great math circle subject, as they can be taught for several years in a row at increasing complexity levels. Today’s lesson is a review of the material that we studied during Year 1 of our circle. (See [1].)

For Teachers: Today’s lesson is not a detailed presentation, but a fast- paced review. During one lesson, we plan to walk through the topics that took us three lessons to learn last year. Depending on your group, you may plan on an additional lesson. (For the materials, you can use Mathematical Circle Diaries, Year 1 or your favorite book on divisibility theory.)

Teaching supplies for this session: - Printouts of the two in-class practice sets (one per student). - Printouts of the take-home problem set (one per student).

20.1. Math Warm-up For today’s warm-up, we are going to play the famous Word Ladder puzzle, invented by Lewis Caroll. The rules are very simple. The players get the starting word and ending word, which must be of the same length. The goal is to move from the starting word to the ending word, changing 1 letter at a time. Each intermediate step must be a valid word, and no proper nouns are allowed. A shorter solution is a better solution.

161 162 Session 20: Divisibility I. Review

Example: You can get from CAT to DOG in 3 steps: CAT→COT →DOT→DOG. For today’s warm-up, solve some of these Ladders, that come from cut- the-knot [26]: -GetfromMOMtoDAD. - FALL comes with COLD. -DrivePIGintoSTY. - Raise FOUR to FIVE.

20.2. Discussion of the Day: Divisibility Let’s start this review by highlighting the important differences between the terms “division” and “divisibility”. Division is the action of dividing one number by another. We use the special symbol “÷”(or“/”) to mean “divide”. For example, 10 ÷ 4=2.5 and 18.15 ÷ 5.5=3.3.Insuchanexpression,thedividend is divided by the divisor to get a quotient. Any number can stand for a dividend, and almost any can stand for a divisor. (We cannot divide by 0.)

Divisibility is a special term that means an ability of one integer number to be divided evenly (without a remainder) by another integer number. For example, 10 is divisible by 2 but is not divisible by 4. (However, 10 can be divided by 4, and the quotient is 2.5.)

Next, let’s introduce the formal definition of divisibility.

Definition. Suppose that A and B are two integer numbers. Then A is divisible by B if it is possible to find an integer K such that A = B × K. Both B and K are called factors of A.

Notation. The symbol “|” is used for divisibility: “B|A”isread“B divides A” and means that A is divisible by B.1

Divisibility has a lot of important and useful properties.

1When we talk about divisibility, we imply that we are working with integer numbers only. Therefore, for the sake of brevity, we may occasionally omit the word “integer” if it is indicated by the context. 20.2. Divisibility 163

Divisibility of a sum Suppose that two integers, A and B, are divisible by integer K.Inthiscase, the sum and the difference of these numbers, A + B and A − B, are divisible by K as well. (We can write this property using the divisibility notation: if K|A and K|B,thenK|(A + B) and K|(A − B).) Proof .SinceA is divisible by K,thenA = K × X,andB = K × Y , where X and Y are some integers. Therefore, A + B = K × X + K × Y = K × (X + Y ). The same proof would work for subtraction. 

Divisibility of a product Suppose that at least one of the numbers A and B is divisible by K.Then their product A × B is divisible by K as well. Proof . Suppose that A is divisible by K.ThenA = K × X,and A × B = K × X × B = K × (X × B).Thus,A × B is divisible by K.  These two simple properties are surprisingly useful. Example: Is the number 111,222,333,444,555 divisible by 111? The answer is positive. One way to prove this fact would be to do the long division. However, being lazy, we would prefer to find a shortcut. Thus, let’s notice that the numbers 111, 222, 333, 444, 555 are all multiples of 111. Thus, any combination of these numbers (multiplied by integer coefficients) will be a multiple of 111 as well. Next, let’s observe that 111,222,333,444,555 = 111 × 1012 + 222 × 109 + 333 × 106 + 444 × 103 + 555. Therefore, it is divisible by 111.

Prime Factorization The next topics on our review list are prime numbers and prime factorization.

A prime number is a number that has only 2 distinct factors: this number itself and 1. For example, the numbers 2, 3, 5, 7, and 11 are prime; the numbers 4, 6, 8, and 9 are not prime—they are composite . (The numbers 1 and 0 are neither prime nor composite. Can you tell why?)

Prime factorization (prime factors decomposition) of a number is the process of finding a set of prime factors which, when multiplied together, give the original number. Alternatively, this term canbeusedtoindicatethe result of this process: a collection of prime numbers that multiply together to make the original number. 164 Session 20: Divisibility I. Review

For example, the prime factorization of 920 is 920 = 92 × 10 =46× 2 × 10 =23× 2 × 2 × 10 =23× 2 × 2 × 5 × 2. It’s standard to write the prime factorization of a number in ascending order (least to greatest), using exponentials to group repeating factors. Thus, the correct way to write the prime factorization of 922 is 920 = 23 × 5 × 23. We can also say that the prime factorization of 920 has three powers of 2, one power of 5, and one power of 23. The prime factorization of a number is unique, up to the order of the factors. This important fact has a name of its own: the Fundamental Theorem of Arithmetic. (We are not proving this theorem; instead, we take it for granted.)

Notation If we do not know the prime factorization of a number, we could use variables. For example, we can express a generic number and its prime factors as A = p1 × p2 ×···×pn. In this formula, the variables pk are used to represent unknown prime factors. (Since we do not know how many prime factors the number has, we use the variable n.) If exponential form matters for a problem, we can employ more advanced k1 × k2 ×···× km notation: A = p1 p2 pm . Here, we use variables for both the distinct prime factors of the number and their exponentials. Often, younger students tend to shy away from such a notation. It is not a big deal, and there is no need to force it on them—eventually, they will learn it. Since we would like this material to be accessible for this younger group, we will stick to graphical models, which are more intuitive. We will be visualizing the prime factors of a number as a “bag” filled with these factors. Such a visualization emphasizes the role of the prime factors as the building blocks of a number. It also allows us to produce mathematically rigorous explanations, with the additional benefit of providing a visual way of thinking about divisibility. The picture below has three examples that illustrate this model: the first drawing represents the number 920 and its entire collection of prime factors; the second drawing—some number A, with prime factorization unknown; and the third one—some number B that has prime factor 2,017. 920 A B 2 2 p ... 2 1 ... 5 ... p 2017 23 n 20.2. Divisibility 165

Prime Factorization of a Product Suppose that A and B are two numbers. Then the prime factorization of A × B is equal to the union of the prime factorizations of the two original numbers.

A x B AB

All prime All prime All prime All prime factors factors factors AND factors of A of B of A of B

Divisibility and Prime Factorization What difference does it make whether we know the prime factors of a num- ber? The truth is that prime factorization reveals a lot of information about the number. In particular, it is a great tool for learning about the divisibility of the number.

We start with a very important observation: Observation. The number A is divisible by the number B only if the prime factorization of B is contained in the prime factorization of A. Proof. If A is divisible by B,thenA = B × K,whereK is some integer. We can keep factoring B and K until we get the prime factorization of both. These two factorizations, combined, make the prime factorization of A. Thus, the prime factorization of B is contained in the prime factorization of A. Let’s prove that the reverse is true as well. Suppose that the entire collec- tion of prime factors of the number B is contained in the prime factorization of A. We would like to prove that A is divisible by B. Let’s split all the prime factors of A into two groups—those that are contained in B, and those that are not. (See the picture below.)

All prime factors of A

All prime The rest factors of prime B factors of of A 166 Session 20: Divisibility I. Review

The factors in the first group multiply to B; in the second group, they multiply to a number K such that A = B × K.Thus,A is divisible by B.

Exercise 1. Suppose that

A =2× 2 × 3 × 3 × 3 × 7 × 11 × 37.

(a) The number B is equal to 2 × 2 × 3 × 3 × 11. Will A be divisible by B? (b) The number C is equal to 2 × 2 × 2 × 3. Will A be divisible by C?

The answer to the first question is positive because the entire collection of prime factors of B is contained in the collection of prime factors of A. The second answer is negative because C has three copies of prime factor 2andA has just two copies.

Practice problems Let’s solve a couple more practice problems. While the problems themselves are not that challenging, the students usually have difficulty explaining their solutions with mathematical rigor.

Problem 2. The number A is not divisible by 3. Could the number 2A be divisible by 3?

Problem 2 Discussion. The answer is negative, and the reason is that for 2A to be divisible by 3, one of its prime factors has to be 3. Where would this 3 come from? Since 2A is a product of 2 and A, then the prime factors of 2A are the union of the prime factors of 2 and A. However, 3 does not belong to the set of prime factors of either of these numbers. Therefore, 3 does not belong to the union either. The picture below visualizes this explanation.

2 x A A

Does not have factor 3 2 Does not have factor 3

Problem 3. The number A2 is divisible by 8. Prove that A2 is divisible by 16.

Problem 3 Discussion. The number A2 is divisible by 8=2× 2 × 2; therefore, these three 2’s belong to its prime factorization. However, the 20.2. Divisibility 167 prime factors of A2 = A × A are the union of two sets, each being the set of prime factors of A. The three copies of factor 2 are distributed between these two sets; thus, at least two factors 2 belong to one of these sets. Then, A is divisible by 2 × 2=4. Therefore, A2 is divisible by 4 × 4=16.

A x AA x A AA AA 2 2 2 2 2 2

Problem 4. Solve the following encrypted problem: BAO × BA × B = 2,002. (The same letters stand for the same digits; different letters stand for different digits.) Problem 4 Discussion. We start by writing the prime factorization of 2,002. 2,002 = 2 × 1,001 =2× 7 × 11 × 13. (How did we get the prime factorization of 1,001? Well, we can guess the factor 7 through trial and error. However, 1,001 is a special number—it is not unusual to encounter 1,001 and its derivations in various divisibility problems. Therefore, a much better approach is to memorize the list of prime factors of 1,001.) These 4 prime factors, 2, 7, 11, and 13, should be distributed among the 3 numbers BAO, BA,andB. Let’s start with factor 11. Definitely, neither B nor BA is divisible by 11; thus, 11 must belong to BAO. How big could digit B be? If it were bigger than 1, then BAO× BA× B would be at least 200 × 20 × 2=8,000. Since this number is way too big, B has to be 1. It follows that the factors 2, 7, 13 all belong to BAO and BA.SinceBA starts with 1, then either BA is 2 × 7 or BA is 13. If BA =13,thenBAO =11× 2 × 7 = 154. This solution does not work since A cannot be equal to 2 different values: 5 and 3. If BA =2× 7=14,then BAO =11× 13 = 143. This is the answer that works. A solid understanding of foundations makes all the difference in the topic of divisibility. Therefore, in addition to the main problem set, this lesson has two practice sets. These practice sets may turn out to be very useful for a group of younger or novice students. Also, this lesson includes a large section of additional problems that can be used for extra practice. 168 Session 20: Divisibility I. Review

20.3. Prime Factorization Practice. Set 1 In each problem below, you are given a list of divisibility facts about a number. Your goal is to figure out what this number is.

1. The secret number: 6. The secret number: - is divisible by 7, - is divisible by 45, - is divisible by 11, - is divisible by 25, - is divisible by 2, - has 4 prime factors total. - has 3 prime factors total. 2. The secret number: 7. The secret number: - is divisible by 4, - ends with 2 zeroes, - is divisible by 6, - is divisible by 3, - has 3 prime factors total. - has 5 prime factors total. 3. The secret number: 8. The secret number: - is not divisible by 8, - is divisible by 5, - is divisible by 4, - is divisible by exactly 3 - is divisible by 6, different numbers. - is divisible by 7, - has 4 prime factors total. 4. The secret number: 9. The secret number: - is divisible by 14, - is divisible by 4, - is divisible by 21, - is divisible by exactly 5 - is divisible by 6, different numbers. - has 3 prime factors total. 5. The secret number: 10. The secret number: - is not divisible by 27, - is divisible by 15, - is divisible by 6, - is divisible by 21, - is divisible by 9, - is divisible by 35, - is divisible by 4, - is divisible by exactly 8 - has 4 prime factors total. different numbers.

20.4. Prime Factorization Practice. Set 2 Problem 1. The prime factorization of a number is 2 × 32 × 73 × 13.Is this number divisible by 2? By 4? By 14? By 12? By 98?

Problem 2. The prime factorization of a number is 22 × 3 × 73 × 13,and the factorization of another one is 2 × 33 × 72. (a) Is the first number divisible by the second one? (b) Is the product of these numbers divisible by 8? By 36? By 27? By 16? By 56? 20.5. Take-Home Problem Set 169

Problem 3. The number A is even. Is it true that 3A should definitely be divisible by 6? Problem 4. The number 5A is divisible by 3. Is it true that A should definitely be divisible by 3? Problem 5. A and B are two whole numbers such that AB is divisible by 7. Is it true that one of the numbers should definitely be divisible by 7? Problem 6. A and B are two whole numbers such that AB is divisible by 15. Is it true that one of the numbers should definitely be divisible by 15? Problem 7. The number A2 is divisible by 11. Is it true that A2 should definitely be divisible by 121? Problem 8. The number A2 is divisible by 12. Is it true that A2 should definitely be divisible by 144?

20.5. Take-Home Problem Set Problem 1. The inscription in an ancient math textbook reads: “3333333 +1is a prime number.” Could this inscription be correct? Problem 2. What is the smallest integer number N such that N! is divisible by 990? (N! is a product of all integer numbers from 1 to N.) Problem 3. Is 100! divisible by 2100? Problem 4. Solve HE × HE = SHE. (The same letters stand for the same digits; different letters stand for different digits.) Problem 5. An absent-minded mathematician believes that he can place 99 integer numbers in a circle so that for each pair of neighbors the ratio of the bigger and smaller numbers in the pair is a prime number. Prove that the mathematician is mistaken. Problem 6. Someone placed 8 rooks on a chess board so that no two rooks attack each other. Prove that if you cut the chessboard into four 4 × 4 squares as shown in the picture, then the squares A and D will contain the same number of rooks. AB

CD 170 Session 20: Divisibility I. Review

20.6. Additional Problems Problem 1. The product of two natural numbers, neither of which ends with 0, is equal to 1,000. Find the sum of these numbers. Problem 2. Prove that a number is divisible by 8 only when the number formed by its last three digits is divisible by 8. Problem 3. Several hundred years ago, the famous mathematician Leon- hard Euler published a very interesting formula: n2 + n +41. If you start trying this formula on the first positive integers n =1, 2, 3, 4, and so on, the values that it produces would all be prime. For example, for n =20 the answer is 461, which is a prime number. For n =21the answer is 503, which is also prime, etc. Could it be true that for any positive integer n this formula would produce a prime number? Problem 4. Prove that out of any 7 perfect squares you can always find 2 such that thier difference is divisible by 10. Problem 5. I am thinking of a 3-digit prime number. Its last digit is equal to the sum of the 2 other digits. What could my number’s last digit be? Problem 6. Prove that if n!+1 is divisible by n +1,thenn +1 is a prime number. Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM

Today, we will keep working on divisibility-related topics. We will start with a review of relatively prime numbers and will move on to the discussion of greatest common factors and least common multiples. Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - Printouts of the in-class GCF and LCM practice problems (one per student).

21.1. Math Warm-up: Mysteries of Prime Numbers For today’s warm up, we present a collection of interesting and entertaining facts about prime numbers.1 For many centuries mathematicians have been fascinated with prime numbers. Studying them, they came up with plenty of great discoveries and also with the multitude of questions that are still unanswered. Let’s introduce several types of prime numbers that have been awarded names of their own. Twin primes are prime numbers which differ by two. For examples, 3 and 5 are twin primes, as well as 17 and 19. Can you come up with other examples of twin primes? Cousin primes are prime numbers that have a gap of four. For exam- ple, 19 and 23 are cousin primes. Could you guess what sexy primes are? These are prime numbers which differ by six. (Indeed, “sex” means “6” in Latin.) For example, (11, 17) and (13, 19) are two pairs of sexy primes.

1This warm-up was inspired by the article on the bounded gap between primes in the New Yorker Magazine [16].

171 172 Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM

There also exist permutable primes, which are numbers that remain prime regardless of how their digits are arranged (for example, 337, 373, and 733 are all prime), palindromic primes (primes that read the same forward and backward), holey primes (the ones which have only digits with holes), and many other special types of primes. Of all the baffling questions about prime numbers, the most important have always been about the distribution of primes: - Is there a formula for prime numbers? - How frequently do prime numbers occur? - As prime numbers get bigger, what happens with the gaps between them? Do they get bigger as well? While the answers for some of these questions are already known, others remain a mystery. It was proved many years ago that there are infinitely many prime numbers. (This fact was established by Euclid around 300 BC.) However, prime numbers appear at random—no formula for generating prime numbers has been discovered so far. As numbers get larger, the primes occur less and less frequently. For example, we all know that many more primes are clustered around 10 than around 1,000. And, indeed, there are 5 primes between 1 and 10, 25 primes between 1 and 100, 168 between 1 and 1,000, and 1,229 between 1 and 10,000. As prime numbers become more and more dispersed, the gaps between them grow wider. It fact, for any width, it is possible to come up with a stretch of consecutive numbers that are all composite. (The challenge of pinpointing such a set is not that difficult.) At the same time, a conjecture (a hypothesis) was proposed in the 19th century. It states that, no matter how far you get on the number line, you will always be able to find a pair of prime numbers that are twins (two apart). For more than a hundred years, mathematicians have not able to prove this fact; however, these days they are getting close. A groundbreaking theorem was proved several years ago that paves the way for the “twin primes” conjecture.2 Another famous theorem, the Goldbach Conjecture, asserts that every even integer greater than 2 can be expressed as a sum of 2 primes. For example, 6=3+3, 8=3+5, 24 = 11 + 13, 100 = 53 + 47. This conjecture is more than 250 years old, and it has not been proved yet!!! Thus, after centuries of studies, prime numbers still hold plenty of mys- teries and secrets for us and plenty of challenges for the greatest modern-day mathematicians.

2The “Bounded Gap Between Primes” theorem pinpoints a number, a gap bound, such that as you go further out along the number line, you will occasionally be finding pairs of primes that are closer than this bound. In the original theorem, proved by Yitang Zhang in 2012, this bound is equal to 70 million. These days, mathematicians are working on bringing it down to 2. 21.2. Relatively Prime Numbers 173

21.2. Discussion of the Day: Relatively Prime Numbers Relatively prime numbers (also called coprime numbers)arenumbers that do not have any common factors other than 1. For example, 12 and 25 are relatively prime, while 12 and 18 are not because they share the factors 2, 3, and 6. During Year 1 of our circle, we studied one very useful property of coprime numbers: we learned how the divisibility by a product of relatively prime numbers follows from the divisibility by each of these numbers. (See [1].) Let’s review this property: first, we will illustrate it with a specific example; next, we will generalize. Example: Suppose we need to check whether the number 78,123,456 is divisible by 36. What would be a smart way to do this? We rule out long division as too time consuming. Maybe we can split 36 into two factors and check divisibility factor by factor? For example, we can factor 36 as 3×12 or as 4×9. Would divisibility by 36 follow from divisibility by 3 and by 12? Would it follow from divisibility by 4 and by 9? The number 24 is an easy example which illustrates that divisibility by 36 does not follow from divisibility by 12 and by 3. However, divisibility by 36 does follow from divisibility by 4 and 9, because 4 and 9 are relatively prime! Indeed, if the dividend is divisible by 4 and 9, it should contain the entire sets of prime factors of 4 and 9. Moreover, since 4 and 9 are relatively prime, these two sets do not have anything in common. Therefore, the dividend contains all prime factors of 4 (which are 2 and 2) AND all prime factors of 9 (which are 3 and 3). Thus, it is divisible by 2 × 2 × 3 × 3. Thus, to find out if 78,123,456 is divisible by 36, we need to check if it is divisible by 4 and 9. The number 78,123,456 is indeed divisible by 9 since the sum of its digits is divisible by 9; it is also divisible by 4 since it ends with the 2-digit number 56, which is divisible by 4. Therefore, 78,123,456 is divisible by 36. Next, we present the generalized rule:

Divisibility and coprime numbers. Suppose that we need to check if integer A is divisible by integer B,whereB is the product of two relatively prime numbers: B = B1 × B2. Then, if A is divisible by both B1 and B2, A is divisible by their product B = B1 × B2 as well.

This useful rule can be generalized even further. Suppose that we would like to test divisibility by some number. If we can split this number (the divisor) into the product of several factors that are all relatively prime to each other, the problem can be simplified: if the dividend is divisible by each factor, then it is divisible by the entire product. 174 Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM

Example: - To check divisibility by 60, it is sufficient to test divisibility by 3, 4, and 5. - To check divisibility by 180, it is sufficient to test divisibility by 9, 4, and 5.

21.3. Greatest Common Factor (GCF) Definition. The greatest common factor of two integers A and B is the highest integer that divides into both numbers. (Often, this integer is called the greatest common divisor .) Both of these terms can be written as three-letter abbreviations: GCF and GCD. Example: The numbers 24 and 36 share several common factors, 1, 2, 3, 4, 6, and 12. The highest of these, the factor 12, is the greatest common factor. Using the abbreviated notation, we can write GCF(24, 36) = 12.

How do we calculate GCF? If we know the prime factorization of two numbers, then the GCF is not difficult to compute. Let’s start by explaining this procedure on an example.

Example: What is the GCF of 54 and 144? These numbers factor as: 54 = 6 × 9=2× 3 × 3 × 3 and 144 = 2 × 72 = 2 × 8 × 9=2× 2 × 2 × 2 × 3 × 3. Any divisor that is common to these two numbers has to be composed of those prime factors that are common to both these numbers:2,3 × 2, etc. And the greatest common divisor should contain all such prime factors. The numbers 54 and 144 share the prime factors 2, 3, and 3. (The picture below illustrates this.) Therefore, the greatest common factor of 54 and 144 is 2 × 3 × 3=18. 54 144

3 2 3 3 2 2 2

Next, let’s reformulate the same idea in terms of the generic numbers A and B.Thegreatest common factor of A and B consists of all prime factors that are shared by these numbers. (See the picture.) B A GCF(A, B) All common prime factors of A and B 21.4. Least Common Multiple (LCM) 175

Example: What is the GCF of A =23 × 53 × 7 × 117 and B =2× 34 × 52 × 11 × 13? Comparing the lists of prime factors and taking the biggest common part, we get GCF(A, B)=2× 52 × 11.

Thus, if we know the prime factorization of two numbers, the task of computing the GCF becomes fun and easy. However, what if the prime factorization is too difficult to find? For example, suppose we are asked to find the GCF of the numbers 5,499 and 728. It looks like computing the prime factorization of these two numbers may take a lot of our time. Is there a better way? Indeed, there is a more efficient method, called the Euclidian algorithm, for computing the GCF of a pair of numbers. We will not be discussing this algorithm until next year. However, if you are curious, you are welcome to research it on your own. For example, the book [2] contains an excellent discussion of more advanced GCF and LCM topics.

Before we get to the next topic, let’s solve another problem.

Problem 1. Two numbers differ by 6. What could their GCF be?

Problem 1 Discussion. Suppose that the numbers are A and B and that their GCF is K.SincebothA and B are divisible by K, then their difference should be divisive by K as well. Therefore, 6 is divisible by K.Thus,K could be 1, 2, 3, or 6. It is easy to come up with the examples for each of these values: 7 and 13, 8 and 14, 9 and 15, 12 and 18.

This problem illustrates the important fact that the difference (or sum) of a pair of numbers is always divisible by their GCF.

21.4. Least Common Multiple (LCM) The notion of the least common multiple is as natural as that of the greatest common factor.

Definition. The least common multiple of the two integers A and B is the smallest number which is divisible by both A and B. (The standard abbreviations is LCM.)

Example: The least common multiple of the numbers 12 and 18 is 36. Indeed, the number 36 is divisible by both 12 and 18, and it is the smallest of such numbers. Using the notation, we can write that LCM(12, 18) = 36.

As before, if we know the prime factorization of two numbers, then there is an easy way to compute their least common multiple. Again, we start by explaining the algorithm on a particular pair of numbers. 176 Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM

Example: What is the LCM of 270 and 144? These two numbers factor as 270 = 54 × 5=2× 3 × 3 × 3 × 5 and 144 = 2 × 2 × 2 × 2 × 3 × 3. We are looking for a common multiple, which is a number that could be divided by 270 and also by 144. To be divisible by 270, the number should contain the entire set of prime factors of 270. To be divisible by 144, it should also contain the entire set of prime factors of 144. (These two sets may overlap because we are not dividing by 144 and 270 at the same time.) And the smallest common multiple should be the lowest such number. Thus, its prime factorization should contain nothing extra beyond a set of factors that would ensure the divisibility by 144 and by 270. Let’s start constructing the LCM of 270 and 144 factor by factor. How many factors of 2 should it contain? For divisibility by 270, 1 copy is sufficient; however, for divisibility by 144, 4 copies are required. Thus, any common multiple should have at least 4 copies of factor 2. Since we are looking for the smallest, we need exactly 4 copies of 2. Similarly, we need exactly 3 copies of 3 and exactly 1 copy of 5. Therefore, the LCM(270, 144) = 2 × 2 × 2 × 2 × 3 × 3 × 3 × 5. You can visualize this process in 2 different ways. First, take a look at the drawing below. You can see how, for each prime factor, we choose the greatest number of times it occurs in either number.

270 = 2 33 5

144 = 24 32

Another way of visualizing the same process uses the “bag of prime factors” model. The drawing below helps us to realize that, to construct the LCM, we need to take: - 1 copy of every factor in the prime factorizations of the numbers 270 and 144 that they share in common (factors 2, 3, and 3), - and 1 copy of every factor that is unique to each number (factors 3 and 5; factors 2, 2, and 2). 270 144 2 3 3 3 2 5 2 2

Let’s reformulate the LCM construction process in terms of the generic numbers A and B. 21.6. GCF and LCM. In-Class Practice Problems 177

Least Common Multiple algorithm: For every distinct prime factor that belongs to either A or B, we should take the fewest number of copies that guarantees divisibility. Therefore, we should: - Compare the number of times this prime factor occurs in A and B and choose the greatest. - Add this greatest number of copies of that factor into LCM(A, B).

Exercise 1. What is the LCM of A =23 × 53 × 7 × 117 and B =2× 34 × 52 × 11 × 13?

21.5. How GCF and LCM Are Related It’s time to show how beautifully LCM and GCF complement each other. Suppose we have two numbers: A and B. Then the following is true: GCF(A, B) × LCM(A, B)=A × B.

You are probably already able to see why this relationship is true. If not, read through the previous sections one more time and take another look at the pictures that illustrate how GCF and LCM can be assembled from the prime factors of the numbers A and B. Can you prove this fact now?

We are done with the core properties of GCF and LCM; it’s problem- solving time now. In addition to the main problem set, this lesson includes one practice set that is composed of simple GCF and LCF problems that emphasize understanding of how GCF, LCM, and factorization are related.

21.6. GCF and LCM. In-Class Practice Problems Problem 1. (a) What is the smallest common factor of the numbers 2 × 32 × 54 × 11 × 13 and 24 × 52 × 7 × 11? What is their greatest common factor? (b) What is the least common multiple of these numbers?

Problem 2. Little Shmuel has several aunties who live in the town called Chelm. When Shmuel visited Chelm on January 1st, each auntie cooked a dish for him: Auntie Edis made pancakes; Auntie Yetta baked pot pies; Auntie Malka cooked borscht soup; and Auntie Sonia made stuffed cabbage. How soon should Shmuel visit Chelm next time if he wants to sample all the dishes again and if Auntie Edis makes pancakes every 2nd day, Auntie Yetta bakes pot pies every 3rd day, Auntie Malka cooks borsch every 4th day, and Auntie Sonia makes stuffed cabbage every 7th day? 178 Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM

Problem 3. (a) Two numbers x and y are relatively prime, and their product is equal to 23 × 52. What could these numbers be? Find all the answers. (b) The GCF of the numbers x and y is 6, and their product is equal to 28 × 35. What could the numbers x and y be? Find all the answers.

Problem 4. (a) Emma says that since 24 = 4 × 6, divisibility by 24 should follow from divisibility by 4 and by 6. Rachel says that since 24 = 8×3, divisibility by 24 should follow from divisibility by 8 and by 3? Which girl is right and why? (b) Joseph says that since 60 = 3 × 4 × 5, divisibility by 60 follows from divisibility by 3, by 4, and by 5. Milo says that since 60 = 2 × 3 × 10, divisibility by 60 follows from divisibility by 3, by 2, and by 10. Which boy is right? (c) Come up with an easy test for divisibility by 180.

Problem 5. (a) Can you find a pair of numbers such that their difference is 24 and their greatest common factor is 12? (b) Can you find a pair of numbers such that their difference is 12 and their greatest common factor is 24? (c) Can you find a pair of numbers such that their difference is 24 and their greatest common factor is 7?

Problem 6. (a) While visiting Cape Verde, Pirate Jim and Pirate Bob bought several chocolate chip cookies each. Jim paid 93 copper coins for his cookies, and Bob paid 102 copper coins. What could the price of a single cookie be if it is an integer? (b) Pirates Lisa and Elsa bought several barrels of gunpowder each. Elsa paid one gold coin more than Lisa. What could the price of a single barrel be if it is an integer? (c) Captain Hook and Captain Kid bought several tricorn hats each. Captain Hook paid 6 silver coins more than Captain Kid. What could the price of a tricorn hat be if it is an integer?

Problem 7. The greatest common factor of the two numbers A and B is equal to 150. What could their smallest possible product be? What could the greatest possible product be?

Problem 8. A and B are two integer numbers; C is their greatest common factor. Prove that A − B is divisible by C. 21.7. Take-Home Problem Set 179

21.7. Take-Home Problem Set Problem 1. Rena and Simon bought several firecrackers each. Simon paid 12 shmollars more than Rina; Rina paid an odd number of shmollars. What could the price of the firecracker be? (A firecracker costs a whole number of shmollars.)

Problem 2. There are horses and cows on a farm. The number of horses is half of the number of cows plus 10 more. The number of cows is 20 more than the number of horses. How many horses and how many cows are there on the farm?

Problem 3. Michael has a wooden triangle with one of its angles equal to 40 degrees. Using this triangle, how can he measure the following: (a) a160-degreeangle? (b) a 20-degree angle? (The sizes of the other angles are unknown.)

Problem 4. (a) King Haggard has a velvet pouch filled with diamonds. He can divide these diamonds into 3 equal piles, 4 equal piles, or 5 equal piles. How many diamonds does he have if it is known that his collection contains less than 100 diamonds in total? (b) King Haggard has a stash of gold coins. He is 1 coin short of being able to divide these coins into 4 equal piles or 5 equal piles or 6 equal piles or 7 equal piles. How many coins does he have if he has fewer than 500?

Problem 5. What is the smallest integer number n such that 1,000! is not divisible by 38n?

Problem 6. For each shape below, place integer numbers at the nodes in such a way that: - If two nodes are connected by an edge, then the numbers at these nodes are not relatively prime. - If two nodes are not connected, then the numbers at these nodes are relatively prime.

Problem 7. Suppose that p is a prime number. (a) How many numbers that are less than p are relatively prime to it? (b) How many numbers that are less than p2 are relatively prime to it? 180 Session 21: Divisibility II. Relatively Prime Numbers; GCF and LCM

21.8. Additional Problems Problem 1. (a) How many common factors do the numbers 907 and 908 have? (b) How many common factors do the numbers 56,785 and 56,789 have? Problem 2. I am thinking of 5 non-prime numbers, and every pair of them are relatively prime. Prove that at least one of my numbers is greater than 100. Session 22: Divisibility III. Mathematical Race Game

A solid understanding of the key concepts and ideas of divisibility theory comes from practice. Therefore, during this lesson the students will be working on a collection of problems that develop proficiency in the topics that we have discussed so far: prime factorization, divisibility and relatively prime numbers, least common multiple, greatest common factor, etc. To make this lesson more enjoyable, we organize it as a Mathematical Race tournament. Mathematical Race is an individual or small-team tournament with a simple set of rules. During the competition, each team works its way through the same set of problems. The only restrictions are that a team works on 4 problems at a time and that the problems are handed out in the order they are listed. You can read more about the rules of the tournament on page 249. A team’s progress depends on the number of problems solved and also on the longest uninterrupted stretch of correct answers. Therefore, the children are motivated to progress through the list, trying to skip as few problems as possible. Teaching supplies for this session: Make sure to print: - The tournament problems, one or two copies per team (remember to cut each set into individual problems in advance). - Blank Mathematical Race score tables, one per team (a score table is easy to make; for a sample, consult the chapter on Mathematical Race rules). - Mathematical Race answer key, one per teacher (the answer key for today’s problem set can be found in the “Solutions” section). - Small prizes for the participants (optional).

181 182 Session 22: Divisibility III. Mathematical Race Game

For Teachers: Depending on the goal of the game (a strict competition or a friendly educational event), you may decide to provide occasional help for the students. If you work with a group of advanced students, having each student be on his or her own could work better than a team game.

22.1. Math Warm-up Warm-up 1. A farmer went to the market to sell some peas and lentils. However, he had only one sack and didn’t want to mix peas and lentils. So, he poured in the peas first, tied the sack in the middle, and then filled the top portion of the sack with the lentils. At the market, an innkeeper happened by with his own sack. He wanted to buy the peas, but he did not want the lentils. Pouring the peas or lentils anywhere else but into the sacks is considered soiling. Trading sacks is not allowed. The farmer can’t cut a hole in his sack. How would you transfer the peas to the innkeeper’s sack, which he wants to keep, without soiling the produce? (Source: [37].)

Warm-up 1 Discussion. For this cool puzzle, be ready to dispense hints that would steer the students in the right direction. For the possible hints, check the “Solutions” section.

22.2. Event of the Day: Mathematical Race Today’s game contains fourteen problems. Some of the problems are, in turn, composed of several subproblems. Usually, these subproblems explore the same idea in different settings, progressing from easier to more complex scenarios. When tallying the total score, we suggest giving points for each subproblem separately.

Mathematical Race Problems In all the problems below, unless stated otherwise, we are working with positive integer numbers.

Problem 1. The greatest common factor of the numbers a and b is 10; the greatest common factor of the numbers b and c is 7. What could the smallest possible value of a × b × c be?

Problem 2. Two numbers are relatively prime, and their product is equal to 23 × 52 × 133. What could these numbers be? Find all the answers. 22.3. Take-Home Problem Set 183

Problem 3. The greatest common factor of 2 numbers is 6, and their product is 22 × 32 × 115. What could these numbers be? Find all the answers. Problem 4. (a) Prove that the product of any 5 consecutive natural numbers is divisible by 30. (b) Prove that the product of any 5 consecutive natural numbers is divisible by 120. Problem 5. (a) Find the biggest N such that 100! is divisible by 11N . (b) Find the biggest N such that 100! is divisible by 35N . Problem 6. Prove that 50! is not a perfect square. Problem 7. Find the smallest n such that n × (n +1)× (n +2)× (n +3) is divisible by 1,000. Problem 8. (a) The number a +1 is divisible by 3. Prove that 4a +1 is divisible by 3 as well. (b) The number a +1is divisible by 3. Prove that 7a +16is divisible by 3 as well. (c) The number a +13is divisible by 3. Prove that 2a − 13 is divisible by 3 as well. Problem 9. Find the last 2 digits of the sum: 1!+2!+···+1,999!+2,000!. Problem 10. The number 2+a is divisible by 11. Prove that 31 − a is divisible by 11 as well. Problem 11. The number x +2y is divisible by 7. Prove that 6x +5y is divisible by 7 as well. Problem 12. Come up with 3 different numbers x, y, z such that x+y +z is divisible by x,by y,andbyz. Problem 13. Come up with 5 different numbers such that their sum is divisible by any one of them. Problem 14. A table has 2 rows and infinitely many columns. The first row contains all positive multiples of 9: 9, 18, 27, 36, .... In the second row, below each multiple of 9, the sum of its digits is written. Thus, the first four columns of the second row contain 9, 9, 9, and 9. (a) What is the position of the first number 81 in the second row? (b) In the second row of this table, which comes first: the number 36 or 4 consecutive number 27’s?

22.3. Take-Home Problem Set The unsolved problems of today’s Race constitute the homework.

Session 23: Mathematical Auction

Today is another math entertainment day—the day of another mathematical auction. For the detailed description of the rules, the reader is referred to the “Mathematical Auctions” chapter (page 235). Today’s game is a break in the sequence of four lessons on divisibility. Divisibility is an extremely important topic; however, it is also a difficult one. Not only do the children become tired, but they need time to process the newly acquired knowledge and to make it their own.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student). - Printouts of the Mathematical Auction problem set (one per stu- dent). - Grid paper would come in handy since several of the auctions problems are problems on a grid. - Optional: small prizes for the winning team, or for both teams.

23.1. Event of the Day: Mathematical Auction Game The suggested timeframe for today’s game is 5 minutes for splitting the students into groups, 30 minutes for problem solving, and 30 minutes for auctioning. Depending on the length of your session, you may have enough time to discuss the solutions to the take-home assignment. You can set the price of each problem in this Auction to 100 shmollars. In this case, each team should have 250 shmollars at the start of the game.

185 186 Session 23: Mathematical Auction

23.2. Mathematical Auction Problems Problem 1. Express the number 100 using the digit 8 only. Use as few digit 8’s as possible. You can use 4 arithmetic operations (“+,” “−,” “×,” “÷”), exponentiation (raising to a power), and parentheses. The same operation can be used several times, and it is not required to use all of them. Do not combine 8’s into multi-digit numbers such as 88 or 888. A team has a stronger solution for this problem if it can use fewer 8’s. Problem 2. You have a long straight wooden plank. You want to place several marks on it so that you can use this plank as a measuring tool. Your goal is to be able to measure any length from 1 to 20 as a distance between 2 marks on the plank. Use as few marks as possible. A team has a stronger solution for this problem if it can use fewer marks. Problem 3. Place as few chess knights as possible on an 8 × 8 chessboard so that every empty square is attacked. A team has a stronger solution for this problem if it uses fewer knights. Problem 4. An artist works on a painting of an abstract “snake” on a 7×7 board. His “Snake” is a collection of squares that he paints according to the following rules: - Each newly painted square should share a side with a square painted on the previous step. - The newly painted square should not share sides with any other sections of the snake. (It can share corners, though.) The artist was able to make a snake that is 31 squares long (see the picture). What is the longest possible snake you can paint?

A team has a stronger solution for this problem if it can demonstrate a solution with a longer snake. Problem 5. You have several cards: 2 cards labeled 1, 2 cards labeled 2, and so on up to n. A magical rearrangement of these cards is one such that there is exactly 1 card between the cards labeled 1, exactly 2 cards between the cards labeled 2, and so on up to n.Ifn =3, here is a magical rearrangement of the cards: 312132 23.3. Take-Home Problem Set 187

Find a magical rearrangement for n as large as possible. A team has a stronger solution for this problem if it can demonstrate a longer rearrangement.

23.3. Take-Home Problem Set Problem 1. Here are phrases in Swahili with their English translations: - atakupenda — He will love you. - nitawapiga — I will beat them. - atatupenda — He will love us. - anakupiga — He beats you. - nitampenda — I will love him. - unawasumbua — You annoy them. Translate the following into Swahili: - You will love them. - I annoy him. Problem 2. (a) Some vertices of a regular heptagon are colored black, others—white. Prove that is it possible to choose 3 vertices of the same color that make an isosceles triangle.

(b) Is the same true for an octagon? Problem 3. Robbie the Robot calculated 15! and wrote this number on the whiteboard. Naughty Nick replaced some of the digits in this number by asterisks, leaving this expression: 15! = 130 ∗ 674368 ∗∗∗. Find the missing digits without actually calculating 15!. Problem 4. Prove that a number is divisible by 4 only when the number formed by its last 2 digits is divisible by 4. Problem 5. Prove that a number composed of the digits 6 and 2 can never be a perfect square. Problem 6. Can you find 100 consecutive natural numbers that would not contain a single prime number? 188 Session 23: Mathematical Auction

Problem 7. There are 101 wise men standing in a circle. Each one of them believes that either the Earth is flat or the Earth is round. Every five minutes, all at once, the wise men voice out their opinions on this matter. Immediately after that, each wise man for whom both neighbors disagree with him changes his opinion. Prove that after several iterations the wise men will stop changing their points of view. Session 24: Divisibility IV. Divisibility by 3 and Remainders

Since the topic of divisibility and remainders is relatively heavy with alge- braic proofs, we will be approaching it gradually. Today, we will start with a special case: we will be exploring divisibility by 3. This approach will help us to pave our way into divisibility theory. The ideas and techniques that we discuss today will fully illustrate the general model; however, our proofs will be more “lightweight” than “generic” divisibility proofs. Besides, remainders-by-3 problems are interesting in their own right and have their unique place in the collection of divisibility problems.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

24.1. Math Warm-up Warm-up 1. Let’s solve a few more simple Word Ladder puzzles, from cut-the-knot [26]: - Change WET to DRY. -CoverEYEwithLID. - Transform LIKE into MATH. (We introduced Word Ladder puzzles in Chapter 20, page 161.)

24.2. Discussion of the Day: Remainders When Divided by 3 Let’s start the main discussion with a reminder about parity : a simple but powerful problem-solving technique that proved to be so handy for such a wide variety of problems. (Parity is defined by a remainder: a number is even if it can be divided by 2 without a remainder; it is odd if it has a remainder.)

189 190 Session 24: Divisibility IV. Divisibility by 3 and Remainders

If remainders after division by 2 turned out to be so useful in problem solving, could remainders after division by other numbers happen to be as handy? The answer is affirmative.

Today, we will be exploring divisibility by 3 and will be learning how to use it in problem solving. We start by defining all terms related to integer division by 3. -ThenumberX has remainder 0 when divided by 3 if X =3K. -ThenumberX has remainder 1 when divided by 3 if X =3K +1. -ThenumberX has remainder 2 when divided by 3 if X =3K +2. (K is some integer number.)

This formal definition makes it much easier to prove problems on divis- ibility and remainders. For a beginner, it is also helpful to keep in mind a visual model of divisibility by 3. (See the picture below.)

Has remainder 0 when divided by 3

Has remainder 1 when divided by 3

Has remainder 2 when divided by 3

We can also consider an “informal” definition of a remainder: “the small- est non-negative number that, if subtracted, gets us to a multiple of 3.”

Let’s illustrate these definitions with examples. The number 36 has remainder 0 when divided by 3. Indeed, 36 can be split up into 12 groups of 3 and also can be written as 3 × 12 + 0. The number 19 has remainder 1 when divided by 3. Indeed, 19 can be split up into 6 groups of 3 with an extra 1 and also can be written as 3×6+1. The number 26 has remainder 2 when divided by 3. Indeed, 26 can be split up into 8 groups of 3 with an extra 2 and also can be written as 3×8+2.

24.3. Arithmetic of Remainders Addition and Remainders after Division by 3 It is very important to understand how arithmetic operations on numbers affect remainders. Let’s investigate what happens when numbers are added. Our goal is to prove that the remainder of a sum is completely defined by the remainders of the numbers that are being added (addends). 24.3. Arithmetic of Remainders 191

It is easy to see that if two numbers are divisible by 3, then their sum is divisible by 3 as well. Indeed, if X =3K and Y =3M,thenX + Y =3K +3M =3(K + M).

Now, suppose that both X and Y have remainders 1 when divided by 3. What happens to the sum X + Y ? Before moving to the algebraic proof, let’s explain the answer using our visual model. If a number has remainder 1, then it is composed of several groups of 3 and an extra 1. Thus, when two of such numbers are added, the sum will be composed of several groups of 3 and an extra 2. So, the sum has the remainder 2. (See the picture below.)

Now, it’s time for an algebraic proof. X =3K +1,andY =3M +1. Therefore, X +Y =3K +1+3M +1 = 3(K +M)+1+1 = 3(K +M)+2. Thus, X + Y has remainder 2.

Next, suppose that both X and Y have remainders 2.Whatwould the remainder of X + Y be? Is it going to be 4 or 1? Let’s check:

X + Y =3K +2+3M +2 =3K +3M +2+2 =3K +3M +3+1 =3(K + M +1)+1.

So, the remainder is 1. We can illustrate this visually as well:

Let’s keep working—we have several more combinations of remainders to explore. To keep our results organized, let’s create a table for these remainders. We already know how to fill several cells; we can proceed in 192 Session 24: Divisibility IV. Divisibility by 3 and Remainders the same way, filling the rest of the cells one by one. The complete table is below: +0 0 1 2 0 0 1 2 1 1 2 0 2 2 0 1

Now, it’s time to formulate the generic rule for how division-by-3 remain- ders behave under addition. It would be tempting to say that the remainder of the sum of two numbers is equal to the sum of their remainders. Unfortunately, this statement is not quite right: take a look at the pair of remainders (2, 2). While their sum is 4, the remainder of their sum is 1.

Thus, the correct rule is: the sum of two numbers has the same remainder as the sum of their remainders.

Applying the same reasoning, we can come up with а similar rule for several numbers: the sum of several numbers has the same remainder as the sum of their remainders.

Example. Suppose that we would like to find the remainder when divided by 3 of the sum 1+2+···+ 99 + 100. For a problem like this, there is no need to calculate the actual sum. All we have to do is add the remainders of the numbers 1, 2, ..., 100. To emphasize the pattern of the remainders, let’s group the numbers by 3: (1 + 2 + 3) + (4 + 5 + 6) + ···+ (97 + 98 + 99) + 100. Next, let’s replace this sum by the sum of the remainders: (1 + 2 + 0) + (1+2+0)+···+(1+2+0)+1. There is no need to calculate this new sum either because our goal is to find the remainder of this sum when divided by 3. It is easy to notice that each sum in parentheses has remainder 0. Therefore, the entire sum has remainder 1. Thus, 1+2+···+ 99 + 100 is divisible by 3 with remainder 1.

Subtraction and Remainders after Division by 3 When we subtract, the remainders behave similarly. We can illustrate the overall idea using two examples. Suppose that X has remainder 2 and Y has remainder 1 when divided by 3. What is the remainder of X − Y ? It is easy to prove that the remainder is 2 − 1=1. Suppose that X has remainder 1 and Y has remainder 2 when divided by 3. What is the remainder of X − Y ? 24.3. Arithmetic of Remainders 193

It would be tempting to say that the remainder is 1 − 2=−1. However, a remainder cannot be negative: it has to be 0 or 1 or 2. So, what should we choose? First, let’s recall that a remainder is the smallest positive number that, if subtracted, gets us to a multiple of 3. The number X − Y is 1 less than a multiple of 3. What should we subtract from it to get us to a smaller multiple of 3? This has to be 2. Thus, the remainder is 2. Next, let’s run a more formal proof. If we subtract a number with remainder 2 from a number with remainder 1, then we get a result that is expressed as 3 × K − 1,whereK is some integer. This expression can be rewritten as 3 × (K − 1) + 2. Now, it is easy to see that the remainder is 2.  It follows from this discussion that, for example, the remainder of −1 when divided by 3 is 2, and the remainder of −4 is 2. Can you tell what the remainder of −2 is? How about the remainder of −3? We are not going to create an entire subtraction table during this lesson since this task is included in the homework. However, we are going to state that, similarly to addition, the difference of two numbers has the same remainder as the dif- ference of their remainders.

Let’s also point out another important idea that follows: if we need to calculate the remainder of a combination of additions and subtractions, we can simplify the task by working with the remainders instead of the original numbers.

Multiplication and Remainders after Division by 3 Let’s now investigate what happens with remainders when numbers are multiplied. The goal of this section is to prove that the remainder of a product is defined by the remainders of the factors. We are going to prove it case by case. It is easy to see that when at least one of the two terms is divisible by 3, the entire product is divisible by 3 as well. Indeed, suppose that X =3M.Inthiscase,X × Y =(3M) × Y =3(M × Y ). This number is clearly divisible by 3. This observation allows us to fill quite a few entries in the multiplication table of remainders (see the table below): × 0 1 2 0 0 0 0 1 0 2 0 194 Session 24: Divisibility IV. Divisibility by 3 and Remainders

Next, let’s multiply two numbers, each having remainder 1.The remainder of the product will be 1, and we are going to prove this fact in 2 ways : visually and algebraically. Visual proof: We will utilize the fact that the product of two numbers can be visualized as an area of a rectangle with sides equal to these numbers. The picture below illustrates the multiplication of two numbers that have remainders 1. Each of these numbers contains several groups of 3 and an extra 1. Thus, the product of the numbers is composed of several 3×3 squares (dark gray squares), several 1 × 3 rectangles (light gray), and a single 1 × 1 square (white). All 3 × 3 squares and all 1 × 3 rectangles are multiples of 3. Therefore, the remainder of the product is the 1 × 1 white square, which has an area of 1. 3 3 3 1

3 3 1

The algebraic proof demonstrates the same idea, expressed in a more compact and formal way: (3M +1)× (3N +1)=3M × 3N +3M +3N +1 =3(3M × N + M + N)+1. 

Now suppose that each of the two numbers has remainder 2.What would the remainder of their product be? Again, let’s start with the visual proof. The picture below illustrates the multiplication of two numbers that have remainders 2. Similarly to the previous proof, every gray 3 × 3 square is a multiple of 3, and every light gray 2 × 3 rectangle is a multiple of 3 as well. Therefore, the remainder is defined by the 2×2 white square. Three 1×1 white squares make a multiple of 3 (L-shaped in the picture). Thus, the actual remainder is the 1 × 1 white square, which has an area of 1. 3 3 3 2

3 3 2

We can follow with an algebraic proof: (3M +2)× (3N +2)=3M × 3N +6M +6N +4 =3(3M × N + M + N +1)+1. 24.3. Arithmetic of Remainders 195

Similarly, the product of the two numbers with remainders 1 and 2 will have remainder 2. Finally, we can fill the entire multiplication table.

× 0 1 2 0 0 0 0 1 0 1 2 2 0 2 1

Looking at this table, we are ready to formulate the multiplication rule. As with addition, the claim that “the remainder of a product is equal to the product of the remainders” is not entirely true. The correct rule is: the product of two numbers has the same remainder as the product of their remainders. The same is true for the product of several numbers.

Example. Calculate the remainder of 8200 when divided by 3. Discussion. We can simplify the problem by replacing all 200 factors “8” with their remainders. The new simplified problem would be to calculate the remainder of 2200. Let’s approach this new problem gradually, starting from the low powers of 2. 21 =2. It has remainder 2. 22 =4. It has remainder 1. 23 =22 × 2. Thus, the remainder of 23 is determined by the product of the remainders of 22 and 2. It is equal to 1 × 2=2. 24 =23 × 2. Thus, the remainder of 24 is determined by the product of the remainders of 23 and 2. It is equal to the remainder of 2 × 2,whichis1. Thus, we see the pattern—the remainders of powers of 2 alternate, with all even powers having remainders 1, and all odd powers having remainders 2. Therefore, 8200 has remainder 1 when divided by 3.

Modulo notation The phrase “remainder when divided by ...” is a rather long one. Mathemati- cians, a lazy bunch, came up with a way to shorten things—the “modulo” notation, which stands for “the remainder when dividing”. For example, the phrase “remainder of 10, when divided by 3" can be replaced by “10 modulo 3”, and the phrase “5 has remainder 2 when divided by 3” can be replaced by “5 is equal to 2 modulo 3”. Let’s practice: - “19 modulo 3” stands for “remainder of 19 when divided by 3”. - “19 is equal to 1 modulo 3” means “19 divided by 3 has remainder 1”. - “20 is equal to 0 modulo 2” means “20 divided by 2 has remainder 0”. - “17 is equal to 2 modulo 5” means “17 divided by 5 has remainder 2”. 196 Session 24: Divisibility IV. Divisibility by 3 and Remainders

The special congruence symbol “≡” can be used to shorten things further. For example: “5 is equal to 2 modulo 3” can be written as “5 ≡ 2 mod 3”. For Teachers: In our book, we will keep using "remainders" instead of modulo terminology because this is way more descriptive for younger students. You are welcome to use the modulo notation if it is suitable for the level of your group.

24.4. Take-Home Problem Set Problem 1. Construct a table of remainders when divided by 3 for the difference of two numbers a and b. (Remember that remainders cannot be negative.) _ b 021 0 a 1 2

Problem 2. Can the sum of three consecutive counting numbers be prime? Problem 3. Prove that 3773 − 1 is divisible by 3. Problem 4. Don Pedro has a purse full of 3-shmollar coins. With some of these coins, he bought 1 sombrero and received change, which was a 1- shmollar coin. The next day, he bought 7 sombreros, paying with 3-shmollar coins as well. Prove that this day his change was а 1-shmollar coin again. Problem 5. Find the remainder of 1610 − 2101 × 722 when divided by 3. Problem 6. Prove that the numbers 12n +1and 12n +7are relatively prime. Problem 7. Clarissa is tearing her test (1 piece of paper) into small pieces. She picks up a piece and tears it into either 4 pieces or 10 pieces. Can she end up with 2 million pieces? Problem 8. Three brothers harvested their wheat and arranged the bun- dlesinaneatsquare(forexample,6×6, 8×8,ormaybe20×20, etc.—we don’t know how large). They wanted to divide the wheat fairly so that each would get the same number of bundles but could not. Then their father pointed out that two more bundles were left out in the field. Will the brothers be able to divide their harvest now? Problem 9. There are 25 bugs sitting on the squares of a 5×5 board, 1 bug per square. When I clap my hands, each bug jumps to a square diagonally from where it was before. Prove that after I clap my hands, at least 5 squares on the board will be empty. 24.5. Additional Problems 197

24.5. Additional Problems Problem 1. Bob’s Exact Fuel had 6 containers of dilithium that contained 15, 16, 18, 19, 20, and 31 tons of dilithium. Bob fueled two spaceships and used up 5 containers; the last container remained full. Which container was left if 1 spaceship received twice as much dilithium as the other and each received a whole number of tons of fuel? Problem 2. Is there a prime number p such that p − 100 and p + 100 are also prime? Problem 3. x2 + y2 = z2. Prove that either x or y is divisible by 3. Problem 4. Prove that any number has the same remainder when divided by 3 as the sum of its digits. Problem 5. Prove that n3 +2n is divisible by 3 for all counting numbers n.

Session 25: Divisibility V. Divisibility and Remainders

During the previous session, we discussed remainders and divisibility by 3. This topic served as a fun and easy stepping stone into divisibility and remainders in general. Today, we will keep learning about remainders; however, since we have already discussed a specific scenario, the general case will come easier to us. We will start the lesson with examples that demonstrate several appli- cations of remainders. Next, we will introduce the formal definition and work our way through the properties of remainders. Finally, we will practice problem solving. While this is the last theoretical lesson on remainders, we will keep returning to this topic in our upcoming problem sets.

Teaching supplies for this session: - Printouts of the practice problems (one per student). - Printouts of the take-home problem set (one per student).

25.1. Math Warm-up Warm-up 1. Forward I am heavy, but backward I am not. What am I?

Warm-up 2. When can you add 2 to 11 and get 1 for the correct answer?

25.2. Discussion of the Day: Divisibility and Remainders The concept of a remainder is easy and natural: a remainder is simply a leftover after division. For example, if we share 13 candies between 5 girls, there will be 3 extra candies: 13 = 2 × 5+3. Thus, the number 3 is the remainder of 13 being divided by 5. Let’s introduce several examples that illustrate why remainders are so useful.

199 200 Session 25: Divisibility V. Divisibility and Remainders

Clock Mathematics and Remainders. We start with the classic example of clock mathematics. Suppose that the clock shows 12 PM. In 15 hours, what time will this clock show? What time will it show in 150 hours? Well, in 12 hours the clock’s hand will be back at 12, in 13 hours it will point at 1, and so on. The hand cycles with the period of 12 hours; therefore, the actual time is a remainder of the total elapsed time when divided by 12. (For this statement to be precise, we should assume that the time at noon is 0.) For example, 3 is the remainder when 15 is divided by 12. So, in 15 hours the hand will point at 3. And, since the remainder of 150 when divided by 12 is 6 (150 = 12 × 12 + 6), in 150 hours the clock’s hand will be pointing at 6. The concept of remainders comes up over and over again when we deal with time. Conversion between seconds, minutes, hours. Suppose that we are given time in seconds: 2,000 seconds, for example. How do we convert it into minutes? Division by 60, which is the number of seconds in a minute, gives us all the necessary information: the quotient tells us minutes and the remainder tells seconds. Since 2,000 = 60 × 33 + 20, 2,000 seconds are equal to 33 minutes and 20 seconds. Can you explain how to use remainders to convert seconds into hours, minutes, and seconds? For example, how many hours and minutes are there in 456,789 seconds? We follow with two examples which are relevant to program- ming. Suppose that you need to fill a 6-column table with positive integer numbers: row by row, left to right, starting from 1 in the top left corner: 1 2 3 4 5 6 7 8 9 10 11 12 ... Given a number, how could you calculate its upcoming row and column? For example, where would the number 1,000 go? Well, as we are filling the table, the column index cycles with the period 6. Therefore, the remainder when divided by 6 tells us the column index, and the quotient gives us the row index. (We assume that the first column has index 0 and the first row has index 0 as well.) For example, 1,000 = 6 × 166 + 4. Therefore, 1,000 will be in row 16 and column 4. The second example comes from computer games. You are, probably, familiar with games that use “wraparound”: when an object leaves one side of the screen, it reappears immediately on the opposite side, maintaining speed and trajectory. How can this functionality be programmed? Suppose that the screen is 140 units wide and that the x-coordinate of the left edge is 0. To implement the wraparound, the x-coordinate should be reset whenever a character steps off the screen. For example, instead of landing at 140 it 25.2. Divisibility and Remainders 201 should land at 0, instead of 141 it should land at 1, and so on. Now, suppose that the character has made a long jump; now, it has to land far off the screen, at x = 183. How could you find out the “wraparound” coordinate of its landing spot? What if it has to land at x = 301?Whatifithasjumped left and has to land at x = −10? You have probably already figured out the answer! The rule is very easy to describe in terms of integer division and remainders: the “wraparound” x- coordinate is equal to the remainder of the actual x-coordinate when divided by the screen width (in our case, by 140). Now, let’s get to the definition. Definition. An integer A has the remainder R when divided by a positive integer B if A = B × K + R,whereK and R are integers and 0 ≤ R

As with remainders by 3, it is useful to keep in mind a visual model for the division with remainders: A objects

B B B remainder objects objects objects R

Let’s get to the properties of remainders. Since all our proofs will work along the lines of the “divisibility by 3” proofs, we will be brief.

Addition, Subtraction, and Remainders In the same way as with division by 3, the remainder of a sum has the same remainder as the sum of the remainders. Here is a visual proof. Assume that we are adding two numbers, A1 and A2, that have remainders R1 and R2 when divided by B. The picture below shows that the remainder of the sum depends on the sum of the remainders only.

A1 objects A1 + A2 objects B B B B objects objects R1 objects objects R1

A2 objects B B R2 objects objects B B objects objects R2

Next, let’s do the algebraic proof. A1=B × K1+R1 and A2=B × K2+R2. Thus, A1+A2=B×K1+R1+B×K2+R2=B×(K1+K2)+R1+R2. Therefore, A1+A2 has the same remainder as R1+R2.  202 Session 25: Divisibility V. Divisibility and Remainders

It is important to highlight one more time the fact that the remainder of the sum is not always equal to the direct sum of the remainders. For example, 15 and 16 have the remainders 5 and 6 when divided by 10, and their sum of 31 has the remainder 1. It is easy to see that the sum of the remainders, which is 5+6 = 11, is not equal the remainder of the sum. Instead, the numbers 11 and 1 have the same remainder when divided by 10. Applying the same reasoning, we can come up with а similar rule for several numbers: the sum of several numbers has the same remainder as the sum of their remainders. Moreover, we can apply the same rule when we subtract numbers or when we have a combination of additions and subtractions.

Multiplication and Remainders Let’s now investigate what happens with remainders when numbers are multiplied. The goal of this section is to prove that the remainder of a product has the same remainder as the product of the remainders. Let’s start with the visual proof. It utilizes the fact that the product of two numbers can be visualized as an area of a rectangle with sides equal to these numbers. The picture below illustrates the multiplication of two numbers that have remainders R1 and R2 when divided by B. The product of these numbers is composed of a bunch of B × B squares (dark gray squares), several rectangles with side B (light gray rectangles), and a single R1 × R2 rectangle (white). The areas of all gray squares and gray rectangles are divisible by B. Therefore, the remainder of the product is the same as the remainder of the area of the white rectangle, which is equal to R1 × R2. B B R1

B

B R2

The algebraic proof illustrates the same idea, expressed more compactly:

A1 × A2=(B × k1+R1) × (B × k2+R1) = B × k1 × B × k2+B × R1+B × R2+R1 × R2 = B(B × k1 × k2+R1+R1) + R1 × R2. 

The same “multiplication of remainders” rule works for the product of several numbers as well.

Problem 1. What is the remainder of 7,780 × 7,781 × 7,782 × 7,783 when this number is divided by 7? 25.2. Divisibility and Remainders 203

Problem 1 Discussion. We can start with replacing the multiplicands by their remainders. We get the product 3 × 4 × 5 × 6. (These remainders are easy to guess since 7,777 is divisible by 7.) Instead of calculating this entire product, we can run another round of simplifications: 3 × 4=12,which has the remainder 5, and 5 × 6=30, which has the remainder 2. Thus, 3 × 4 × 5 × 6 has the same remainder as 5 × 2=10. The number 10 has the remainder 3 when divided by 7; therefore, 77,780 × 7,781 × 7,782 × 7,783 has the remainder 3 as well. Problem 2. What is the remainder of 1,203 × 1,203 − 1,202 × 1,205 when divided by 12? Problem 2 Discussion. The remainder of 1,203 × 1,203 isthesameasof 3 × 3=9, and the remainder of 1,202 × 1,205 is the same as of 2 × 5= 10 (1,200 is a multiple of 12). Thus, we are looking for the remainder of 3 × 3 − 2 × 5=9− 10 = −1. Wow, we get a negative number! What is the remainder of −1 when divided by 12? Is it 1 or −1 or 11 or −11? According to the definition, a remainder cannot be negative; to get the remainder, we should go down to the closest multiple of 12. The closest multiple of 12 that is smaller than −1 is −12. (Indeed, −1=12×(−1)+11.) Thus, the remainder of 1,203 × 1,203 − 1,202 × 1,205 when divided by 12 is 11. Problem 3. What is the remainder of 3100 when divided by 7? Problem 3 Discussion. To solve this problem, we should start by com- puting remainders of low powers of 3. Our goal is to discover a pattern that would allow us to calculate the remainders of higher powers. We will be recording the results in the table, the first row containing the powers of 3, the second row—their remainders. powers 31 32 33 34 35 ...... remainders 3 32 =9. It has remainder 2 when divided by 7. 33 =32 × 3. Therefore, the remainder of 33 is defined by the remainders of 32 and 3. It is equal to 2 × 3=6. 34 =33 × 3. Therefore, the remainder of 34 is defined by the remainders of 33 and 3. It is equal to the remainder of 6 × 3=18,whichis4. 35 =34 × 3. Therefore, the remainder of 35 is defined by the remainders of 34 and 3. It is equal to the remainder of 4 × 3=12,whichis5. 36 =35 × 3. Therefore, the remainder of 36 is defined by the remainders of 35 and 3. It is equal to the remainder of 5 × 3=15,whichis1. 37 =36 × 3. Therefore, the remainder of 37 is defined by the remainders of 36 and 3. It is equal to the remainder of 1 × 3=3,whichis3. Thus, we see the pattern—the remainders alternate with period 6, with all powers that are multiples of 6 having remainder 1. 204 Session 25: Divisibility V. Divisibility and Remainders

powers 31 32 33 34 35 36 37 38 ... remainders 3 2 6 4 5 1 3 2 Therefore, 396 has the remainder 1, and 3100 has the remainder 4 when divided by 7. Problem 4. Prove that n3 +5n is always divisible by 6. Problem 4 Discussion. Let’s start by splitting 6 into the product of two coprime numbers, 6=2× 3. Next, if we could prove that the expression is divisible by 2 and by 3, we would know that it is divisible by 6. It is easy to justify divisibility by 2: whether we choose an odd or even value for n,the expression n3 +5n would always end up being even. To prove divisibility by 3, the easiest approach would be to construct a table of remainders for this expression. Three possible remainders when n is divided by 3 are 0, 1, and 2. n n2 n3 5n n3 +5n 0 1 2 Let’s demonstrate how to fill this table using the last row as an example. If n has the remainder 2, then n2 has the same remainder as 2 × 2=4, which is 1. Then n3 has the remainder 1 × 2=2;and5n has the same remainder as 5 × 2=10, which is 1. Thus, the expression n2 +5n has the same remainder as 2+1=3,whichis0. The completed table is below. n n2 n3 5n n3 +5n 0 0 0 0 0 1 1 1 2 0 2 1 2 1 0

Since all the remainders in the last column are 0’s, the expression n3 +5n is always divisible by 3. Let’s continue the lesson by asking the children to solve several problems on remainders.

25.3. Divisibility and Remainders Practice Problem 1. A number has remainder 1 when divided by 6. What could its remainder be when divided by 18? Find all answers. Problem 2. A number is divisible by 6 and by 4. What could its remainder be when divided by 24? Problem 3. Find the remainder of 8100 when divided by 9. Problem 4. What is the last digit of 1 · 2+2· 3+···+ 999 · 1,000? 25.5. Additional Problems 205

Problem 5. Find the remainder of 1,999·2,000·2,001·2,002·2,003·2,004· 2,005 − 1211 when divided by 7? Problem 6. Prove that x2 +1could never be divisible by 3. Problem 7. Prove that n3 − n is divisible by 24 for any odd n.

25.4. Take-Home Problem Set Problem 1. Tim had more hazelnuts than Tom. If Tim gave Tom as many hazelnuts as Tom already had, Tim and Tom would have the same number of hazelnuts. Instead, Tim gave Tom only a few hazelnuts (no more than five) and divided his remaining hazelnuts equally between 3 squirrels. How many hazelnuts did Tim give to Tom? Problem 2. Prove that if a and ax have the same remainders when divided by 7 and if 0

Problem 6. Seven robbers are dividing a bag of coins of various denom- inations. It turned out that the sum could not be divided equally between them, but if any coin is set aside, the rest could be divided so that every robber would get an equal part. Prove that the bag cannot contain 100 coins.

25.5. Additional Problems Problem 1. Erica receives the same allowance (a whole number of dollars) every week. She used her first week’s allowance to buy as many 3-dollar cookies as possible; she deposited the remaining money in the piggy bank. Using her second week’s allowance, she bought as many 6-dollar hair clips 206 Session 25: Divisibility V. Divisibility and Remainders as possible. She added the remaining money to the piggy bank as well. The third week, she bought as many 9-dollar books as possible and added the leftovers to the piggy bank, too. Altogether, in three weeks the piggy bank received 15 dollars. If Erica decides to spend her next allowance on 18-dollar board games, how much money will she deposit to the piggy bank? Problem 2. How many numbers between 1 and 2,015 have the sum of digits that is divisible by 5? Problem 3. Find the smallest number that has remainder 2 when divided by 3, remainder 3 when divided by 4, and remainder 4 when divided by 5. Problem 4. Prove that if a − b is divisible 7 and c − d is divisible by 7, then ac − bd is divisible by 7. Problem 5. Find a number n such that 30n − 45 is divisible by 239. (You don’t need to calculate the number, just write it as a formula.) Session 26: Graph Theory I. Graphs and Their Applications

Today, we are approaching the topic of graph theory, which is a beautiful and useful area of mathematics. It provides a common foundation for problems in a wide variety of subjects, ranging from computer science and engineering to chemistry, biology, linguistics, and sociology. Proficiency with graph theory is a must for a broad range of modern professions.

Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

26.1. Math Warm-up Warm-up 1. On a sheet of paper, draw (a) 4dots, (b) 5dots, (c) 6dots so that any 3 dots form the vertices of an isosceles triangle.

Warm-up 2. Link each house to its storage shed with paths so that these paths do not cross and do not leave the frame. (A shed is always marked by the same number as its house.)

1

2 3 2 3

1

207 208 Session 26: Graph Theory I. Graphs and Their Applications

26.2. Discussion of the Day: Why Graphs Are Important Let’s start the discussion with some problems. Problem 1. There are 9 computers connected with several cables to make a network. (Each cable connects a pair of machines.) Is it possible for each computer to be connected to exactly 3 others? Problem 1 Discussion. This is a challenging problem, and the children are not expected to solve it; instead, the goal is to start a discussion. The students will try to draw a working network, and they will fail. After several failed attempts, they will try to come up with an explanation as to why the required configuration is impossible. The chances are that they will attempt to use a “trial-and-error” approach, which is not going to work out. The good news is that by the end of the lesson they will know how to solve this problem. Problem 2. In the country of Farawaynia, there are 9 towns; some are connected by roads, and others are not. (A road connects a pair of towns with each other.) Is it possible that each of the towns is connected to exactly 3 other towns? Problem 2 Discussion. The problem is surprisingly similar to the previous one. The objects are different, but the underlying model is the same. Problem 3. It is known that in a certain company, each employee has exactly 3 friends among the co-workers. Is it possible that this company has exactly 9 employees? Problem 3 Discussion. Wow! The same problem again .... Problem 4. It is known that 3 edges meet at every vertex of a polyhedron. Is it possible for this polyhedron to have exactly 9 vertices? (A polyhedron is a 3D solid with flat faces.) Problem 4 Discussion. This problem is similar to the previous one as well.

We have been presented with 4 problems, which describe 4 real-life scenarios that are all distinct. However, all these scenarios are defined by the same model: a collection of objects, with some pairs of these objects connected to each other by some relation. Such models are called graphs, and the branch of mathematics that studies them is called graph theory. Graphs are fun to study; moreover, graph theory is an extremely important topic holding its own place at the intersection of mathematics and computer science.

Let’s introduce some terminology. The objects that we study in graph theory are called vertices. Certain pairs of these objects can be connected 26.2. Why Graphs Are Important 209 by links called edges. For example, in the first problem, computers serve as vertices and cable are edges; in the second one—towns are vertices and roads are edges; in the thirds one—employees are vertices and friendships are edges; finally, in the last one, vertices are vertices and, well, edges are edges. Can we come up with other problems that can be modeled in the same way? Plenty. For example, we can talk about infrastructure and transporta- tion: electrical grids, or airports and airline routes. Social networks are another example of graphs; even the entire World Wide Web is a graph. The next example comes from molecular chemistry and biology: atoms (vertices) are held together by chemical bonds (edges) to form molecules (graphs).

How do we picture a graph on paper? We draw dots that represent vertices. For each pair of vertices that are linked by an edge, we connect the corresponding pair of dots with a line. Take a look at the four graphs below that describe: - 4 people, all friends with each other, - 4 computers, each connected to 2 others, - a molecule of methane, CH4, with 1 atom of carbon connected to 4 atoms of hydrogen. - a tiny country with a capital and three villages, with the capital having the most roads. Can you tell which is which?

The students usually have plenty of questions about picturing graphs. For example, what happens when 2 edges of a graph cross over, as in the picture on the left? Does it signify something special? Does such an intersection create a vertex? It does not. Think about 2 roads that intersect via an overpass or 2 crossing computer cables. These edges (i.e., roads or cables) are totally different: it just happened that they cross over each other because of the limitations of drawing in 2-dimensions. Does it matter if the edge of a graph is straight or curvy? Does it make any difference if it is long or short? It does not. An edge indicates that there exists a link between 2 objects. However, an edge does not carry any information about the properties of this link (cable length, strength of a friendship, etc.) For example, all the graphs in the drawing below describe thesamemodel: 210 Session 26: Graph Theory I. Graphs and Their Applications

It’s time to get back to the very first problem about 9 computers, each connected to 3 others by cables. Is there a way to calculate the total number of cables that will be needed for such a configuration? In fact, there is. Each cable has 2 ends; therefore, if we calculate the total number of cable ends and divide the answer by 2, we will get the total number of cables. And the good news is that it is easy to calculate the total number of cable ends. Each computer has 3 cables; thus, the total number of cable ends is 3 × 9=27. So, the total number of cables is 27/2=13.5. Wow! Since the number of cables must be an integer, it is not possible to have half-a-cable! Therefore, such a configuration of computers is impossible! We were able to solve this problem without making a single attempt at constructing the network! The same approach will work for the rest of the problems as well. For example, take a look at Problem 3, about the company with 9 employees. We could count the total number of friendships similarly: we will sum up the number of friends person by person and divide the total by 2. We will end up with half a friendship, which is impossible.

26.3. How to Calculate the Number of Edges in a Graph This simple and handy approach for calculating the total number of edges is incredibly useful when working with graphs. Therefore, let’s repeat the algorithm one more time. - We go over all vertices of a graph, calculating the total number of edges that start at each vertex. - After we complete this step, we know the total number of edge ends in the entire graph. - Every edge has 2 ends. Therefore, to get the number of edges, we divide this total by 2. If the total happens to be odd, we know that such a graph is impossible.

Problem 5. There are 12 British gentlemen who met at a country club, and 10 of them shook hands with everyone else in the group. The last 2, who recently quarreled, shook hands with everyone else but each other. How many handshakes took place?

Problem 5 Discussion. This is a typical graph problem, with gentlemen playing the roles of vertices and handshakes playing the roles of edges. Two gentlemen made 10 handshakes each, and the other 10 gentlemen made 11 handshakes each. Therefore, the total number of “handshake-halves” is 2 × 10 + 10 × 11 = 130. Therefore, the number of handshakes is 130/2=65. 26.4. Take-home Problem Set 211

For Teachers: In our classes, we never miss a chance to enforce the content by introducing funny analogies. For example, when we present the algorithm for counting edges, we like to tell a little story about cutting the edges in half, getting a bunch of little tails hanging from the vertices, and calculating the total number of these tails. This helps the idea stick. Even after years later, students would say: “Aha, this is a problem about counting tails!”

For Teachers: There is a lot more about graphs that we did not have time to discuss during this lesson. For example, we did not introduce the “degree of a vertex” terminology, and we did not convert our algorithm for calculating the number of edges into a full-blown “number of odd vertices” theorem. We will be working on these during the next lesson.

26.4. Take-Home Problem Set Problem 1. Our office has 9 computers. My manager wants to link them into a network so that every computer would be connected with exactly 4 computers by network cables. (a) How many cables will we need? Can you draw such a configuration? (b) The manager decided to connect every computer with exactly 5 other computers. Is this a possible configuration?

Problem 2. There are 15 planets that circle the star called Aldebaran. Some of these planets have signed trade agreements with each other. Could it be possible that: - 4 of these planets have exactly 4 trade partners each, - 8 of these planets have exactly 5 trade partners each, - the rest of these planets have exactly 3 trade partners each?

Problem 3. During a chess tournament some people played 5 games and some people played 6. Prove that the number of people who played 5 games is even.

Problem 4. Eight people came to a party, some of them shook hands. Is it possible that 6 of them shook hands with 6 different people at the party, and 2 shook hands with only 2 each?

Problem 5. Martian amoebas gemmate (they multiply by division). When a red amoeba divides, it splits itself into 5 blue amoebas; when a blue amoeba divides, it splits into 7 red amoebas. When my spaceship left Mars, I put 1 amoeba into a jar. Upon arriving on Earth, the customs officer found 100 amoebas in that jar. Why does he keep searching my ship, insisting that some amoebas must have escaped? 212 Session 26: Graph Theory I. Graphs and Their Applications

Problem 6. The 99 greatest scientists of Mars and Venus are seated evenly around a circular table. If any scientist sees 2 colleagues from his own planet sitting an equal number of seats to his left and right, he waves to them. For example, if you are from Mars and the scientists sitting 2 seats to your left and right are also from Mars, you will wave to them. Prove that at least 1 of the 99 scientists will be waving, no matter how they are seated around the table. Session 27: Graph Theory II. Handshaking Theorem

During this session, we will keep working on graph theory. We will introduce several new definitions and discuss the “Even Number of Odd Vertices” theorem. Also, we will do plenty of problem solving.

Teaching supplies for this session: - Printouts of the in-class problem set (one per student). - Printouts of the take-home problem set (one per student).

27.1. Math Warm-up Warm-up 1. Starting with this arrangement of matches, can you: (a) relocate 2 matches to get 6 squares? (b) relocate 3 matches to get 3 squares? (c) relocate 4 matches to get 3 squares?

Warm-up 2. Relocate 1 match to create a square.

213 214 Session 27: Graph Theory II. Handshaking Theorem

27.2. Discussion of the Day: Odd Vertices Theorem We start this lesson by discussing several important definitions.

The degree of a vertex: The number of edges that start at a given vertex is called thedegreeofavertex. It is a very useful characteristic of a vertex; later on, we will be using it in problem solving.

In the image below, we have a graph with the degrees of the vertices clearly shown.

2 2

2 0

3 1

Take another look at this picture: one of the vertices has degree 0. Is such a vertex still part of the graph? It definitely is. For plenty of real-time scenarios, we can end up with vertices that have no links with any others. It could be a person at a party who does not know anyone else or a town without an airport. Such a vertex would still be a part of its graph. The picture above also illustrates that a graph can consist of several “pieces” that are not linked to each other. Such pieces are called com- ponents. (In the graph above, the first component contains 5 vertices, and the second contains just 1 vertex.)

Two vertices connected by an edge are called neighbors.Theset of all neighbors to a given vertex is referred to as the neighborhood of this vertex. Two vertices are connected if there is a path that links them. (A path is a sequence of connected edges.) A component is a set of connected vertices. If two vertices are not connected, they belong to different components.

For example, in the picture below: - Vertices B, C, and F are the neighborhood of the vertex A. - Vertex G is connected to A via the A-C-G path. - Vertices D and B are not connected. - The graph has 2 components: the first one contains vertices A, B, C, F, and G, and the second one—vertices D and E. 27.2. Odd Vertices Theorem 215

B CD G A EF Take a look at the pictures below. The graph on the left has 3 compo- nents. How many components does the graph on the right have?

Markers of different colors would help us answer this question. Starting from any vertex in the graph on the right, let’s trace all the edges and vertices that are reachable from it. This way, we get the first component. To get the next component, choose an unmarked vertex, and with a marker of a different color trace all the edges and vertices that can be reached from this vertex. Repeat this process until all edges and vertices are marked. It will turn out that the graph on the right has three components which are, in fact, identical to the components of the graph on the left: 2 3-vertex loops and a single 2-vertex component. One more useful definition: a graph that has every vertex connected to every other is called complete .

In the picture below, the graph on the left is not complete, while the one on the right is.

TheTheoremaboutOddandEvenVerticesinaGraph (Handshaking Theorem) During the previous lesson, we found an elegant way to prove that a certain configuration of computers (9 computers, each connected to 3 others) is impossible. Computer by computer, we calculated the total number of cable ends: it turned out to be 27. Next, we divided this number by 2 to get the total number of cables. The answer, 13.5, was complete nonsense. Thus, we concluded that the required configuration is impossible. Today we will generalize this handy and useful technique. Theorem. For any graph the number of vertices with an odd degree must be even. 216 Session 27: Graph Theory II. Handshaking Theorem

Proof. In fact, we already know how to prove this theorem. Let’s calculate the total number of edge ends in 2 different ways: vertex by vertex and edge by edge. - First, just as in the problem about the computers, this total can be calculated vertex by vertex: it will be equal to the sum of the edge ends that start at each vertex. Using the new terminology, we can rephrase this approach as “the total number of edge ends is equal to the sum of the degrees of the vertices”. - Next, let’s note that this total number of edge ends can also be cal- culated edge by edge: it is equal to twice the total number of edges in the graph. Since each edge has 2 ends, the total number of edge ends must be even. This means the total calculated using the first approach, vertex by vertex, must be even as well. Every even vertex contributes an even addend, every odd vertex—an odd addend. For the total to be even, the sum of these odd addends must be even. Therefore, the number of odd vertices must be even.  Hurray! We proved the theorem. Quite often this theorem is called the “Handshaking Theorem.” Can you explain why? Let’s demonstrate how the Handshaking Theorem can be used in problem solving. Problem 1. In FarFarAway Land there is only one mode of transportation, by magic carpet. Twenty-five carpet lines serve the Capital. A single carpet line serves Smallville, and every other city is served by exactly 10 carpet lines. Show that it is possible to travel by magic carpet from the Capital to Smallville (perhaps with several transfers). Problem 1 Discussion. We cannot draw a map of the Land because we simply do not know how many cities are there. Instead, let’s use a proof by contradiction approach. Suppose that there is no path from Smallville to the Capital. This means that the Capital and Smallville belong to different components.

Capital Smallville

Let’s take a look at all the cities that are accessible from Smallville. The Capital does not belong to this group. That means this component has several towns with 10 roads each and 1 town with 1 road. So, the total number of road ends in this component must be an odd number. (It is equal to the sum of several 10’s and of a single 1.) However, we know that the 27.3. In-Class Problem Set 217 total must be even. Thus, our original assumption is incorrect: Smallville and the Capital must be connected.

The Handshaking Theorem tells us that certain graphs (the ones with odd numbers of odd vertices) are impossible. It is very easy for children to fall into the logical fallacy of assuming that the opposite is equally true: if a graph does not contradict the Handshaking Theorem, then it does exist. This is incorrect: there might be other reasons that could make such a graph impossible. The next problem explores this idea.

Problem 2. Last week, 8 heads of state, including 3 presidents, 3 prime ministers, and 2 emperors, got together for a conference. According to a reporter, each president shook hands with 6 heads of state, each prime minister—with 4, and each emperor—with 1. Is the reporter correct?

Problem 2 Discussion. The 8 heads of states make 8 vertices in a graph. Thedegreesoftheseverticesare6,6,6,4,4,4,1,and1.Thetotalnumber of odd vertices is 2; so, this problem does not contradict the Handshaking Theorem. Therefore, the first reasonable step toward finding a solution would be to try to draw such a graph. Such an attempt, while being unsuccessful, will help us to understand why such a graph is impossible. Look at the 3 presidents: each skipped just 1 person. So, each president must have shaken hands with at least 1 emperor. Therefore, the 2 emperors together must have made at least 3 handshakes with presidents. However, according to the problem, each emperor made just 1 handshake. We have a contradiction.

Now, it’s problem-solving time. It would be a good idea to split the children into small groups. This way, they will be able to help each other master the problems.

27.3. In-Class Problem Set Problem 1. Can you draw a graph that has 5 vertices, in which the degrees of these vertices are 4, 4, 4, 2, and 2? Either draw such a graph or explain why it is impossible.

Problem 2. (a) Can you draw a graph that has 8 vertices, each of degree 3? (b) Can you draw a graph that has 21 vertices, each of degree 3? (c) Can you draw a graph that has 20 edges, with all of its vertices having a degree of 3? For each part, either draw such a graph or explain why such a graph is impossible. 218 Session 27: Graph Theory II. Handshaking Theorem

Problem 3. This year, 15 students registered for the summer “Hiking with Llamas” backcountry trip. It is known that every participant is acquainted with at least 7 more students from his school who registered for the same trip. Show that all the children are, in fact, from the same school. Problem 4. There are 12 towns on the Island of Knights and Liars; roads connect some of them. Mr. X claims that a different number of roads start in each town. Prove that Mr. X is a Liar. Problem 5. Amoeba People from the planet Al-Dabra can grow any numbers of arms they like. During the New Year fireworks, they all grabbed each other’s hands in such a way that there were no extra hands left. Prove that the number of odd-handed Al-Dabrian Amoeba People is even.

27.4. Take-Home Problem Set Problem 1. Connect 6 points with curved lines such that the lines would not intersect and each point would have 4 lines ending in it. Problem 2. The 6 towns in the country of Soupstop are connected by 6 roads as shown. Several flying saucers landed on each of the roads. The captain of each saucer sent an alien to each of the 2 nearest towns to steal a fresh bowl of soup (everyone knows that flying saucers use chicken soup as their fuel). As a result, a bowlsofsoupwerestoleninA,b bowls went missing in B, C lost c bowls, D lost d bowls, and in E the aliens snatched e bowls of soup. How many bowls of chicken soup were abducted in F? A

F B

E C

D

Problem 3. In a graph of 40 vertices, the degree of each vertex is at least 20. Prove that the graph is connected. Problem 4. (a) Michael, the computer technician, likes the number 5. Therefore, he connected 10 computers into a network so that each computer is connected to exactly 5 others. Draw an example of such a network. (b) Now, Michael plans to connect 30 computers into a network with every computer connected to 5 others. How many cables would he need? (c) Finally, Michael is planning to come up with a network that uses 56 cables. (Still, every computer should be connected to 5 others.) Will he be able to succeed? 27.5. Additional Problems 219

Problem 5. Every person from the Knights and Liars Island said 2 phrases: - “I have an odd number of knight friends.” - “I have an even number of liar friends.” Is the total number of Islanders odd or even? Problem 6. The remote country of Booroodoo has 2 airlines, Royal and Republican. Each Booroodoo airport is served by 4 flights, 2 of which are Royal and 2 are Republican. Out of all these flights, only 2 are international. Prove that these 2 flights belong to the same airline.

27.5. Additional Problems Problem 1. The state of Shmarkansas has 15 counties. Can it happen that each county borders 3, 5, or 9 counties in Shmarkansas? Problem 2. Can you draw 9 segments on a plane such that each segment intersects with exactly 3 other segments? (No 3 segments should intersect at the same point.) Problem 3. The faces of a polyhedron are painted in 2 colors so that the faces of the same color never share an edge. It is known that all faces except 1 have an even number of edges. Prove that the remaining face also has an even number of edges. Problem 4. There were 10 boys and 11 girls who came to a party. It turned out that no 2 girls were acquainted with the same number of boys. Prove that there are 2 boys who were acquainted with a different number of girls. Problem 5. Someone removed 8 edges from a complete graph with 10 vertices. Prove that the graph is still connected.

Session 28: Graph Theory II. Solving Problems with Graphs

During this session, we will introduce several more examples that illustrate how graphs can be used for representing relationships and modeling problems from different domains. The lesson is organized as a collection of problems that demonstrate a wide variety of ways graphs can be applied to problem solving. Teaching supplies for this session: - Printouts of the take-home problem set (one per student).

28.1. Math Warm-up Warm-up 1. I have sorted all the digits into two groups: 1, 2, 3, 5, 7, and 0, 4, 6, 8, 9. What rule did I use? Warm-up 2. Old McDonald has 5 children; half of them are daughters. How can this be? Warm-up 3. In 6 days, 600 hens lay 600 eggs. How many eggs will 300 hens lay in 3 days?

28.2. Discussion of the Day: Graphs Potpourri Today’s lesson is organized as a collection of problems that demonstrate a wide variety of ways graphs can be applied to problem solving.

Directed Graphs Problem 1. Bella is younger than Anna; Daniel is younger than Bella; Anna is older than Cindy; Bella is older than Katie; Cindy is older than Bella; Maria is older than Anna; Cindy is younger than Maria; Anna is older than Cindy. Can you tell who is the youngest and who is the oldest?

221 222 Session 28: Graph Theory III. Solving Problems with Graphs

Problem 1 Discussion. This problem is not pretty: it contains a hairy collection of statements that we need to sort through. However, visualizing this problem as a graph will make it much easier. The vertices of this graph will represent the kids; the edges meanwhile will represent the known relations of being older or younger. However, there is an interesting question here: if an edge connects two people, how would we know which one is older? To solve this challenge, let’s introduce the notion of a directed edge and a directed graph.Adirected edge has an order associated with it. (Usually, the order is indicated by an arrow.) A directed graph is made up of vertices connected by directed edges.

For this problem we definitely need directed edges; let’s assume that an edge arrow points to a younger person. The directed graph will look like this: A K B

D M C The direction of the arrows plays an important role. If a path can be found from X to Y that follows arrows, then X is older than Y . (Such a path is called a directed path.) For example, since we can get from M (Maria) to B (Bella) following arrows (via A), Maria is older than Bella. Now, it is easy to see that Maria is the oldest of the group, because M is connected by a directed path to every other vertex in the graph. We have two candidates for the youngest: Katie (K) and Daniel (D). Can we tell which of the two is younger? No, we cannot: there is no directed path, neither from K to D nor from D to K. This graph also shows us that some of the edges are redundant: the ordering of the children does not change if we remove those. Do you see which edges can be removed without losing any information?

Graphs and Problem 2. In this picture, you can see the floor plan of a house. Can you find a way to represent this floor plan as a graph?

Problem 2 Discussion. Let’s use vertices to represent the rooms. We will treat the outdoors as one big room and assign a vertex to it. Let’s also use 28.2. Graphs Potpourri 223 edges to represent the doors. The result is a graph that corresponds to this floor plan:

Such an approach would work not only for a small house but also for something larger, such as a . The vertices of a graph could represent maze junctions; if there exists a path that leads from one junction to another, then the corresponding vertices would be connected. With such an approach, a problem about a maze can be reformulated in terms of a graph. The good news is that mathematicians and computer scientists have come up with plenty of useful algorithms and problem-solving techniques that work on graphs. For example, to discover a path that connects points A and B in a maze, a computer can use a “find the path between two vertices” algorithm. It works the other way around as well: if we need to generate a maze, we can start by using an appropriate graph generation algorithm to create a graph. Afterwards, we can convert this graph into a maze.

Graphs and Transport Puzzles The next problem, a simplified version of the well-known transport puzzle, illustrates another creative way of reformulating problems through graphs. Problem 3. A soldier must cross a river. Two boys have a small boat and are willing to help. The boat can hold either the two boys or the soldier. How can the soldier get across the river and still leave the boat with the boys? Problem 3 Discussion. First, let’s introduce some notation: the boys are B1 and B2, the soldier is S, the boat is BT. Next, let’s come up with a way to describe the current locations of the boys, the soldier, and the boat. Let’s use two pairs of parenthesis to indicate who is on the left shore and who is on the right. Also, let’s introduce the term “state”, which will be a short way of saying “everyone’s locations”. For example, in the beginning, everyone is on the left bank. This state is described as (B1,B2,BT,S)(). If the soldier on the boat crosses to the other side, the state will be (B1,B2) (BT,S). If two boys cross instead, the state becomes (S)(B1,B2,BT). Now, let’s assume that these states are the vertices of a graph. Two states are connected by an edge if it is possible to get from one to another via one river crossing. In the beginning, the graph will contain a single vertex (B1,B2,BT,S)(). Next, as we keep adding new states and new connections, 224 Session 28: Graph Theory III. Solving Problems with Graphs our graph keeps growing. For example, from the beginning state is it possible to get to these states: both boys and the boat on the other bank, the soldier and the boat on the other bank, a boy and a boat on the other bank. Out of all these new states, only the “both boys and a boat” state has a potential to generate any new states.

(S, B2) (B1, BT) (S) (B1, B2, BT) (B1, B2, BT, S) ()

(B1, B2) ( BT, S) (S, B2) (B1, BT)

Our goal is to keep building the graph until we get to the “game end” vertex: (B1, B2, BT)(S)

How many steps would we need to reach this vertex? We just discussed how a simple transport puzzle could be reformulated through graphs. Now, can you use this approach to reformulate and solve the famous “Crossing a river with a wolf, a goat, and a cabbage” puzzle? (This is the puzzle: “A man has to take a wolf, a goat, and some cabbage across a river. His rowboat has enough room for himself plus either the wolf, the goat, or the cabbage. If he takes the cabbage with him, the wolf will eat the goat. If he takes the wolf across, the goat will eat the cabbage. Only when the man is present are the goat and the cabbage safe from their enemies. All the same, the man successfully carries the wolf, the goat, and the cabbage across the river. How?”1)

Coloring and problems on graphs And, finally, we are going to demonstrate how coloring could be used for solving a graph problem. Problem 4. In a group of 6 knights, every pair of knights are either friends or foes. Prove that it is possible to choose 3 of these knights so that they are either all friends or all foes. Problem 4 Discussion. Suppose we decide to model the problem as a graph with 6 vertices (knights). The edges of this graph could link those knights who are friends, for example. In this case, “no edge” would mean “foes.” However, such a choice would not be the best since the relationship of being a foe would be visually overlooked. Instead, let’s use 2 kinds

1This text of the puzzle comes from The Moscow Puzzles [17]. However, the puzzle itself happens to be one of the earliest known recreational mathematics problems. It occurs in the 9th-century manuscript titled “Problems to sharpen the young”. The manuscript, which contains more than 50 problems, is said to be written by Alcuin, an English scholar, poet, and teacher. 28.2. Graphs Potpourri 225 of edges: solid black lines would be connecting friends, and dashed black lines—foes. (Alternatively, we can use markers of two colors.) This way, we get a complete 6-vertex graph with each edge being either solid or dashed.

friends K2 K3

K1 K4

foes K6 K5

Our goal is to prove that we can find a triangle made up of all solid edges or all dashed edges. Let’s start by choosing 1 knight (K1). He is linked to 5 others; moreover, at least 3 of these links must be of the same type. Let’s concentrate on these 3 identical links. Suppose that these are friendships: Knight 1 is friendly with Knights 2, 4, and 5. K2 K3

K1 K4

K6 K5 In this case, could Knights 2 and 4 be friends? If they are, then the problem is solved: Knights 1, 2, and 4 form a group of 3 friends. Similarly, if Knights 4 and 5 or Knights 2 and 5 are friends, the problem is solved as well. If not, then Knights 2, 4, and 5 must all be foes. In this case, the problem is solved as well: we found 3 knights who are all foes! K2 K3

K1 K4

K6 K5

These examples demonstrate just a few of the many useful applications of graphs, and there is a lot more that can be studied. For Teachers: Graph theory can be studied for its own sake, or for its applications in computer science and other disciplines. Graphs make a great math circle subject, as they can be taught for several years in a row at increasing complexity levels. Unfortunately, I will not be expanding on it anymore in this book. If you are looking for more topics on graphs, check [2]. This book has several excellent chapters on graph theory and plenty of problems. 226 Session 28: Graph Theory III. Solving Problems with Graphs

28.3. Take-Home Problem Set Problem 1. Can you come up with 99 positive integer numbers such that their sum and their product are both equal to 99? Problem 2. (a) Can you draw a graph with vertices of degrees 8, 6, 5, 4, 4, 3, 2, 2? (b) Can you draw a graph with vertices of degrees 7, 7, 6, 5, 4, 2, 2, 1? (c) Can you draw a graph with vertices of degrees 6, 6, 6, 5, 5, 3, 2, 2? For each part, either show how or explain why this is not possible. Problem 3. In a graph, every vertex is either blue or green. Every green vertex is connected by an edge with 9 blue and 6 green vertices, and every blue vertex is connected by an edge with 5 blue and 10 green vertices. Does this graph have more green or more blue vertices? Problem 4. In the network of 101 computers, each is connected with exactly k computers. What are the possible values of k? Problem 5. A ship hold is a rectangular-shaped room. Through the hole in the hull, the water started to leak into the hold. The water pump, which was immediately turned on, was not powerful enough. The water level was rising steadily; it reached the height of 20 cm in 10 minutes. At this moment, the second pump, identical to the first one, was turned on. In 10 minutes, the water level went down to 10 cm. At the same moment, the leak was fixed. How long will it take for the two pumps to pump all the water out? Problem 6. Captain Flint has 60 pirates in his crew. Each pirate dislikes exactly 1 other pirate. Prove that the captain can split the pirates into 3 groups such that within each group no one dislikes anyone else. (“Dislike” is not necessarily symmetrical. If Pirate A dislikes Pirate B, that does not mean that Pirate B dislikes Pirate A.)

Problem 7. On the first day of a chess tournament, each of the 10 participants played 1 game. On the next day, each player played another game, with a different player. Prove that after the second day you can still find 5 players that did not play each other. Problem 8. In Galaxy M31, transportation between planets is carried out by 2 companies: Royal Shuttle Service and Spacehound Shuttles. Every pair of M31 planets is connected by a single shuttle route, served either by Royal or by Spacehound. Prove that a traveler can visit all the planets of Galaxy M31 using the services of only 1 of these companies. (Transfers are allowed.) Session 29: Mathematical Olympiad III

Today is the last Olympiad of the year. In our math circles, an Olympiad is always a greatly anticipated event. Children enjoy the challenge, the excitement of competition, and the prizes that follow.

Teaching supplies for this session: - Printouts of the Olympiad problems (one per student). - Prizes for the contest participants (optional).

For Teachers: This is the final contest of the year. How can we make it memorable for the students? Diplomas and prizes are one way to go. A small after-circle party could be another option.

For Teachers: This is the last lesson of the year. You would prob- ably like to collect feedback about the class from your students and parents. An online survey could be one option, a “pen and paper” survey—another.

29.1. Event of the Day: Mathematical Olympiad This Olympiad is another oral Olympiad. The 10 problems are listed in roughly increasing order of difficulty and are printed in two sets: the first 6 problems in one set, the last 4—in another. Some of the problems in the second set are quite advanced. The 2 additional problems could be used as a safeguard against a bright and fast-thinking student who’d solve everything and stay idle.

227 228 Session 29: Mathematical Olympiad III

At the start of the Olympiad, everybody gets the first set of problems. A student who solves any four of these problems receives the set with the remaining problems.

29.2. Mathematical Olympiad III. First Set of Problems Problem 1. Compose a magic square with the numbers 1, 7, 13, 31, 37, 43, 61, 67, and 73.

Problem 2. Marissa divided the rectangle on the left into 3 identical rectangles and painted them in 3 colors. Next, she cut this rectangle into 4 pieces so that she was able to assemble these pieces into the rectangle on the right. (The rectangles have the same area, but not necessarily the same dimensions.) How did she cut the rectangle?

Problem 3. It would take 6 hours for an old wizard and his apprentice to transform all the frogs in the aquarium into beautiful princesses. (Each of the magicians transforms 1 frog at a time, and each of them works at his own pace.) The wizard and the apprentice worked together for some time. During this time, the wizard transformed 1/3, and the apprentice transformed 1/6 of the frogs. After that, the old wizard fell asleep, and the apprentice had to finish transforming all the remaining frogs. How long did it take for the apprentice to finish the job?

Problem 4. On Monday, the noble knight Sir Lancelot wrote in his diary: “Today, I did more good deeds than 1 day ago, but less than 4 days ago.” On Tuesday, he wrote the same text. The same happened on Wednesday. For how many days at most will it be possible for Sir Lancelot to fill his diary with entries like this? (Remember that noble knights never lie.)

Problem 5. A physicist placed either a negatively charged particle (charge −1) or a positively charged particle (charge +1) at each vertex of a cube. Then he calculated the total charge of all particles around each face of the cube. Could he get a different number for each face?

Problem 6. Last night, 9 mafia bosses came together. In a single question, you can find out the total wealth of any 2 of them. How can you find out the total wealth of all 9 bosses in 6 questions? 29.3. Second Set of Problems 229

29.3. Mathematical Olympiad III. Second Set of Problems Problem 7. An Olympic committee referee has a set of medals consisting of 1 gold, 3 silver, and 5 bronze medals. The referee received an emergency message that 1 of the medals is counterfeited (lighter than the real one). Real medals that are made from the same metal weigh the same. Medals from different metals weight differently; however, we do not know which ones are heavier and which ones are lighter. How can the referee find the counterfeited medal using just 2 tries on a balancing scale with 2 pans?

Problem 8. Each cell of a 7 × 7 square contains a number. The sum of numbers in every 2 × 2 square and in every 3 × 3 square is equal to 0. Prove that the sum of numbers in the 24 perimeter cells of the 7 × 7 square is equal to 0 as well.

Problem 9. Prince Badam seeks the hand of Princess Lilly. Her father, King Dodon, puts him to the test. There are 5 doors in front of the prince, numbered from 1 to 5, left to right. Some of these doors hide tigers, others—ladies. (There is 1 creature behind each door.) The Prince can point to any 3 of these doors, and the King tells the total number of tigers behind these doors. After 3 questions like this, the prince has to guess whether the rightmost door hides a lady or a tiger. If the guess is correct, he marries Lilly. If not—he is fed to the tigers. Help the Prince to find a surefire way to survive.

Problem 10. Mathew took a black marker and wrote down all the dates of the last month like this: 12345678910111213....Thenhetookaredmarker and crossed out those 3 dates when he had quarrels with his sister. (All the quarrels were at least a day apart from one another.) As a result, this string of numbers broke up into several shorter strings of black digits separated by red crosses. It turned out that every black string had the same number of digits. Prove that Mathew quarreled with his sister on the first day of the month.

Problem 11. All the numbers from 1 to 10 were divided into 2 groups in such a way that the product of all the numbers in the first group is divisible by the product of all the numbers in the second. What is the smallest possible quotient of the first and second products?

Problem 12. In “Minesweeper”, some squares of a 10 × 10 board are “covered”. Some of these covered squares contain mines. The computer fills other squares with the number of neighboring squares that have mines. (In the picture, the gray squares are covered.) 230 Session 29: Mathematical Olympiad III

Let’s suppose I erase all the mines and then put new mines on all the squares that previously did not have a mine. Can the sum of all the numbers on the board decrease, increase, stay the same? 1 1 1 2 1

1 1 1 2 2 1 2 1 3 3 Part 2

Mathematical Contests and Competitions

Mathematical Contests

There are several reasons for mathematical contests and tournaments to be so popular. • Mathematical contests are engaging and entertaining. Students love them. • Mathematical contests are educational. Students learn to present their solutions and analyze the solutions of their peers. • Mathematical contests are a team activity—they build up relationships between students. The several tournaments that we use in this book are Mathematical Auction, Mathematical Dominoes, Mathematical Race, Mathematical Snake Pit, and Mathematical Olympiad. They all have been time-tested and kids- tested, and they work well in a middle-school circle. Their rules follow.

233

Mathematical Auction

We will start with the discussion of the nature of the game and will follow by presenting the detailed rules.

What Is Special about Mathematical Auctions? • Mathematical Auction is one of the most engaging math contests (espe- cially for novice math circle students) with rules that are easy to grasp. An element of excitement is added to the game by the facts that the problems are auctioned and re-auctioned and that play money changes hands. • Mathematical Auction problems are not traditional math problems that can be either solved or not solved. Rather, they are open-ended problems with intermediate solutions that can be further improved. The intermediate solutions are easy to find; therefore, the students are always able to find a solution to an auction problem. • Mathematical Auction problems are constructive. They don’t require a proof and their answers are easily verifiable. Therefore, a Mathematical Auction can be organized even in a brand new circle—a circle where students do not have too much experience with math reasoning and are not yet familiar with the idea of mathematical proofs. • The structure of a Mathematical Auction stimulates students to keep solving problems even during the stage when the solutions are already being presented. Because a good auction problem has several inter- mediate solutions, a team could improve its solution by combining its original idea with the idea that was presented by another team. After coming up with an improved solution, the team can place a new bid on thesameproblem.

Rules of Mathematical Auction Two or more teams can compete in a mathematical auction. For now, we will assume that only two teams (Team A and Team B ) are participating in the game because it will be easier to explain the rules this way.

235 236 Mathematical Auction

At the start of the game, both teams receive the same list of problems. The teams are allocated a certain amount of time to work on these problems. After this time is over, the teams get together and the auction begins. Both teams start the game with the same amount of money in some fictional currency. Every problem on the list has a price (expressed in this currency). For example, each team may get an initial capital of 200 shmollars, and each problem may have a value of 100 shmollars (shmollars are the currency used in our circle). One by one, the problems are put up for auction by a teacher. The teams place bids for the right to present a solution to the auctioned problem. The team that placed the highest bid for a problem presents its solution in front of the class. If the solution is correct, the team has a chance to receive the money—the price of this problem. If the team actually gets this money, then it will earn a profit: the difference between the price of the problem and the bid money. There is a special zest in the Mathematical Auction game. At a regular auction, once you place the winning bid, the item is unconditionally yours. However, Mathematical Auctions are different. A team that competes in a mathematical auction could lose its bid money even if it presents the correct solution to a problem. How can this happen? The Mathematical Auction problems are unusual. The trick is that every Mathematical Auction problem has intermediate solutions that can be improved upon. Therefore, it can happen that another team believes that it has a stronger solution than the one that was just presented. If this is the case, the problem is put up for auctioning again. The next buyer attempts to present a better solution. A problem is put up for auction again and again until the teams run out of solutions. Finally, the team that came up with the best answer collects the money (the price of the problem). This team gains the difference between the problem price and the money it spent bidding for this problem. The rest of the teams lose the bids they paid for the presentation rights. (For an example of how the system of bids and prices works, check the section “A Sample Round” in this chapter.) This option of reselling a problem adds to the game a strategic element that the students enjoy. Also, it helps to keep the children actively involved in problem solving throughout the game. The students are encouraged by the ideas of other teams and by the mutual desire to win. It happens quite often in a Mathematical Auction that a team creates a better answer “on the fly”, sometimes even buying the same problem a few times in a row as the team members generate better solutions.

After all the problems have been auctioned off, the teacher counts the teams’ riches. The team with the most money wins the game. A Sample Round 237

The criteria of an improved solution An important question concerns how to judge the “strength” of a solution. The answer is: every Mathematical Auction problem has its own set of criteria. For each problem, the description of what constitutes a better solution should be clearly stated in the problem. You can find several examples of auction problems coupled with the descriptions of the criteria of stronger solutions at the end of this chapter.

How to resell a problem Let’s focus on the re-auctioning part of the game. After a team presents its answer to a problem, the teacher inquires whether some other team would like to present a better solution. If this is the case, the problem is put on auction again. All teams, including the one that just presented, can participate in the next round of bidding. The bidding price of the problem starts back at the lowest value (5 shmollars). The team that placed the highest bid buys an attempt to present its version of the solution.

Money matters All teams start the game with the same amount of money. It is recommended to set the amount equal to approximately half of the total price of all the problems. (If the teams have too much money, they get involved in reckless trading. If they have too little, they run out of money and can no longer participate in the bidding.) Since it is not profitable for a team to place a bid that is higher than the price of a problem, the problem price serves as a natural upper bound for a bid. In our circles, we price the problems in the hundreds range and set the minimum bid increment to 5 shmollars.

A Sample Round This section contains an example of an imaginary fight between two teams (Team A and Team B) around a single (simplified) Mathematical Auction problem:

Problem 1. Using 5 digits 1, represent as many consecutive natural numbers as possible (starting at 1). You can use 4 arithmetic operations (+, −, ×, ÷) and parentheses. The same operation can be used several times, and it is not required to use all 4 operations.

(Problem value: 100 shmollars.) A team has a stronger solution for this problem if it can continue the list starting with the number that the previous team failed to represent. 238 Mathematical Auction

Let’s suppose that during the problem-solving stage Team A came up with the representations of the numbers 1, 2, and 4: 1=1− 1+1− 1+1, 2=1/1+1/1 ∗ 1, 4=(1+1)∗ 1+1+1. Team B came up with the representations of the numbers 1, 2, and 3: 1=(11− 11) + 1, 2=(1∗ 1+1/1) ∗ 1, 3=1+1+1+1− 1. During the first round of auctioning, after Team B placed the winning bid of 45 shmollars, it demonstrates its solutions for the numbers 1, 2, and 3. However, Team A has a stronger solution: it has a representation of 4. Therefore, Team A requests another round of auctioning. In this second round, Team A pays 25 shmollars for the right to present a better solution. (The price is so high because Team B bluffed—they pretended that they had a better solution as well.) Team A presents its solution for 4. Now, Team A is pretty confident that they will get the money. (If they did, their profit would be 100 − 25 = 75 shmollars.) However, while listening to the solution of Team A, Team B comes up with the idea of how to represent the number 5: 5=1+1+1+1+1. Therefore, Team B requests a third round of auctioning. It pays 5 shmollars and presents its solution for 5. Because neither Team A nor Team B has figured out how to represent 6, the trading for this problem is over. In the end, Team B is awarded the money for this problem (100 shmol- lars). Team B’s profit is 100 − 45 − 5=50shmollars. Team A’s loss is 25 shmollars.

Team Work Mathematical Auction can be played both as a team game and as an indi- vidual contest. In our math circles, we usually play it as a two-team game. There are several important aspects related to the team game. • Each team should have a captain. The function of the captain is to do the bidding during the contest. (The team discusses the bidding strategy together; however, the captain is the one who actually places the bids and decides which member of the team presents the solution.) • Different problems should be presented by different team members. This rule can be broken only if a team size is too small or if the problem is being re-auctioned. • The number of teams is determined by a number of students playing. The optimal size of an auction team is between 4 and 8 students. If there are too many students in the circle, an auction can be played between three teams, and even between four teams. Examples of Mathematical Auction Problems 239

Advice for a Teacher • Think in advance about all the extra supplies you should take to the class to make your auction run smoothly. Quite often, auction problems are easier for students to work on if they have quad-lined paper (chessboard problems, cut-the-shapes problems, etc.). Therefore, it is a good idea to bring some grid paper on the days of the contests. Also, if you are short of whiteboard space, bring in a large sheet of paper and sticky tape. You can tape the paper to the wall and use it to track the teams’ progress. • Make sure that you read all the problems aloud and that your students actually listen. Moreover, encourage them to ask questions during the problem-solving stage. A solution to a misinterpreted problem does not bring any points to a team. • Time is a precious commodity during contests; you can save some time by preparing the board while students are working on the problems. Oftentimes, students are slow at drawing. Therefore, you can pre- draw some pictures that are required to demonstrate the solutions— chessboards, grids, circles, etc. • In a little-used spot of the board, draw a table with rows for problem numbers and columns for team names. You will track the teams’ progress in this table: track the bids using negative numbers, and wins—using positives. • During an auction, you perform the duties of a judge. Therefore, you will inevitably have to make certain “gray area” decisions. Try to be lenient, but consistent. A typical “gray area” situation at an auction is caused by a student who tries to improve/correct the solution on the spot while presenting. How much time should he be allowed for such an attempt? Your goal as an auctioneer and referee is to keep a balance between being nice to the presenter and being fair to the other teams. For example, you can decide to follow the “2 minutes for rethinking” rule.

Examples of Mathematical Auction Problems Problem 1. Cut a circle with seven straight lines in such a way as to get as many triangles as possible. A triangle can’t have curved sides and also cannot be constructed from several smaller shapes. For this problem, a better (stronger) solution has more triangles than the solution that was presented by the previous team.

Problem 2. Find as many solutions as possible to the following alphanu- meric puzzle: BACK + BOA = SCAM. (The same letters stand for the same digits, different letters—for different digits.) 240 Mathematical Auction

For this problem, a team that has a better solution should present at least one answer to the puzzle that was not presented by the previous teams. Problem 3. Using the digits 1, 2, 3, 4, 5, 6, represent as many consecutive natural numbers as possible (starting from 1). You can use four arithmetic operations (+, −, ×, ÷) and parentheses. The same operation can be used several times, and it is not required to use all four operations. Do not modify the order of the numbers. A team has a stronger solution for this problem if it can continue the list starting with the number that the previous team failed to represent. For more examples of Mathematical Action problems, see [2]. Mathematical Dominoes

Mathematical Dominoes, one of the recent additions to our tournament collection, quickly became a favorite with our students.1 - Its rules and format are as interesting and exciting for a 3rd grader as for a 9th grader. - It engages every student in active problem solving. It allows all students to work at their pace and their level. - It can be played for as long as needed and can be stopped at any moment. - It requires very few helpers.

Rules of Mathematical Dominoes Mathematical Dominoes is a small-team (or individual) contest in problem solving. (The best team size is 2 players.) The problems are written on back sides of two-sided cards. The front side of each card looks like a dominoes tile: it has a pair of numbers (dominoes points) on it. Draw a polygon The The “problem” with 10 vertices “points” side of a that can be split side of a domino into 5 triangles with domino card 5 : 3 one straight cut. card

At the start of the game, cards are placed on a judge’s table dominoes- side up. (This way, the problems are hidden from the students.) The teams start working on the problems at their own pace, selecting cards one by one from the pool of cards on the table. (The pair of domino points serves as a predictor of the level of difficulty of a problem.) A team earns (or loses) points depending on whether it was able to solve the selected problem. The system works as follows: • The team has up to 2 tries to present an answer to a problem. (For dominoes problems, only answers matter, not the solutions.)

1We discovered the game on the website of the Kirov Summer Math School [20].

241 242 Mathematical Dominoes

• If a team presents the correct answer on the first try, the team is awarded the full score for the problem. The full score is equal to the sum of the two numbers on the domino side of the card. For example, if the card shows [ 5:3 ] then the team gets 5+3=8points. • If a team solves the problem on the second try, it is awarded a partial score, which is equal to the larger of the two domino numbers. For example, for the [ 5:3 ] card, the team gets 5 points. • If this second answer is also incorrect, the team loses points. The penalty for an incorrect answer is equal to the smaller of the two domino numbers. For example, a team receives a 3-points fine if it fails to solve a [ 5:3 ] problem. • The [ 0:0 ] card is special. A team can present the answer for this card just once. The correct solution brings 10 points, while an incorrect answer is not penalized. (Sometimes, when we deem the [ 0:0 ] problem to be very challenging, we raise its value to 15 points.)

After the team finishes a problem, it returns the card to the pool and chooses the next problem to work on. The game stops at a prearranged time. The team that collects the most points wins the game.

Why Students Like Mathematical Dominoes The game combines strategy, the presence of an unknown element, and the thrill of solving fun math problems. Where do risks and strategy come from? In fact, “dominoes values” serve as the predictor of the level of difficulty of aproblem. Let’s compare, for example, the [ 2:1 ] and [ 6:4 ] cards. While the maximum reward for the problem on the first card is 3 points, for the second card it is 10 points. Therefore, the first problem should be much easier than the second one. What about two cards with the same total? Should we expect the problems to be equally challenging? Let’s look at the [ 7:1 ] and [ 4:4 ] cards. Each of these problems, if solved on the first try, would bring 8 points. However, on the second try, the first problem is worth 7 points, and the second one—just 4. Moreover, the penalty is much higher for the second card, 4 points versus 1 point. If the maximum profit is the same and the punishment is much higher, why would a student select the second card? You see, the problems are matched to the cards in such a way that a [ 7:1 ] problem carries more risk and challenge than a [ 4:4 ] problem. The students know this, and they love estimating how much risk they are ready to take. Therefore, it is possible for a team to choose its strategy according to the team’s standing and the level of players. There are a lot of ways to accumulate points: to concentrate on difficult, high-risk problems or to bet on solving a bunch of easier ones. Useful Details 243

Another important factor is that Dominoes problems are interesting, challenging, and intriguing. Besides, Dominoes problems require only an answer, no explanations. This makes a welcoming reprieve from our regular math circles routine.

Why Teachers Like Mathematical Dominoes First, all the children in the classroom are engaged in active problem solving from the start of the contest until the end. Why is this so? The children work in small groups. Therefore, if the group is composed of students of similar strength, everyone becomes an important member of the team, no one stays idle, the children learn from each other, and shared work helps to stay focused and motivated. Another attractive point of the game is that it can be played in a classroom with students of diverse math abilities. Since a Mathematical Dominoes set contains problems of different levels of difficulty, the students can choose the level of difficulty that works for them. Next, the length of a game can vary: the same set of problems would work both for a 30-minute game and for a 2-hour tournament. Finally, Mathematical Dominoes is easy to run. Extra helpers are usually needed to monitor the game. However, these helpers do not have to be familiar with the problems: each Dominoes set comes with a list of answers that can be used to check the students’ work.

Useful Details – Mathematical Dominoes can be played as an individual or a team game. We recommend playing it with 2-student teams. (It’s fine to have an occasional team of 3 or 1.) – A team should be formed with students of similar abilities. (In an unbalanced team, the faster kid will take the lead in problem solving.) – Before a game, each team gets a scorecard (described below) for keeping track of its progress. During the game, all answers should be entered onto this card. If an answer to a problem requires a lot of space (a drawing, for example), the team presents it on a separate piece of paper. After the game, the scorecard is used to calculate the team’s total. – A team cannot drop a problem that it is working on without a penalty. The penalty is the smallest of the two dominoes points. – Depending on the goal of a game (a strict competition or a fun edu- cational tournament), the teacher may choose to provide limited help to a team that is stuck on a difficult problem. (Walk around the room. If you see that a team is struggling, stop by its table, and steer them in the right direction.) 244 Mathematical Dominoes

Scorecards At the start of a game, each team receives a blank scorecard to be used for tracking the progress of the team. The scorecard has an entry for the team name and a blank table with five columns: Team name: Problem Dominoes Answer, Answer, Points Number Points First Try Second Try Earned

Whenever a team chooses a new problem, it fills the problem number into the first column, and its domino points—into the second one. The team uses the next two columns for answers (first attempt, second attempt). The “Points Earned” column is filled by the judge after he or she checks the answer.

Dominoes Cards: How to Make Them To make two-sided cards with problems on one side and with domino points on the other, we came up with an easy trick: we type the problems into a table, one row per problem. The table has two major columns: the first one is for problems, and the second one is for their scores. (The narrow columns are for problem numbers.)

Draw a polygon with 10 vertices 7 that can be split into 5 triangles 7 with one straight cut. 5:3

Fold line

We print pages with problems single-sided and mountain-fold them. Then, we cut out the problems row by row along the lines that separate them. This way, we get two-sided cards.

Odds and Ends Mathematical Dominoes problem sets can come in different sizes. The small- est set that we ever played (28 problems) used up all dominoes tiles from a traditional 6-dots dominoes set. Usually, our sets are bigger—whenever we design a game, we cannot stop: there are too many cool problems around. If we have more than 28 problems in a set, we can easily go above the “6 dots” limit. For example, if we add 2 extra problems, we may assign them values of [ 7:0 ] and [ 7:5 ] according to their difficulty. Odds and Ends 245

A Mathematical Dominoes game is not easy to design: not only does one have to come up with a set of problems, but these problems should also be matched with the appropriate dominoes scores. However, this effort pays off. A good Dominoes set can be used over and over again in a variety of classrooms, with different kids. We play Mathematical Dominoes with students of all ages, from grade 3 up to grade 10, and they all enjoy this game. Check the Prime Factor website—we have several Mathematical Dominoes sets there that we are happy to share.

Mathematical Snake Pit

Rules of Snake Pit Game Mathematical Snake Pit is a fast-paced problem-solving game with simple rules and can be played in small teams or individually. At the start of the game, all teams receive the same set of problems. The problems are grouped into several “snakes”, which are collections of problems combined by a topic. Problem solving. The teams start working on the problems, presenting answers as they go. A team has only one attempt to answer each problem. If the answer is correct, the team gets the full score for the problem. If the answer is incorrect, the team gets 0 points. The winner of the game is the team that scores the most points. Points: For every snake, the first problem costs 1 point, the second—2 points, the third—3 points, and so on. Also, a team can get bonus points. There are two types of bonuses: - Horizontal bonus: all problems in a snake are solved (extra 5 points). - Vertical bonus: all problems with the same number are solved. In this case, the award is equal to the value of the problem. (For example, if a team solves all number 3 problems, it gets 3 extra points.)

Useful Details Mathematical Snake Pit is a game that is perfect for practicing specific sets of problem-solving skills. Combinatorics makes a great example. In a combinatorics Snake, stu- dents can practice permutations, combinations, complements, etc., with each “snake” being devoted to a certain type of problems. Usually, we play Mathematical Snake Pit in small teams (2 students). In such a team, both students are able to help each other and stay engaged. The duration of the game is defined by the set of problems being used— both the difficulty and the number of problems play a role.

247 248 Mathematical Snake Pit

For Teachers: Depending on the goal of the game, you may tweak the rules a bit. For example, if the goal is to make sure that students master a certain set of skills, you may decide to give them occasional hints. (A half-point could be awarded for a problem solved with a hint, and such a problem may not be eligible for the bonus.)

Score Table To play the game, you need: - The printouts of the problems sets. - Answer keys (one for every instructor). - Score tables (one per team). During the game, teams enter their answers into an answer table. Below is a sample table for a Snake Pit game with 2 sets of problems (2 snakes) with 3 problems in each. Problem 1 Problem 2 Problem 3 Row bonus Total Snake 1 0 2 3 5 Snake 2 1 2 3 5 11 Column Bonus 2 3 The team scores 5+11+2+3=21points. Mathematical Race

Rules of Mathematical Race Mathematical Race is an individual or small-team game with a simple set of rules. Problem solving. During the competition, each team solves its way through the same set of problems. The teams start working on the problems, presenting solutions as they go. The only restriction is that a team works on 4 problems at a time. Thus, at the start of the game, a team receives the first 4 problems. Whenever a team presents the correct solution to a problem it currently owns, it receives the next one from the list. For example, suppose that a team currently has problems 1, 2, 3, and 4. If it presents a correct solution to problem 3, the team receives problem 5 in return. Next, if it presents problem 1, the team receives problem 6. A team has up to 3 attempts per problem; successful and failed attempts are marked at the score table. Points. A team’s final standing depends on the total number of problems solved, as well as on the longest stretch of correct answers. Therefore, children are motivated to progress through the list, trying to skip as few problems as possible. For every problem solved, the team receives 3 points. Also, for the longest stretch of correct answers, the team receives 1 extra point per answer.

Useful Details Mathematical Race is another game that is perfect for practicing specific problem-solving skills. Usually, we play in small teams (2–4 students). In a team of this size, every emmber has a chance to contribute and stay engaged.

Score Table During the game, teams keep track of their standing using a score table. Such a table is very easy to make: it has a row for problem numbers and

249 250 Mathematical Race another row for marking solved problems:

Problem 1 Problem 2 Problem 3 ... Total Score

To add more zest to the game, it is possible to draw a big table on the board that would reflect each team’s standing:

Problem 1 Problem 2 Problem 3 ... Total Team 1   Team2   ... Mathematical Olympiad

Olympiads are individual math contests. While it is not a good idea to run all circle sessions as contests, holding an occasional Olympiad has a lot of benefits. Some of them are: - All of the class time is devoted to intense problem solving. Unsurpris- ingly, the students concentrate and work much more efficiently in a contest setting than in a regular session. - Children usually love to compete and enjoy receiving awards. Thus, Olympiads provide both the entertainment and the motivation to study. - An Olympiad is a great tool for a teacher to learn about the strengths and weaknesses of individual students and to assess the overall performance of the circle.

Types of Olympiads An Olympiad can be organized in several different ways. First of all, an Olympiad could be oral or written. A written Olympiad could be classified as short-answer (or multiple-choice) or long-answer ones. Every type has its advantages and disadvantages: • For a multiple-choice (or short-answer) Olympiad, the teacher has a difficult task. She needs to come up with problems that are in line with math circle ideas and at the same time can be formulated as multiple- choice questions. The positive side of such an Olympiad is that it is not difficult to run and the answers to multiple-choice problems are easy to check. Therefore, the students’ work can be graded on the spot, and the winners can be announced right after the contest. • A long-answer (write-down-a-complete-solution) Olympiad emphasizes the solution, not the answer. Therefore, it allows for a much more interesting selection of problems. A disadvantage of such an Olympiad is that it can be challenging for young students to write down their ideas in an organized fashion. Moreover, it is not easy for the teacher to read through these solutions and grade them. • An oral Olympiad allows for a lot of teacher-student interaction. Fur- thermore, it is an excellent opportunity for the students to practice their math reasoning skills. Another advantage of an oral competition

251 252 Mathematical Olympiad

is that the results of such a contest are available right away. However, oral Olympiads have drawbacks of their own. Since the students need to present their solutions orally, extra judges are needed to staff the event. These judges should be competent enough to judge the correctness of the solutions and to point out to the students the mistakes in their reasoning. In our math circles, we prefer to have oral Olympiads. Usually, we ask our qualified friends, parents, and older students for help in judging. Somehow, we are always able to find enough volunteers for a once-in-a-semester event. If we do not completely trust the qualifications of a volunteer, we designate him or her to be in charge of the first few easier problems.

Olympiad Problems A well-prepared set of problems is the key to a successful Olympiad. An Olympiad should be challenging to all of the students, and at the same time, everybody should finish the competition with a sense of accomplishment. Listed below are several tips that could help you reach this goal: • Include a combination of problems of different levels of difficulty: a few difficult problems for the stronger students and several easy and interesting ones for the less-prepared and the newcomers. A reasonable guideline for a 10-problem set would be to have 5 problems that are likely to be solved by everybody in the circle, 4 challenging ones, and 1 difficult problem. • Include a few problems that use the techniques recently learned in the circle. These problems will serve a double purpose: to refresh a recent topic and to reward those who studied hard during the year. At the same time, add some problems that require nothing but logic and creativity to come up with the solution. • Include only problems that have relatively short solutions. This is important both for oral and written Olympiads. Otherwise, you, the teacher, will be overwhelmed with the students’ presentations during the contest or with reading long manuscripts after the competition. • Make sure that the statements of the problems are interesting and easy to understand. If a problem is boring or too long, it is better to reformulate it or select a different problem. • Place the problems in the order of increasing difficulty. This way, it is easier for the students to prioritize while working their way through the set. • We usually split the oral Olympiad problems into two sets and print them out on separate pages. Overall, the problems in the first set are less difficult than the ones in the second set. At the start of an Olympiad, the students are handed the first set of problems. Those who solve a certain number of problems from the first set are given the second set. This approach is beneficial because at any moment the Running an Olympiad 253

students have a smaller set of problems to concentrate on. Besides, they don’t pursue more difficult problems prior to solving a few of the easier ones.

Planning for an Oral Olympiad This section is devoted to the specifics of planning for an oral Olympiad. • It is essential to invite enough judges to handle the flow of students presenting their solutions. It is not easy to come up with the precise number of helpers one would need. However, I can share my own experience of running the Olympiads included in this book. For each of these competitions, one helper and I were able to successfully run the contest in a math circle of ten students. The duration of the contest was one hour and a half. • It is important to devise an efficient way of keeping track of the problems solved by the students. As a high-tech solution, you can use a computer. If you prefer a low-tech approach, you can log the solved problems on paper. (A simple table with the students’ names and problem titles works great for this purpose.) • It is always a good idea to familiarize the judges with the problems and discuss the expected solutions in advance, before the start of the Olympiad. First, since the judges might be unfamiliar with your cur- riculum and your requirements, their idea of a correct solution can be different from yours. Second, creating unified standards helps to ensure fairness and consistency. • For the time of the contest, each judge should be assigned a reasonably undisturbed spot where he will conduct his discussions with the stu- dents. A desk in the classroom or a pair of chairs in the hallway works well for this purpose.

Running an Olympiad Start the Olympiad by reminding the students about the rules and the timeframe of the contest. It is better to run this reminder before the students receive the problems; otherwise, they will be too busy with problem solving to pay attention to your words.

Rules and Reminders: • The problems can be solved in any order. Depending on the type of the Olympiad, solutions should either be written down or presented to the teachers. • Students should work on the problems on their own: no talking is allowed. (Such a reminder is needed since the math circle environment encourages cooperation and group work.) 254 Mathematical Olympiad

• For a written Olympiad, it is very important to remind the students that they need to show and explain all the steps of the solutions. Also, a call for neat handwriting will go a long way toward making the future grading easier. • Remind the students that it is fine to ask questions about the problems. • If the Olympiad is oral, explain how the process of presenting the solutions is organized. • (In our math circles, we do it as follows: a student who is ready to present adds his or her name to the waiting list on the board. The teacher and the other judges pick the students according to this list. For every problem, a student has up to three attempts to answer it. The judge records both successful and unsuccessful attempts to present a solution.) • For an oral Olympiad, advise the children not to accumulate solved problems. If the contest is already ending and a student is just adding his name to the list, he might end up losing the chance to present the solutions. • During the contest, keep reminding students about how much time is left to the end of the competition. (A half hour, fifteen minutes, and five minutes are the reasonable milestones.)

Olympiads in This Book All three Olympiads included in this book are planned as an hour-and-a-half or two-hour oral contests. The same sets of problems can be used for written Olympiads as well. However, a written Olympiad should have fewer problems, and it is better to exclude the problems where the first version of the solution has a high chance of being incorrect.

Awards and Prizes If an Olympiad is oral or multiple-choice, then the results of the contest are available right away. For a written Olympiad, the problems should be graded. It is a good idea to conclude an Olympiad with awards and prizes. There are a lot of different ways to set up an awards system. It all depends on the size of a circle, the age of the children, the level of parental involvement, etc. You can go with nicely printed diplomas, candy bars and chocolate coins (an easy way to make the students happy), small gift items (pens and pencils, math puzzles, etc.), or with more substantial prizes. Short Entertaining Math Games

This chapter contains short math games that you can play with your stu- dents. These games are perfect for these last 10 minutes of the session, as a reward for students for all the hard work they did.

Giotto and Math Giotto Giotto is a simple logics-oriented game that combines elements of mathe- matics and language arts.1 The game is played by a teacher against the students. The teacher picks a secret word (the word should be in the dictionary, not a proper noun; all letters of the word should be different). The game can be played with either a 4-letter word or a 5-letter word. (The 4-letter-word Giotto take less time to play.) The object of the game is to correctly guess the secret word. The players are coming up with the guesses; for every guess, the teacher reports the number of Jots, which is the number of letters that are in both the guessed and the secret words. The positions of the letters do not matter: for example, if the secret word is CORD and a player guessed ROCK, then the number of Jots is 3. In a math circle, the Giotto game can be played as a team game or as an individual game. For a team game, the students should be divided into two or more teams; the teams take turns coming up with the guesses. The team that guesses the secret word wins the game. For the individual game, each student plays for herself. The teacher keeps track of the game progress: she records every guess at the board and writes the number of jots next to the guessed word. Math Giotto uses 5-digit numbers (all digits are different) instead of words. Usually, regular Giotto is more exciting for children than Math Giotto.

1The book Camp Logic by Mark Saul and S. Zelbo [15] includes an entertaining and educational lesson that analyses the mathematics of the game.

255 256 Short Entertaining Math Games

Nim Nim is a 2-player game of strategy with very simple rules. The game board consists of 3 heaps of stones. The players take turns removing stones from the heaps: on each turn, a player takes any number of stones from a single heap. (A player has to take at least 1 stone.) A player who takes the last stone wins the game. While the rules are very simple, the game itself is very entertaining. The children play on the board or a piece of paper. Three heaps of stones can be represented as 3 rows of dots (or other marks). The players claim the stones by crossing the dots out. The size of the heaps can be chosen at random. However, it is better to stick to the numbers that are no more than 10. For example, the heaps of the sizes 3, 5, and 7 provide enough complexity and challenge for several players in a row to play the game not even getting close to the idea of a winning strategy for this initial position. Nim can be played as an individual game, or as a team game. Individual games can be organized as a circle championship, for example. One possible way to play the team game would be to organize it Math-Hockey style: to split children into two teams and to invite deputies from both teams to play against each other.

Black Box The game leader (a teacher) comes up with some rule for the “black box” machine. The machine works as follows: it takes certain data as an input, processes this data according to the rule, and comes up with some output. The goal of the game is to figure out what the black box rule is. The players take turns at suggesting the input values for the black box. For every input, the game leader responds with the value of the output. If a player believes that he discovered the secret rule, he requests a test. The leader offers several input values; the player comes back with the outputs according to his rule. If the player’s guess turns out to be right, the player tells the others the rule. Otherwise, the leader tells the correct output, and the game goes on. (It is possible to wait until several players pass the test before uncovering the rule.) A black box input data can be either numbers or words. The rules are usually created in such a way as to generate numbers as outputs. The game leader lets the students know what type of input is accepted by the black box: integers, real numbers, words, etc. If a player suggests some specific number that cannot be used with the rule, the teacher should reply with some predefined phrase. (For example, x =0cannot be used with the rule 1/x. The predefined phrase can be “Cannot be used with this number.”) Black Box 257

Black Box can be played as an individual game or as a small-team game. The teacher keeps track of the game progress: she writes all the input and output data on the board. The game can be played with students of all levels—from 1st graders and up. The black box rules for the more advanced students should be more complex. Several examples of black box rules are: - Any math function: twice the number, a number plus 4, the square of the number. - The remainder of the division by some integer number. - The number rounded to the nearest multiple of 10 or to the nearest multiple of 3. - The sum of the digits of a number. - The number of letters in the input word. - The number itself plus the number of the current turn. - The last digit of the previous number.

Part 3

More Teaching Advice

How to Be a Great Math Circle Teacher

What is so special about a mathematical circle? While it is hard to provide an exhaustive answer to this question, it is much easier to describe several important characteristics of a circle. The three essential components of a vibrant mathematical circle are enthusiastic students, great teachers, and a challenging curriculum. Teaching a mathematical circle is both very rewarding and very chal- lenging, and the path to becoming a great teacher is long and winding. This chapter contains bits and pieces of teaching wisdom that will hopefully help the reader in the exciting endeavor of running a circle. (Since a lot of great people have meditated on the same ideas before this book, I will be citing their advice along with my own teaching tips.)

Teaching Style • An open-ended and interactive teaching style is the key to math circle learning. I would like to start with a piece of advice that comes from Tom Davis, a coordinator of several math circles in the San Francisco Bay area. “Try not to lecture. Even though introducing new theory and techniques is an integral part of math circles, your sessions should be as interactive as possible. Score yourself: 1 point per minute you talk; 5 points per minute a student talks; 10 points per minute you argue with a student; 50 points per minute the students argue among themselves.” • I will continue with a quote from Rick Garlikov, a philosopher and an educator. He says that the teacher’s questions “should be used to arouse curiosity, and at the same time serve as a logical, incremental, step-wise guide that enables students to figure out about a complex topic or issue with their own thinking and insights.” • Be a creative teacher. Mathematical circle questions and problems are not always easy to answer. “If the kids cannot answer your question immediately, don’t just tell them the answer; let them think. If they’re still stuck, give hints, not solutions” (Tom Davis).

261 262 How to Be a Great Math Circle Teacher

• Remember that the ultimate goal is to teach the students how to reason about math correctly. Tom Davis: “Be encouraging, even about wrong answers. Find something positive in any attempt, but don’t be satisfied until there is a rigorous solution. Wrap up each problem by reviewing the key steps and techniques used.” • Always use problems to reinforce new concepts and ideas. Most of the learning in a math circle comes from problem solving. Therefore, every lesson should be accompanied by a challenging and captivating problem set. This problem set should be balanced and optimized in several ways: – Difficulty. You may have students of different abilities and prepa- ration levels. Still, everyone in your group who is ready to put the effort and energy into his work should be able to progress. How does this work? About half of the problems should be interesting and creative, but not too difficult to solve. At the same time, a couple of problems should be challenging even for advanced students. – Topic choice. Include a variety of problems in every set to prevent it from becoming boring. Several problems should be related to new material, some should review a previous topic, and others should require nothing but brain power and common sense. It is always a good idea if problems come in series—sets of problems of gradually increasing difficulty that illustrate or review a topic or problem-solving approach. – Size. Problem sets should be of reasonable length—otherwise, they stop being exciting and fun. • Remember that you are ahead of your students in abstract thinking and analytical reasoning. Certain concepts and principles that seem easy to you still need to be learned by them. – Before you assign a problem, ask yourself how many new or com- plicated ideas are required for the solution. If the answer is “more than one”, then this is at least one too many. Either postpone this problem until next time, precede it by a couple of one-step problems that explore these new ideas separately, or add it to the end of the list to challenge your strongest students. – Follow the same approach when you introduce a new topic or explain a problem. Make sure that you present the material in incremental steps that are easy to follow; do not skip steps just because something is easy for you and for the brightest pupil in class. The main idea is to teach more than most of your circle students can easily digest—yet, to teach it in steps. Overall, your students have a great learning potential. The teacher’s art is to choose the right topics, the right presentation style, and the right pace. Your Target Group 263

• A problem is a powerful teaching tool. Make sure that a key problem (the one that illustrates an important theoretical principle or problem- solving technique) shows up in different reincarnations in several prob- lem sets. This way, the children will not be bored—instead, they will be happy to recognize the same underlying principle in a different guise. • Give the children a chance to present and explain solutions, both in front of the peers and in one-on-one conversations with a teacher. • Try to avoid working on the same topic for too many classes in a row. It is always better to switch to different material and get back to the original topic later. • Have a lot of math entertainment. Kids are always kids—they like to play. Scheduling a once-a-month math entertainment session works great for boosting their motivation. • Always have some backup plan on how to spend the first or the last 10 minutes of classroom time. Short math-related games (Giotto, Nim, Black Box, etc.) work great for this purpose. • And, last but not least, motivate your students! Keep reminding them that knowledge, problem-solving abilities, and analytical skills fostered in math circles will help them greatly through their life, regardless of the career that they will choose.

Your Target Group The dream of every circle leader is to have a class that is composed entirely of capable and enthusiastic students. However, reality steps in—you may end up with a group of kids of mixed abilities and aspirations. Thus, you need to make a decision on how to teach this group. Should the lessons be designed for a couple of the brightest students, for the top half of the class, or for the rest of the group? While every teacher decides this for herself, here are a few pointers.

• When you first assemble your math circle, you can expect all kinds of kids to join. Some will not be interested and will leave the circle. Some had never experienced anything like what you are going to teach and may appear to be slow starters. These kids may catch up quickly or with time. To the contrary, some children have been exposed to logical puzzles and simple word problems by their parents and may do very well in the beginning. Only time will tell who will succeed in the long run. • Therefore, when everyone is new, it makes sense to teach in such a way that no one is left behind, taking time to make sure that every child understands the topic. This approach often pays off when such a child gets excited about math and turns out to be one of the best performers. 264 How to Be a Great Math Circle Teacher

• The situation starts to change during the second year. The kids have grown up. They have been exposed to math, they have seen and felt what a math circle can offer, and by this time they probably know whether they like it or not. Moreover, as the circle progresses, the material becomes more complicated, both theoretically and technically. Therefore, those who do not put the energy and effort into practicing and problem solving start lagging behind. • So, what is your target audience in a second-year circle? A couple of the brightest students, the top half of the class, or the rest of the group? It definitely cannot be just a few of the strongest kids—you don’t want to end up with a circle of two or three. On the other hand, experience shows that children who attend only out of inertia will not be getting much out of your teaching anyway, no matter how much time is spent on them. It is a trait of a good teacher to see where the boundaries lie. The only advice I can give is to look primarily at the child’s interest in the subject. Teaching those who are interested and motivated makes the most sense in the long run since these are the students who will benefit the most from being in a circle. What Comes Next?

This book covers a lot of ground, but you may still have questions left. In this section, I would like to list resources and give tips on where to get additional materials for your classes. Also, I would like to discuss how to move on with your circle in the third year: which topics to teach and where to get the materials.

It is always helpful to have a comprehensive collection of books on extracurricular mathematics. A lot of great books on the topic have already been published by the AMS and MSRI in the “Mathematical Circles Library” series, and more great books are sure to come. Many books that I will be mentioning in this chapter belong to this series.

Almost all the topics presented in this book can be expanded and taught on a new level of complexity in the third year. Therefore, my first recommen- dation is the book Mathematical Circles (Russian Experience)[2]. In this book, you will find more expanded and advanced presentations of most of the topics that we covered this year: divisibility, graph theory, combinatorics, invariants, colors, etc. You will also find a variety of topics we have not discussed yet: induction, strategy games, triangular inequality, Pascal’s tri- angle, etc. The book contains excellent theoretical discussions accompanied by a rich collection of problems. Some of the “lighter” topics from this book, such as construction and strategic games, would be appropriate for the curriculum of a second-year circle. The more advanced topics would work great for year 3.

For a collection of stand-alone lessons for a 3rd-year middle-school circle, I would also like to recommend several more books from the same series. The first one is Circle in a Box by Sam Vandervelde [5], which contains outlines of several circle sessions that can be used in a middle-school group. The two others are two volumes of A Decade of the Berkeley Math Circle by Stankova and Rike [4]and[8]. Each of these books contains lessons on a variety of topics and levels of difficulty.

265 266 What Comes Next?

Problems, Problem, Problems ... For additional problems for middle-school math circle students of all levels, I will gladly refer the reader to two more great books from the “Math Circles Library” collection. The first one is Invitation to a Mathematical Festival by Ivan Yashchenko [7]. The book contains a great collection of challenging and creative problems, most of which require no specialized mathematical knowledge. Another book, Moscow Math Circle: Week-by-week Problem Sets by Sergey Dorichenko [6], presents the actual collection of problems used by the author in a real Moscow middle-school math circle.

Online archives from past mathematical competitions make another good resource for problems. For example, you can take a look at the collection of BAMO (Bay Area Math Olympiad) problems [24]. Also, check out Seattle’s own UW Math Hour Olympiad, a unique oral Olympiad for middle-school students. It contains a great collection of beau- tiful problems of various levels of difficulty that can be used in math circles for grades 6 to 10 [23]. Also, past Mathematical Kangaroo Olympiad materials offer a collection of interesting problems on all levels, grades 1 and up.

If you are planning to include a unit on geometry into your math circle curriculum, I highly suggest taking a look at the Geometry in Problems book by Alexander Shen [9]. The book contains a collection of easy but nontrivial problems in all areas of plane geometry. It focuses on proofs and problem- solving techniques that create a “feel” for geometry and develop the ability to see and understand geometric problems. As a textbook on Euclidian geometry, I recommend Kiselev’s Geometry, Book I, Planimetry [10]. This rigorous and consistent book introduces the reader to the world of 2D geometry, starting with axioms and going all the way up. It contains many proofs and plenty of problems and exercises of different degrees of difficulty.

On a lighter side... If you are looking for more detailed or easier versions of some of the topics presented in this book, my Mathematical Circle Diaries, Year 1 [1]couldbe a good place to start. For younger students, I would recommend Camp Logic by Mark Saul and Sian Zelbo [15]. It provides the reader with cryptarithms, logical problems, Lewis Carroll-style puzzles, and game analysis that can be used for warm-ups or entertaining lessons. Also, the already-mentioned Circle in a Box contains a special section on warm-ups.

On a more “technical” note You may decide to incorporate some of more “technical” AMC-style mathematical topics into your curriculum next year. In this case, the The Farewell 267

MAA-published books on AMC preparation, First Steps for Math Olympians [11]andAMC Contest Problems Books [12], could be a great resource. Also, don’t forget about the excellent “Art of Problem Solving” book series, which includes the “beginner” and “advanced” levels, with volumes on algebra, geometry, combinatorics, problem solving, etc.

Looking around ... The existing mathematical circles community is another great resource. If you are a new math circle teacher, you can learn a lot by communicating with more experienced circle leaders, both online and in person. You can find the information about the existing mathematical circles on the National Association of Mathematical Circles (NAMC) website [25]. The NAMC website also contains an extensive collection of math circle lessons and prob- lems. Additionally, MSRI provides support for math circles by organizing workshops, distributing materials, and so on. Finally, a lot of math circles and math enthusiasts have extensive websites with useful links, collections of materials, and lists of problems. A page of Mathematical Circle Topics by Tom Davis is a must to visit. The page contains an extensive discussion on how to lead a math circle and a rich collection of handouts on a variety of math circle topics [27]. Cut-the-Knot [26], a Mathematics Miscellany and Puzzles website, con- tains an encyclopedic collection of math resources for all grades: arithmetic games, problems, puzzles, and articles. Also, take a look at the “Math for Love” website [33] and the website “Thinking Mathematics!” [34]byJames Tanton. Prime Factor Math Circle [28], where I teach, maintains a collection of problems and tournaments. TheLAMathCircle[30] website contains its archives dating back to 2007. Also, think out of the box and keep your eyes open! People in other countries might share your interests. For example, the UK site NRICH [35] offers plenty of “mathematical thinking” activities.

The Farewell I wish you great success in your teaching journey and I hope that it will be a happy and rewarding experience. As you go, you will make a lot of fascinating discoveries about mathematics, children, the world around you, and yourself. Good luck! P.S. I would always be happy to get a note from you! Send me an email, tell me a story about your circle, ask me a question. You are welcome to use my Prime Factor email [email protected] or my personal email: [email protected].

Part 4

Solutions

Problem Set 1. Checkerboard Problems 271

Session 1. Checkerboard Problems Solutions to Warm-up Problems

Warm-up 1 Solution. At first, there were 2 pears on the tree. After the wind had blown, 1 of the pears fell on the ground. So there were no pears (plural) left on the tree, and there were no pears (plural) on the ground.

Warm-up 2 Solution. The girls were triplets.

Solutions to In-Class Problems

Problem 1 Solution. If you colored the doggy in a checkerboard pattern, you would see that the number of black squares is 2 bigger than the number of white squares. However, each tile covers 1 black and 1 white square. Therefore, such a tiling is not possible.

Problem 2 Solution. The cake is made of 3+5+7+9+11+11=46 little triangles. Therefore, each of the 23 pieces should be composed of 2 triangles that share a side. Let’s color the triangles in alternating black and white pattern. This way, each piece should have 1 black and 1 white triangle. However, the numbers of black and white triangles are 21 and 25. Therefore, it is not possible to cut the cake this way.

Problem 3 Solution. A move of a chess Cavalier always starts and ends on squares of the same color. Thus, if a Cavalier starts on black, it stays on black. However, the target square is white. Therefore, the Cavalier cannot get there.

Problem 4 Solution. The board is 7 × 5; thus, a proper route should be 35 squares long. If we color the board in a checkerboard pattern, the squares along the route should alternate in color. Since 35 is an odd number, the first and last rooms should be of the same color. Therefore, the second map is not possible. Next, suppose that the low left corner of the board is black. Then 18 squares are black, and 17 are white. If we line these squares up in an alternating pattern, then the first and last squares must be of the dominating color—black. However, in the third map both squares are white. Thus, it is impossible. A solution for the first map is easy to find. 272 Solutions

Solutions to Take-Home Problems

Problem 1 Solution. One possible solutions is presented below. (If a student comes up with another solution, make sure that the pieces are rectangular and that the new cake preserves a chessboard pattern.)

Problem 2 Solution. Since Bill and Cindy together have 45 coins, 1 of them has at least 23 coins. Therefore, Archie has at least 24 coins. Thus, together Archie, Bill, and Cindy have at least 45 + 24 = 69 coins. Since all 4 pirates together have 70 coins and since Daniel has at least 1 coin, it follows that Daniel has exactly 1 coin. (And Archie has exactly 24 coins.)

Problem 3 Solution. Let’s color the rooms of the castle black and white, as shown in the picture below. You can see that there are 15 black rooms and only 10 white rooms. Since black and white rooms alternate along any route, one can’t visit more than 11 black rooms, so 4 rooms will always be left unvisited. It is easy to plot a route that visits all rooms except 4. (See the picture below on the right.)

Problem 4 Solution. Here, we have to write an equation. Suppose that the numbers are x and y. Then x − y =0.5 × (x + y). Simplifying, we get x − y =0.5x +0.5y. It follows that x − 0.5x = y +0.5y and 0.5x =1.5y. Therefore, x =3y and the ratio is 3:1.

Problem 5 Solution. (a) A route from the Square to the Cantina is easy to draw. (b) A proper route from the Square to the Chapel is not possible. Indeed, let’s color the intersections into alternating black and white colors. The colors of the intersections along a route would alternate. Moreover, the Square-to-Chapel route that visits all intersections exactly once should pass through all 16 of them. Therefore, the first and last intersections on this route should be of different colors. However, the Square and the Chapel are of the same color. Problem Set 1. Checkerboard Problems 273

Prime Factor Chapel

Integral Pi Cantina Square

Problem 6 Solution. Definitely, the digit 7 is incorrect. Indeed, since 3 numbers on the left are “4”, at least 1 must be correct. Therefore, the number on the right cannot be odd. Thus, not more than 1 digit was replaced on the left. Thus, at least 1 of the numbers “5” is correct. Therefore, the number on the right must end with 0. 4 × 5 × 4 × 5 × 4=2,240. If we assume that all the numbers on the left are correct, then the number on the right must be 1,600, which is impossible. So, we need to correct 1 digit on the left. Probably, the easiest way to proceed is to write the prime factorization of 2,240. 2,240 = 224 × 10 = 112 × 2 × 2 × 5 =2× 56 × 4 × 5=2× 8 × 7 × 4 × 5 =4× 4 × 7 × 4 × 5. Now, it is easy to see that the answer is 4 × 5 × 4 × 7 × 4=2,240. Problem 7 Solution. Out of dragons 1, 2, 3, and 4, two are of the same color. Assume that dragons 1 and 2 are of the same color. Out of dragons 3, 4, 5, and 6, two are of the same color. Assume that these are dragons 3 and 4. Out of dragons 5, 6, 7, and 8, two are of the same color. Assume that these are dragons 5 and 6. Out of dragons 7, 8, 9, and 10, two are of the same color. Assume that these are dragons 7 and 8. Take a look at the dragons 1, 3, 5, and 7. Two of them have to be of the same color. Therefore, at least 4 dragons are of the same color.

Solutions to Additional Problems Problem 1 Solution. (a) Each tile covers exactly 2 squares (an even number). Therefore, a shape that can be tiled should have an even number of squares. Thus, since the big shape is made of 35 squares, it cannot be tiled. (b) Such a tiling is easy to draw. (c) If we color the board in a checkerboard pattern, we can observe that both missing squares are black. Thus, the numbers of black and white squares are different. However, any 2×1 tile would always cover 1 black and 1 white square. Therefore, it is not possible to tile this shape. 274 Solutions

Problem 2 Solution. Color the 5 × 5 square in a checkerboard pattern. Altogether, the beetles are located at 13 black and 12 white squares, 1 per square. Each beetle changes the color of his square when he relocates. Therefore, 13 beetles that were used to be on black squares are all now sitting on 12 white squares. Therefore, there will be at least 1 square with at least 2 beetles on it. Problem 3 Solution. Color the picture as shown. Then each time Little Bear jumps over footprints he changes the color. Thus, after 7 jumps he will be on a color that is different from where he started.

Problem 4 Solution. Color the table black and white. Suppose the card is on white. If you flip it around the edge, it will be face up and on black. If you flip it one more time, it will be on white and face down, and so on. Thus, whenever the card is face up, it is on black, and whenever the card is face down, it is on white. Therefore, it cannot end up sitting face up on the original spot. Problem Set 2: Review: Math Logic and Other Problem-Solving Strategies 275

Session 2. Review: Math Logic and Other Problem-Solving Strategies Solutions to Take-Home Problems Problem 1 Solution. Several solutions are possible. One is presented in the picture below: A

B

Problem 2 Solution. Yes, he can. Example: Suppose now that the CEO has salary X and the VPs’ salaries are Y 1, Y 2, Y 3. Vote CEO VP1 VP2 VP3 1 2X Y 1/10 − 2 Y 2+1 Y 3+1 2 5X Y 1/10 − 1 Y 2/10 − 1 Y 3+2 3 10X Y 1/10 Y 2/10 Y 3/10 Problem 3 Solution. Assume that the point where the grasshopper starts jumping has coordinate 0. Then he will end up at a point expressed as a sum/difference of all the numbers from 1 to 10: 1 ± 2 ±···±9 ± 10.(A “plus” corresponds to jumping right, “minus”—left.) This expression contains 5 even and 5 odd numbers. Since the number of odd numbers is odd, the value of the expression would always be an odd number. Therefore, the grasshopper cannot end up on an even coordinate. Problem 4 Solution. To solve this problem, we either have to prove that a smaller rectangle always fits into a bigger rectangle or we have to come up with an example that would convince us that Michael is not correct. Such an example is surprisingly easy to find: take a look at a 5 × 5 square and at a 9 × 0.5 rectangle. The second shape is so long that it would not fit into this square, even if we place it diagonally. Problem 5 Solution. (a) Answer: 2 pencils. - We cannot take more than 2. Indeed, if we take more, we may end up taking 3 blue pencils and leaving 5. - Also, if we take 2, we take no more than 2 blue pencils; therefore, at least 6 blue pencils will be left. (b) Answer: 3 pencils. - We cannot take more than 3. Indeed, if we take 4, we may end up taking all 4 yellow pencils. 276 Solutions

- Also, if we take 3, we take no more than 3 yellow pencils, leaving at least 1. The same is true for other colors. (c) Answer: 24 pencils. - We cannot take fewer than 24. Indeed, if we take 23, we may end up taking 10 red, 8 green, 4 yellow, 1 blue. There will be 7 blue pencils left. - Also, if we take 24, we cannot take more than 22 pencils that are not blue. Therefore, we will take at least 2 blue pencils and will leave no more than 6. Problem 6 Solution. Initially, Fred’s car has a speed that is an odd number. Each minute the speed changes by 1; therefore, it changes parity every minute. Thus, in 100 minutes the speed will be odd. So, it cannot be equal to 0. Problem 7 Solution. We start by proving that at least 2 streets have to be walked twice. Take a look at the 4 corners marked with stars. At each of these corners, 3 streets meet. Since the policeman has to walk each of these 3 streets, he has to visit each of these corners at least twice. Therefore, at least 1 of the streets that starts at such a corner has to be walked twice. Since there are 4 corners, there are at least 2 such streets. Therefore, a route cannot be shorter than 18 + 2 = 20.(Thetotallength of all streets is 18.) A route of length 20 is easy to draw.

Alternative solution. There are 9 north-south streets. To get back to the point where the policemen started, the number of streets he walks up must be equal to the number of streets he walks down. Thus, the total number of north-south streets he walks must be even. There are 9 north-south streets. Therefore, the shortest route should include at least 10 north-south streets. By the same reasoning, the shortest route must include at least 10 east-west streets. Problem 8 Solution. Answer: 7 jars. First, we demonstrate that if we take 8 jars, we may end up without the required combination. Indeed, we may end up with 8 jars of strawberry jam and 2 each of sour cherry and apricot. Next, show that if we take 7 jars, then we are fine. Indeed, since we will be left with 13 jars, there will be at least 4 jars of the same kind. For jam of this kind, the total number of jars cannot be more than 8. Therefore, there will be at least 5 jars of 2 other types. There must be at least 3 out of these 5 that are of the same kind. Problem solved. Problem Set 2: Review: Math Logic and Other Problem-Solving Strategies 277

Problem 9 Solution. Answer: 3 monks. First, we demonstrate how 3 monks can leave barefoot. Order the monks by the size of the shoes they wear (from the smallest to the biggest). Name the monks "1", "2", ..., "6," and name the shoe sizes 1, 2, ..., 6. If the monks "1", "2", and "3" left in shoes 4, 5, and 6, then the monks "4", "5", and "6" will have to leave barefoot. Next, prove that 3 monks can always find the shoes that fit. Observe that whenever monk "1" or "2" or "3" is leaving the temple, one of the two facts below is guaranteed to be true: - Three monks already have left the temple with their shoes on. (In this case, the problem is solved.) - This monk is guaranteed to find a pair of shoes to put on. (Indeed, if fewer than 3 monks with shoes on have left the temple, then at least 1 of the pairs of size 4, 5, or 6 is still available. The monk can put the pair on.) These two facts together prove that 3 monks would always be able to leave with shoes on. 278 Solutions

Session 3. Invariants Solutions to Take-Home Problems Problem 1 Solution. Denote by x, y,andz the number of chocolates in the first, second, and third boxes. Then, we have x +6=y + z, y +10=x + z. The goal is to find z. Adding these two equations together, x+6+y+10 = y + z + x + z. Thus, 16 = 2z,and8=z. Problem 2 Solution. The answer is negative. You always add an even number of pieces of candy. Therefore, the parity of the total number of candy does not change. Since you start with 9 pieces of candy, you cannot end up with 900. Problem 3 Solution. Impossible. Whenever a sequence of such operations results in an integer number, this number would contain prime factors 2, 3, and 5 only. Problem 4 Solution. Invariant: After each operation, the sum of all numbers on the board become 1 smaller. Initially, it is 78. Therefore, after 11 operations it is 78 − 11 = 67. Problem 5 Solution. The birds cannot gather in the same tree. Let’s number the trees: 1, 2, 3, 4, 5, and 6. Then the parity of the total number of birds on the odd-numbered trees does not change. Problem 6 Solution. No, he cannot. Invariant: The total number of animals can never become divisible by 3. Indeed, the magician starts with 1 animal and each time he performs his trick, the total number of animals grows by 3. Problem 7 Solution. These numbers are equal. Indeed, we started with the same volume of milk and coffee, and we end up with the two mixtures that have the same volume. Since the amount of liquid in the coffee cup has not changed, exactly as much milk was added to this cup as coffee was removed from this cup. However, this coffee ended up in the milk cup. Therefore, the amounts of coffee in the milk cup and milk in the coffee cup are equal. Problem Set 4: Proof by Contradiction 279

Session 4. Proof by Contradiction Solutions to Warm-up Problems Warm-up 1 Solution. First, let’s point out that the first and third state- ments are opposites. Therefore, if 1 of them is false, the other is true. Therefore, all 3 statements cannot be false at the same time. Also, either the first or the third statement must be true. Thus, the second statement is false. So, the ring is in the second box. Warm-up 2 Solution. The first and the second statements mean the same thing. Therefore, they are either both true or both false. If we assume that they both are true, then the last statement must be false. Then the ring must be in the first box. If we assume that they both are false, then the ring is in the second box. It would make the last statement false as well, which is impossible. Therefore, the ring is in the first box.

Solutions to Take-Home Problems Problem 1 Solution. The total capital of all 10 families is 100 million. However, if the girls contributed less than 70 million and the guys contributed less than 30 million, the total would be less than 30 + 70 = 100 million. This is a contradiction, so one of our assumptions has to be false. Problem 2 Solution. Assume that this is not true. Then no 4 of them are from the same planet. In this case, not more than 3 delegates are from the 1st planet, not more than 3—from the 2nd, and so on. Altogether, there are not more than 3 × 8=24delegates. This contradicts the fact that there are 25 delegates. Problem 3 Solution. Suppose that this is not true. Then the 1st and 2nd magicians together know less than 100 spells, and the 4th and 5th magicians together know less than 100 spells. Then these four know less than 200 spells together. In this case, the 3rd magician knows more than 100 spells. Problem 4 Solution. Romeo will get back to the original spot in 6 minutes. So far, Juliet has been walking away for 6 minutes. Suppose her speed is x. Then her distance is 6x. From this moment on, each minute Juliet cover x; Romeo covers 3x. Thus, every minute the difference between them becomes 2x smaller. It was 6x. Therefore, it will take 3 minutes to get this distance to 0. Thus, altogether he ran 3+2=5minutes. Problem 5 Solution. (a) Assume that all 10 rectangles have different areas. Let’s list them from the smallest to the largest. The area of the first one is at least 1, of the second—at least 2, of the third—at least 3, and so on. Altogether, the total area of these 10 rectangles is at least 1+2+3+4+5+6+7+8+9+10 = 55. However, this contradicts the fact that the total area is 45. 280 Solutions

(b) Assume that none of the rectangles are congruent. Let’s list them from the smallest to the largest. There could be not more than 1 rectangle of each of these areas: 1, 2, 3, 5, and 7. (Indeed, these are prime numbers. Therefore, there is just 1 way to represent each of them as a product of factors.) Also, there could be no more than 2 rectangles of each of these areas: 4, 6, 8. (Indeed, a rectangle of area 4 could be 1 × 4 or 2 × 2,and so on.) Thus, the total area of the 10 rectangles must be not less than 1+2+3+4+4+5+6+6+7+8=46. Contradiction. Problem 6 Solution. Suppose that no 3 gnomes are standing next to each other and no 3 elves are standing next to each other. Then gnomes and elves should stand in groups of 1 or 2, and these groups should be separated from each other by humans. Here is an example that clarifies this statement: eeHggHeHHgHggHe. (“H” stands for a human, “e”—for an elf, “g”—for a gnome.) Since each group of elves is not bigger than 2, there should be at least 16 groups of elves. Similarly, there should be at least 16 groups of gnomes. Therefore, at least 32 groups of creatures must be separated from each other by humans. So, there must be at least 31 humans. Contradiction: We have 30 humans only. Problem 7 Solution. Let’s consider the sum of the values of all the cards. If we assume that all players had different last digits for their sums, then all 10 digits would be present, and the sum of them all would end with a 5. On the other hand, the sum of the values of all cards in play ends with a 0, a contradiction. Problem 8 Solution. Suppose that this is not true. Choose any column—it must contain more than 2 types of creatures. So, there will be 3 squares next to each other that are occupied by 3 different creatures. Suppose these are a frog (F), a bunny(B), and a hamster (H). Take a look at the square marked with “?”. What type of creature should it contain?

F B ? H

It definitely must be a mouse (M). Indeed, it shares a 2 × 2 square with the (B, F) pair and with the (B, H) pair. Next, it is easy to fill the two squares above and below M:

F ? B M H ?

There must be a hamster above and a frog below M. Problem Set 4: Proof by Contradiction 281

We can keep filling these three rows column by column; we get the pattern: F H F H B M B M H F H F

Therefore, we can see that the center row is occupied by bunnies and mice only and that the two other rows are occupied by frogs and hamsters only. 282 Solutions

Session 5. Decimal Number System and Problems on Digits Solutions to In-Class Problems Problem 1 Solution. 1,000 × S + 100 × E +10× N + D + M × 1,000 + O × 100 + 10 × R + E +10,000 × M +1,000 × O + 100 × N +10× E + Y . If we regroup, we get 10,000 × M +1,000 × (S + M + O) + 100 × (E + O + N) +10× (N + R + E)+D + E + Y. Another regrouping results in the expression 11,000 × M +1,100 × O +1,000 × S + 111 × E + 110 × N +10× R + D + Y. To maximize this expression, M should take the biggest possible value, which is 9. Next, O should take the value 8, and S should be set to 7. Next, we should assign values 6 to E and 5 to N. Finally, R should be 4, and D and Y should get values 3 and 2 in any order. Thus, we have two ways to maximize the expression: 7,653 + 9,845 + 98,562 and 7,652 + 9,845 + 98,563. This sum is equal to 116,060. Problem 2 Solution. The code is number abba.Also,thenumberab must be equal to 2a +2b. Writing an equation, we get 10a + b =2a +2b.So,8a = b.Sincea and b are digits, then the only nonzero solution is a =1and b =8.So,thecode is 1,881. Problem 3 Solution. The number that Mary wrote is 9ab.Paul’snumber is ab9. Since it is 216 smaller, we get this equation: 900 + 10a + b = 100a +10b +9+216. Rewriting, we get 675 = 90a+9b =9(10a+b). Dividing, we get 75 = 10a+b. Thus, a =7and b =5. An alternative solution is to rewrite the problem as column addition: ab9 + 216 9ab

Restoring digits column by column, we get the same answer of 75. Problem 4 Solution. The equation is 100a+10b+4 = 0.75(400+10a+b). Since 0.75 = 3/4, we can rewrite the equation as 4(100a +10b + 4) = 3(400 + 10a + b). This means that 400a +40b +16=1,200 + 30a +3b. Simplifying, we get 370a +37b =1,200 − 16.So,37(10a + b)=1,184. Dividing both sides by 37, we get 10a + b =32.Thus,a =3and b =2. The number is 432. Problem Set 5: Decimal Number System and Problems on Digits 283

Solutions to Take-Home Problems

Problem 1 Solution. Let’s prove that Winnie’s age is 45. (So, the house number is 99,999.) Indeed, since Winnie can talk, he is definitely at least 2 years old. Any number between 2 and 44 can be represented as a sum of 5 1-digit numbers in several different ways. For example, 2 = 1+0+0+0+1 = 1+0+0+1+0; 43=8+9+9+9+8=8+9+9+8+9.

Problem 2 Solution. Notice that R must be equal to 9. (If R is less than 9, then RR + R is not a 3-digit number.) Then BOW = 108. In this problem, we are using all 10 digits: R, B, O, W, F, A, I, N, T, G. We know the values of 4 of them: R =9, B =1, O =0, W =8.Therefore, the rest of the digits (F, A, I, N, Y, G) are equal, in some order, to (2, 3, 4, 5, 6, 7). Since we have 2 and 5 in this set, then the last digit of the product should be equal to 0.

Problem 3 Solution. In how many ways can we choose a set of 9 different digits? Each such set is obtained by crossing out 1 digit from the set of 10 digits:9,8,7,6,5,4,3,2,1,0.Therefore,thereare10setslikethis.

Problem 4 Solution. Shmerlin should choose the numbers 100, 10, and 1. The expression A × 100 + B × 10 + C × 1 is equal to a 3-digit number, the digits of which indicate the digits of the secret code.

Problem 5 Solution. We present two solutions. Solution 1. Suppose that the number is 1abcde. Then, after we relocate the digit, we get abcde1. Let’s rewrite 1abcde as 100,000 + abcde and abcde1 as 10×abcde+1.Ifwedenotebyx the number abcde, then these two numbers are equal to 100,000 + x and 10 × x +1. Therefore, we have the equation 3(100,000 + x)=10x +1.Solvingforx,weget300,000 + 3x =10x +1; 299,999 = 7x; x = 299,999 ÷ 7=42,857. Thus, the answer is 14,2857. Solution 2. Rewrite the problem as column multiplication: 1abcde x 3 abcde1 From the ones column, it follows that e =7, and the carry to the tens column is 2; 1abcd7 x 3 abcd71 From the tens column, it follows that d × 3 ends with 5; therefore, d =5. 1abc57 x 3 abc571 Uncovering the number digit by digit, we get the answer 142,857. 284 Solutions

Problem 6 Solution. Let’s start with drawing two central lines of the square (they split the square into 4 5 × 5 squares). If the 2 marked squares end up in different 5 × 5 squares, then 1 of these central lines separated the 10 × 10 square into 2 halves with marked squares in different halves. (See the picture on the left.)

Now, assume that both marked squares ended up in the same 5 × 5 square. These marked squares should belong to different rows or different columns or both. Without loss of generality, assume that they belong to different columns. Then let’s draw three lines: - a horizontal center line, - any vertical line that follows grid lines and that separates these two squares and ends at the center line, - the line symmetric to the second line with respect to the center of the square. (See the picture on the right.) We have a solution.

Problem 7 Solution. Notice that SHE = S × 100 + HE. Therefore, HE × HE = S × 100 + HE; HE × (HE − 1) = S × 100. Thus, we have two consecutive numbers that multiply to a multiple of 100. Factoring 100, we can rewrite the equation as

HE × (HE − 1) = S × 5 × 5 × 2 × 2.

The product on the left should have the same set of prime factors as the product on the right. Therefore, the numbers HE and HE − 1 combined should contain factors 5, 5, 2, and 2. Can both HE and HE − 1 have factors 5? No. Only one of two consecutive numbers can be divisible by 5. Therefore, one of the numbers should be a multiple of 25. The same is true for the factor 2: one of the numbers should be a multiple of 4. Therefore, we do not have too many choices: HE =25or HE =50or HE =75or HE − 1=25or HE − 1=50or HE − 1=75.However,50 × 50 = 2,500 is a 4-digit number, while we are looking for a 3-digit product. So, either 5HE =2 or HE − 1=25. Trying both options, we see that HE =25, S =6. Problem Set 5: Decimal Number System and Problems on Digits 285

Solutions to Additional Problems Problem 1 Solution. The numbers from 1 to 9 make up the first 9 digits of Olivia’s number; the numbers from 10 to 99 make up the next 90 × 2 = 180 digits of it. Therefore, 500 − 189 = 311 erased digits come from 3-digit numbers. This string of 311 digits is composed of 103 3-digit numbers and 2 extra digits. The first 103 3-digit numbers are numbers from 100 to 202. The next number is 203; its first 2 digits have been erased. Therefore, the first digit of the remaining number is 3. Problem 2 Solution. (a) So, we have six spots: ______. Suppose that the leftmost digits are x and y: xy_ _ _ _. Then the third digit from the left is x + y, the fourth is y + x + y =2y + x, the fifth is 2y + x + x + y =3y +2x,and the last one is 2y + y +3y +2x =5y +3x. Thus, the number is composed of digits: x, y, x + y, x +2y, 2x +3y, 5y +3x.So,5y +3x<10.Also,sincewe want to get the biggest 6-digit number possible, our goal is to make x (the leftmost digit) to be as big as possible. Can x be 3? Yes; in this case, y has to be 0. However, x cannot be greater than 3 since in this case 3x would be at least 3 × 4=12. Therefore, the answer is 303,369. (b) The idea is very similar. The digits of the number are x, y, x + y, x +2y, 2x +3y, 3x +5y, 5x +8y, 8x +13y, 13x +21y, .... For this number to be the biggest, we should keep this sequence below 10 for as long as possible. However, since x ≥ 1, the expression 13x+21y is greater than 10. Therefore, we should try to choose x and y such that 8x +13y<10.Thisispossibleif x =1, y =0. Therefore, the answer is 10,112,358. Problem 3 Solution. On the first iteration, Ben crosses out all the digits that have odd indices. On the second iteration he does it for all the digits of the original 100-digit number with indices that have exactly one prime factor 2. (Examples: 2, 6, 10.) On the third iteration he does it for all the digits of the original 100-digit number with indices that have exactly two prime factors 2. (Examples: 4, 8 12.) On the next iteration he does it for all indices that have exactly three prime factors 2, and so on.... The index that is left is the biggest power of 2 between 1 and 100: it is 64. The digit at this index is 4. Problem 4 Solution. The answer is positive. A typical student’s mistake is to work his way through a couple of examples: 134 + 431 = 565; 322 + 223 = 545, and conclude that the tens digit in the answer is always even. He could even justify the answer using the column addition algorithm. abc + cba a + c 2bc+ a He would argue that the second digit is 2b. However, he forget about a carry! If a + c>9, then the carry makes the second column odd! Example: 219 + 912 = 1,131. 286 Solutions

Problem 5 Solution. Let’s try to figure out how many digits each of these numbers can possibly have. First, let’s prove that there are no 3- digit numbers on the list. Indeed, if we had a 3-digit number on the list, then the rest of the numbers would be not more than 4 digits long. Then we would have not more than 500 × 4=2,000 digits. Therefore, the list should be made of 4-digit numbers followed by 5-digit numbers. So, each of these 500 numbers on the list contributes 4 digits to the total, with each 5-digit number contributing an extra digit each. 500 × 4=2,000. Therefore, to get to 2,006 there should be 6 5-digit numbers. (Each 5-digit number would add 1 digit to the total.) Therefore, the 5-digit numbers must be 10,000, 10,001, 10,002, 10,003, 10,004, 10,005. The leftover 494 numbers are the 4-digit numbers: 9,506, ..., 9,999. Problem Set 6: Binary Numbers I 287

Session 6. Binary Numbers I Solutions to Take-Home Problems

Problem 1 Solution. (a) 102 =2 (b) 1012 =4+1=5 (c) 1112 =4+2+1=5 (d) 10002 =8 (e) 11012 =8+4+1=13 (f) 100000002 = 128 (g) 11111112 =64+32+16+8+4+2+1=127

Problem 2 Solution. (a) 3=112 (b) 8 = 10002 (c) 15 = 11112 (d) 32 = 1000002 (e) 31 = 111112 (f) 40 = 1010002 (32 and 8) (g) 53 = 1010112 (32 and 8 and 2 and 1)

Problem 3 Solution. (a) The number that is 1 bigger is 1000000012. The number that is one smaller is 111111112. (b) One smaller: 11111111102; two smaller: 11111111012.Tocalculate the number that is 2 bigger, it is easier to start with calculating a number that is 1 bigger: 100000000002 Next, we can calculate a number that is 2 bigger: 100000000002 + 1 = 100000000012.

Problem 4 Solution. (a) A binary number is odd if it ends with 1; it is even if it ends with 0. (b) Any binary number is composed of powers of 2. All powers of 2 except 2=21 and 1=20 are divisible by 4. Thus, any binary number that is composed of 22 and higher powers of 2 is divisible by 4. So, any binary that ends with 00 is divisible by 4. Examples: 1002, 1111011002. Also, it is easy to see that a binary number that ends with 01, 10, and 11 is not divisible by 4. (c) The remainder is 102 =2.

Problem 5 Solution. Joeshouldtake1,2,4,8,16.Therearethepowers of 2: any number from 1 to 31 can be expressed through them.

Problem 6 Solution. Suppose that the price of the laptop is x.Herdad pays 1/2 × x; her brother pays 1/4 × x; her sister pays 1/8 × x; Julia pays 260. 288 Solutions

Together, these four quantities add up to x. We have an equation: 1/2 × x + 1/4 × x + 1/8 × x + 260 = x, 1/4 × x + 1/8 × x + 260 = 1/2 × x, 1/8 × x + 260 = 1/4 × x, 260 = 1/8 × x, x = 260 × 8=2,080.

Problem 7 Solution. Step 1: Measure 1 gram of flour. Step 2: Using 1 gram of flour and the 1-gram weight, we can measure 2 grams of flour. Step 3: Using 2 grams and 1 gram of flour and the 1-gram weight, we can measure 4 grams of flour (22). Step 4: Using 4, 2, and 1 grams of flour and the 1-gram weight, we can measure 8 grams (23). .... Step 10: Using all measures of flour you already have and the 1-gram weight, we can measure 512 grams (29). Step 11, which does not involve using the scale: Choose a combination of weights from 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 that adds up to 1,000. These are 512, 256, 128, 64, 32, 8.

Problem 8 Solution. Let’s start working on this problem backward: Eamon’s share equals half of his share and a half-coin: x =0.5+0.5x. Thus, x =1. Eamon received 1 gold coin. TakealookatDon:fromwhatwasleft(y coins), he received half of the amount and a half-coin. The rest (1 coin) was given to Eamon. Therefore, y =0.5+0.5y +1; 0.5y =1.5; y =3. Take a look at Chad: from what was left (z coins), he received half of the amount and half-a-coin. The rest (3 coins) was given to Don. Therefore, z =0.5+0.5z +3; 0.5z =3.5; z =7. Thus, after Bob received his share (t coins), there were 7 coins left. So, we can write t =0.5+0.5t +7; 0.5t =7.5; t =15. Finally, the entire sum (m coins) was divided between Archie and the rest as follows: m =0.5+0.5m5 +1 ; 0.5m =15.5; m =31.

Problem 9 Solution. Let’s agree to mark a sphere that is “on” by 1 and that is off by “0” and to list the spheres in this order: ruby, emerald, sapphire. For example, the string 101 would mean that the ruby sphere shines, the emerald is not shiny, and the sapphire sphere shines. Here is one possible code: - The dragon is heading north if the spheres are set into one of the two states 000 or 111. - The dragon is heading south if the spheres are set into one of the two states 100 or 011. - The dragon is heading east if the spheres are set into one of the two states 010 or 101. Problem Set 6: Binary Numbers I 289

- The dragon is heading west if the spheres are set into one of the two states 001 or 110. Let’s prove that the code works. Indeed, suppose that we have a random three-digit string of 0’s and 1’s and a pair of codes for a direction. If this three-digit string matches one of the codes for this direction, the problem is solved. If the difference between the string and the first code is exactly 1 symbol, then we can change the sphere that corresponds to this symbol. If the difference between the string and the first code is 2 symbols, then the difference with the second code must be 1 symbol. (Indeed, the two codes are opposites of each other.) If the difference between the string and the first code is 3 symbols, then the string is a perfect match with the second code. 290 Solutions

Session 7. Binary Numbers II Solutions to Warm-up Problems

Warm-up 1 Solution. Hints: symmetry, mirror. Solution: Each symbol has a vertical line of symmetry. If you remove the part to the right of this line, you get a new symbol which looks like a digit. So, the first expression is decoded as 2+6 = 8. The second expression is decoded as 1+3 =?. Thus, the answer must be the encoded “4” – the symbol in (A).

Solutions to Take-Home Problems

Problem 1 Solution. (a) 11012 (b) 10110102 (c) 11100012 (d) 10111110102 Some of these problems can be calculated without using the binary addition algorithm. For others, the algorithm comes in handy.

Problem 2 Solution. (a) Add one zero: 100102, 1111111110102. (b) Add two zeroes: 111000111002. 6 (c) 64 = 2 . So, 6 zeroes should be added: 1110000002. Problem 3 Solution. 6 4 (a) 80 = 64 + 16 = 2 +2 = 10100002. 7 4 3 (b) 152 = 128 + 24 = 128 + 16 + 8 = 2 +2 +2 = 100110002. (c) 401 = 256 + 145 = 256 + 128 + 17 = 256 + 128 + 16 + 1 = 28 +27 + 4 0 2 +2 = 1100100012. 9 3 1 (d) 522 = 512 + 10 = 512 + 8 + 2 = 2 +2 +2 = 10000010102. (e) It would be easiest to notice that 1,023 = 1,024 − 1=210 − 1. Therefore, 1,023 = 11111111112. Problem 4 Solution. If two flowers instead of one started blossoming on day 1, then the number of flowers would have been twice as big as it actually was. Therefore, the pond would become completely covered in flowers on a day when it actually was half-covered. It was half-covered on June 14th since the number of flowers doubles every day.

Problem 5 Solution. Take a look at the cuts in the picture below: any rectangle can be assembled from these pieces. First, we express the width of the rectangle as a combination of 1, 2, 4 and select corresponding columns. Next, we express the height of the rectangle as a combination of 1, 2, 4 and choose corresponding rows. For example, for a 5 × 3 rectangle, 5=4+1, 3=2+1; therefore, we need the pieces 4 × 2, 4 × 1, 1 × 2, 1 × 1. Problem Set 7: Binary Numbers II 291

Problem 6 Solution. Brother Rabbit can always secure 18 rows. We will start by demonstrating how Brother Fox can always prevent Brother Rabbit from getting 19, and then we will show how Brother Rabbit can always get 18. Getting 19 rows means that all 20 rows have been planted in the same pattern. However, it is easy for brother Fox to prevent this from happening: on the last move, he has a choice of vegetable, while Brother Rabbit has no choice on where to plant it. Therefore, Brother Rabbit is able to make this last row different from the rest. This way, he can ensure that there will be at least two distinct patterns. There is a simple way for Brother Rabbit to get 18 rows: - He should plant all carrots in columns, left to right. For each column, he should fill it completely, top to bottom, before switching to the next column. - And he should plant all beets in columns, right to left. For each column, he should fill it completely, bottom to top, before switching to the next column. This way, the game ends with several columns of beets, several columns of carrots, and one column of beets/carrots mix. Such an arrangement generates 2 distinct types of rows. So, Brother Fox gets the crop from 2 rows. Problem 7 Solution. Color the nodes (plazas) in alternating black and white colors. Whichever route the tourist takes, the nodes along her route will alternate in color. There are 36 nodes altogether—18 black and 18 white. Since the first and the last nodes (the terminal and the hotel) should be of the same color, a route cannot be longer than 35 nodes. It is easy to come up with a 35-nodes route.

B

A 292 Solutions

Session 8. Mathematical Dominoes Tournament Solutions to Mathematical Dominoes Problems

# Answer Score 1. 4 large 3:0 2. 150, 15 5:2

3. 3:3

4. 3 boys, 2 girls 1:0 5. 10 yards 1:1 4 total: (1+2) × 3+4, (1+2) × (3+4), 1 + (2 × 3) + 4, 6. 6:0 1+2×(3+4) 7. 22 + 979 = 1,001 5:0 8. John: 40, Mary: 50 7:0 9. 12+3+4–5+6–7=13 7:1 10. 44 seconds 2:1 11. 1 4:0 12 15 5:3 27 (8 numbers per each combination of five/four, six/seven, 13 6:2 two/three; also 111, 888, 999) 14 160 7:2 15 by 400% 4:1 16 4 2:2 17 2kg 7:5 18 8or9 8:3 19 (c) and (e) 8:2 20 1and3 9:1 21 8problems 2:0 22 30 7:3 23 8marbles 5:1 24 15 7:4 25 606 inches 6:4

26 4:2

27 (b) 5:4 28 6AM 0:0 29 60 8:1 30 Laura oldest, Angela youngest 3:2 31 280 4:3 32 36, 37 7:6 Problem Set 8: Mathematical Dominoes Tournament 293

33 5kg 4:4 34 41 word 8:0 35 7+6=13 3:1 36 1,005th digit 6:5 37 0knights 6:1 38 5teams 5:5 39 between floors 27 and 28 6:3

Solutions to Take-Home Problems

Problem 1 Solution. It’s not hard to see that the number of times each brother has crossed the road has the same parity. Since they started together, they will also end on the same side of the road.

Problem 2 Solution. Let’s unroll this problem backward. At the 3rd crossing he paid 40 coins. This means that he had 20 before the 3rd crossing. This means that he has 60 after the second crossing. This means that he had 30 before the second crossing. This means he had 70 after the first crossing. This means he had 35 before the first crossing. Answer: 35.

Problem 3 Solution. After each exchange, the number of Emily’s toys became 1 smaller. Therefore, the exchange took place for 24+26+25−1=74 days.

Initially Dolls: 24 Animals: 26 Cars: 25 Givesadollandananimal −1 −1 +1 Gives a doll and a car −1 +1 −1 Gives a car and an animal +1 −1 −1

The table makes it easy to see that the difference between dolls and animals always remains even. For example, initially the difference between dolls and animals is 2. After each transaction, it can either remain the same or be changed by 2. Therefore, it remains even. Thus, we cannot be left with 1 doll and 0 animals or with 0 dolls and 1 animal. Therefore, we’ll be left with 0 dolls, 0 animals, and 1 car.

Problem 4 Solution. The total sum of all faces is equal to 21. With 12 being the sum of four lateral sides, we are left with 9, which can be represented as 6+3 or 4+5. Thus, we know that either 6 and 3 are on opposite sides or 4 and 5 are on opposite sides. Having 15 on the sides leaves us with 6, which is either 2+4or 1+5. Both possibilities rule out having 4+5 on two opposite sides, so we must choose 3+6in the first case. Thus, 6 is opposite 3. 294 Solutions

Problem 5 Solution. First, observe that neither side can have the number 59 since the sum of the digits of 59 is 14. Therefore, the distance from a post to either village cannot exceed 58. Next, take a look at a milepost with 9 at one of the sides. The number on the other side is less than 59, and the sum of its digits is 4. If it were number 4, then the next milepost would have the numbers 10 and 3, which would not work. Therefore, it is either 40 or 31 or 22 or 13. The set (9, 13) does not work since the next milepost would be (10, 12). The set (9, 22) does not work since the next milepost would be (10, 21). The set (9, 31) does not work since next milepost would be (10, 30). However, (9, 40) may work: the next milepost, (10, 39), has the same sum of digits. Let’s prove that the distance 10 + 39 = 49 works indeed. A case-by-case analysis is, probably, the easiest approach. For mileposts with numbers 1 to 9 the matching numbers are 48 to 40. The sums of the digits for each of the combinations (1, 48), ..., (9, 40) is 13. For the milepost that has the number 10, the matching number 39 works as well. For the mileposts from 11 to 19 the matching numbers from 38 to 30 work. For the milepost that has the number 20, the matching number is 29; etc..... Problem Set 9: Pigeonhole Principle 295

Session 9. Pigeonhole Principle Solution to Warm-up Problem Problem 1 Solution. When simplifying the next-to-last line, we divide by 0. (The expression x2 − xy is, in fact, equal to 0.) Therefore, we convert the expression 1 × 0=2× 0 into 1=2.

Solutions to Take-Home Problems Problem 1 Solution. See the picture:

Problem 2 Solution. Designate the 12 zodiac signs as the pigeonholes and the students as pigeons. The zodiac sign of a student would define her pigeonhole. The number of pigeons is greater than the number of holes; therefore, by the Pigeonhole Principle, there is a hole (a zodiac sign) with at least two pigeons (students) that belong to it. Problem 3 Solution. The smallest possible total score is 0; the biggest is 6. Thus, 7 different outcomes are possible. Designate these as pigeonholes. Designate knights to be pigeons. The number of pigeons (8) is greater than the number of holes; therefore, at least one hole (score) will contain at least two pigeons (knights). Problem 4 Solution. Designate the numbers of supporters as pigeonholes and politicians as pigeons. Since the number of supporters varies between 0 and 11, there will be 12 pigeonholes—the same as the number of pigeons. To be able to apply the Pigeonhole Principle, we should observe that if there is a politician who has 11 supporters, then none in the group could have 0 supporters. Or, if there is a politician who has 0 supporters, then nobody is supported by 11. Therefore, in reality, the number of pigeonholes is 11. We can apply the Pigeonhole Principle! There will be two politicians with the same number of supporters. Problem 5 Solution. Let’s sort the 3 red points into 2 groups as follows: the points with odd coordinates are all belonging to the first group and the points with even coordinates—to the second. By the Pigeonhole Principle, at least 2 points belong to the same group. Since these 2 points have the same parity, the distance between them is even, and their midpoint is an integer number. 296 Solutions

Problem 6 Solution. Each route passes through 7 rooms; each room would yield 0 or 3 or 6 coins. Therefore, the smallest sum a child could have when exiting the labyrinth is 0 coins, the largest—42 coins; moreover, the number of coins must be a multiple of 3. Therefore, we have 15 possibilities: 0, 3, 6, ..., 42. Since there are 12 kids, then, apparently, the Pigeonhole Principle cannot be used. However, let’s take another look: everyone passes through the entrance and exit rooms. Therefore, in these 2 rooms, each child receives the same amount of coins. Thus, only 5 rooms matter for the problem. Therefore, the number of possibilities is defined by the number of possible totals when passing through 5 rooms. These possible totals are 0, 3, 6, ..., 27, 30 coins—11 options altogether. Since we have 12 kids, we can apply the Pigeonhole Principle.

Problem 7 Solution. If Ashley saw 2 red hats, she would know that she is not wearing red. If Ashley saw 2 yellow hats, she would know that she is not wearing yellow. Otherwise, she would not know for sure. Since Ashley chose to keep silent, Betty knows that she and Cindy do nothave2redhatsor2yellowhats. Therefore, if Betty saw that Cindy is wearings red, she would know that she does not wear red. If Betty saw that Cindy is wearing yellow, she would know that she is not wearing yellow. Since Betty chooses to remain silent, Cindy can deduce that she is wearing green.

Solutions to Additional Problems

Problem 1 Solution. Altogether, there are 7 possibilities for the sum: 0, 1, 2, ..., 6. Let these possible answers be the pigeonholes. There are 8 sums. Let these sums be the pigeons.

Problem 2 Solution. There are 1,000,001 possibilities since the number of hairs range from 0 to 1,000,000. Designate these as pigeonholes and people as pigeons.

Problem 3 Solution. Designate the possible last digits of the numbers to be the pigeonholes and the numbers to be the pigeons.

Problem 4 Solution. There are 4 × 4 × 4=43 =64outcomes and 70 students. (Each outcome is a 3-number sequence with 4 possible values for each number.) The Pigeonhole Principle with outcomes as pigeonholes and students as pigeons proves the problem.

Problem 5 Solution. Let’s sort the 5 red points into 4 groups as follows: The first group—points with both x-andy-coordinates even. The second group—points with both x-andy-coordinates odd. The third group—points with x-coordinate odd and y-coordinates even. The fourth group—points with x-coordinate even and y-coordinates odd. Problem Set 9: Pigeonhole Principle 297

Out of 5 red points, at least 2 should belong to the same group. Then the difference of the x-coordinates of these 2 points is even, and the difference of the y-coordinates of these 2 points is even. Then both the x-andy- coordinates of their midpoint are integers. Problem 6 Solution. By the Pigeonhole Principle, two of these numbers would have the same reminders when divisible by 19. The difference of these numbers has to be divisible by 19. Such a difference is a number that is composed of a bunch of 1’s trailed by several 0’s: 11...10...0. It can be expressed as 11...1 × 10...0. The second term of this product, the number 10...0, cannot be divisible by 19. Therefore, the first term 11...1 must be a multiple of 19. 298 Solutions

Session 10. Geometric Pigeonhole Principle Solutions to Warm-up Problems

Warm-up 1 Solution. Burn the first rope from one end, and the second rope from both ends. As soon as the second rope is burnt completely, we have 1 hour gone. At this moment, we still have 1 hour left in the first rope. Burn the other side of the first rope. In 30 minutes, the first rope will be burnt completely. Therefore, the total burning time of the first rope will be 1hour30minutes.

Warm-up 2 Solution. Burn the first two ropes as in the previous problem. When the second rope is burnt completely (in 1 hour), burn the third rope from one side. In 30 minutes, when the first rope is burnt completely, burn the third rope from the other side. In 45 minutes, the third rope will be burnt completely.

Solutions to Take-Home Problems

Problem 1 Solution. Starting with two numbers, a and b,nexttoeach other, we immediately deduce that the other numbers have to be, in order, b/a, 1/a, 1/b,anda/b.Pickinganya and b yields an example; e.g., for a =1 1 1 and b =2,wehave1,2,2,1, 2 , 2 . Problem 2 Solution. See the picture:

Problem 3 Solution. Let’s divide the 10×10-mile square into 25 2×2-mile squares. Since at least 26 settlers are from Seattle, at least 2 of the settlers from Seattle would have the plots in the same 2 × 2 square. However, all 4 plots in a 2 × 2 square are neighbors of each other.

Problem 4 Solution. Let’s sort the numbers between 1 and 98 into groups as follows: 2 numbers belong to the same group if their sum is 99. Thus, 1 and 98 belong to the same group, 2 and 97 belong to the same group, ..., 49 and 50 belong to the same group. There are 49 groups altogether. Applying the Pigeonhole Principle, we claim that out of 50 numbers at least 2 will belong to the same group. Since these 2 numbers must be different, their sum must be 99.

Problem 5 Solution. First, let’s prove that we need no less than 16 shots. Indeed, let’s divide the 8 × 8 field into 16 4 × 1 horizontal strips. If the Problem Set 10: Geometric Pigeonhole Principle 299 number of shots is less than 16, then 1 of the strips is not hit. But it is possible that Sam hid his battleship exactly in that strip. This proves that Brendon needs at least 16 shots. On the other hand, it is easy to show that with 16 shots Brendon can make sure no battleship is left undamaged. In the picture below, crosses mark the 16 squares that Brendon should hit. One can see that a ship of length 4 cannot fit anywhere, either horizontally or vertically. x x x x x x x x xx x x x x x x

Problem 6 Solution. Let’s assume there are 2 flies, A and B, that are more than 1 foot apart. Then, every other fly is either in a 1-foot radius of A or in a 1-foot radius of B. Out of the 23 remaining flies either at least 12 will be in the 1-foot radius of A or we’ll have 12 in the 1-foot radius of B. Swatting that fly with the center of the swatter kills 13 total. Now, if no 2 flies are further than 1 foot from each other, we can kill them all in 1 strike by aiming the center of the swatter at any fly.

Problem 7 Solution. The area of the exhibition circle is 100π (a circle of radius 10). Each cactus has a “hate area” around it that has area 4π (a circle of radius 2). For 20 cacti, the maximum area the “hate circles” can cover is 20 ∗ 4π =80π. That means there is a point inside the big circle that is not covered by any hate circle. Planting another cactus there will not make anyone unhappy.

Solutions to Additional Problems

Problem 1 Solution. Let’s divide the carpet into 16 1 × 1 squares. Since we only have 15 holes, we’ll be able to find a square without a hole.

Problem 2 Solution. Dividing the wireframe into 4 parts as shown in the picture (each part has 3 edges connected at a vertex) proves that no more than 4 scorpions are possible—if there were more than 4 of them, one of 300 Solutions the parts would contain at least 2, and they would not tolerate each other. Placing 4 scorpions is possible as shown in the same picture. Problem Set 11: Mathematical Olympiad I 301

Session 11. Mathematical Olympiad I Solutions to the Olympiad Problems Problem 1 Solution. After 7 sparrows flew away, we had 18 sparrows left. That means that the second bush at that point had 12 and the first one 6. So, in the beginning, the first bush had 6+5=11, and that leaves the second one with 25 − 11 = 14. Problem 2 Solution. The small square does not affect the outer perimeter length. Indeed, the small square contributes two segments to the outer perimeter. However, each of these segments can be matched to an equal segment that is removed from the outer perimeter. Thus, the perimeter is 4 × (7 + 5 − 3) = 36 feet long, and it will take the ant 36 minutes to walk around. Problem 3 Solution. Test 2 apples that are 3 apples apart (2 apples on one side and 3 on the other). They are too far apart to both be poisonous. Thus, if they taste the same, they are both good; take them. If one registers as poisonous, the other one is good, and the one next to it that is 3 apples away from the poisonous one is also good. Problem 4 Solution. Let x be the number of tea bags in a box. Since Mila brewed 57 cups using each bag at least twice, we know that 2x ≤ 57,so x ≤ 28. On the other hand, Lila used each bag at most 3 times, so 3x ≥ 83 and x ≥ 28. There are 28 bags in a box. Problem 5 Solution. It is not possible. Choose two squares that can be connected by a chess knight move. Suppose that the smaller value is x and the bigger is x +3. Then the two intermediate squares must contain x +1 and x +2. (See the picture.) x +3 x +2 a b x +1 c x Then, since the squares c and b share sides with each other and with x and x +3, they must contain x +1and x +2. The square marked by a is reached from the square x by one chess knight move. Therefore, it should contain x +3. However, the square a is reached from the square b by one chess knight move as well. Therefore, square b must contain x or x +6. Contradiction. Problem 6 Solution. The product of 25 numbers is even only if at least one of these numbers is even. Thus, we should prove that the total loss of at least one pirate is even. On day 1, 13 pirates lost an odd number of doubloons each. Let’s prove that at least one of them lost an odd number of doubloons on the second day as well. There are 12 even numbers between 1 and 25. So, if each of the 13 lost an even number on day 2, then by the Pigeonhole Principle there must be at least two who lost the same amounts. However, this is impossible. 302 Solutions

Alternative solution: Use double counting. If each pirate lost an odd number of coins, then the total number of coins lost by 25 of them must be odd. However, the total number of coins is even: 2 × (1 + ···+ 25). Problem 7 Solution. Note that both monsters skipped numbers that are divisible by 88. Therefore the first one ate “all divisible by 8” minus “all divisible by 88”, and the second ate “all divisible by 11” minus “all divisible by 88”. The second term in both expressions is the same, and the first term is greater for the first monster. Problem 8 Solution. Yes, they can. Here is an example.

It is easy to see that the rooks attack all but the 4 corner squares. However, in each of those squares, the knight itself would be attacking one of the rooks. Problem 9 Solution. Let’s consider which number in each pair of neigh- bors is greater. One can see that if we have three numbers next to each other in increasing order, aac···. But since 99 is an odd number that cannot continue all the way around. Problem 10 Solution. 1111...1 = 111,111,111 × 100,000,000,100,000,000...100,000,000. In the product on the right, the first term is composed of 9 ones and is divisible by 9. The second term is composed of 9 ones, separated by zeroes. Therefore, it is also divisible by 9. Then, the product is divisible by 81. Problem 11 Solution. Note that each 100’s number is definitely not un- breakable since it can be represented as a multiple of 100. So we cannot have more than 99 unbreakable numbers in a row. On the other hand, 10,001, 10,002, ..., 10,099 are all unbreakable because the next smallest product of two 3-digit numbers is 100 × 101 = 10,100. So, having 99 numbers is possible. Problem Set 12: Combinatorics I. Review 303

Session 12. Combinatorics I. Review Solutions to Warm-up Problems Warm-up 1 Solution. Let’s start rotating the first half-circle of radius R (the one that is on the right) counterclockwise around the marked point. Then the 180 degrees rotation would bring it on top of the second one. While rotating, this half-circle would sweep the entire Yang shape. Therefore, if it is rotated by 90 degrees, it would sweep exactly a half-shape.

Warm-up 2 Solution. - 10! = 10 × 9 ×···×2 × 1; n!=n × (n − 1) ×···×2 × 1. 10! 100! × ×···× n! × − - 9! =10; 95! = 100 99 96; (n−2)! = n (n 1). × × × × 10! × ×···× 100! - 10 9 8 7 6= 5! ; 100 99 45 = 44! . × − ×···× − × − n! n (n 1) (n 7) (n 8) = (n−9)! .

Solutions to In-Class Problems Problem 1 Solution. (a) The first button, button “2”, can be chosen in one way. The second, button “0”, can be chosen in 6 ways. For every choice of the “0” button, the next “6” button can be chosen in 3 ways. Answer: 1 × 6 × 3=18. (b) There are 18 ways to punch 206. After that, we should punch the 4th button—a button “6” that touches the last “6”. This can be done in 2 ways. Thus, the answer is 18 × 2=36. (c) There are 6 ways to punch “20”. Next, the “0” button can be chosen in2ways,andnextbutton“6”—in3ways.Answer:1 × 6 × 2 × 3=36. Problem 2 Solution. “Yellow hat + any clock + yellow shoes” can be selected in 3 × 3 × 2=18ways. “Red hat + any clock + red shoes” can be selected in 2 × 3 × 4=24ways. Answer: 18 + 24 = 42. Problem 3 Solution. (a) 4 × 4=16two-letter words; 4 × 4 × 4=64three-letter words. (b) Permutations: 4 × 3 × 2=24. (c) There is no choice of the last letter. So, the answer is 4×4×4×1=64. (d) The first letter can be chosen in 2 ways, the second—in 3, the third—in 2. The answer is 2 × 3 × 2 × 1=12. (e) Start working backward. The last letter can be chosen in 2 ways, the third—in 3, the second—in 2. The answer is 2 × 3 × 2 × 1=12. (f) There are 2 × 2=4ways to place the consonants on the sides and 2 × 2=4way to select the vowels for the center. The answer is 4 × 4=16. 304 Solutions

(g) Start by selecting the letter in the center: it can be done in 2 ways. After that, the first letter can be selected in 3 ways, the third letter—in 2 ways. The answer is 3 × 2 × 2=12. Problem 4 Solution. The colors of 12 balloons are predefined (4 red, 4 green, 4 blue). Thus, we are free to choose 4 balloons. - If all 4 are of the same color, we have 3 choices. - If all 4 are of 2 colors, we have 3 choices for each pair of colors, and we have 3 pairs. (Example: 1 red and 3 blue; 2 red and 2 blue; 3 red and 1 blue.) - If all 4 are of all 3 colors, we have 3 choices only. (Example: 2 red, 1 green, 1 blue.) Total: 3+3× 3+3=15.

Solutions to Take-Home Problems Problem 1 Solution. (a) We have 3 spots, the first can be filled in 3 ways, the second—in 2, the third—in 1. Answer: 3 × 2 × 1=6. (b) There are 6 ways to sit the girls in a row. For each way for the girls to be seated, there are 6 ways for the boys to be seated. Thus, the answer is 6 × 6. (c) Suppose that the spots for the boys and girls are allocated like this: G, B, G, B, G, B. Then the girls can be seated in 6 ways. For each way for the girls to sit, there are 6 ways for the boys to be seated. Thus, for this arrangement, there are 6 × 6 ways. Also, for the arrangement B, G, B, G, B, G there are 6 × 6 ways to sit. Thus, the answer is 6 × 6 × 2=72. (d) ForanarrangementG,G,G,P,P,B,B,Bthereare6 × 2 × 6=72 ways. (“P” stands for a parent.) For the same type of arrangement with boys on the left and girls on the right, there are as many ways. Also, for P, G, G, G, B, B, B, P there are 6 × 6+6× 6=72ways, and for P, B, B, B, G, G, G, P there are 72 ways. The answer is 72 × 4 = 288. Problem 2 Solution. Let’s start with the 1st wizard. He can choose a broomin40ways,thesecond—in39ways,..., the39thwizard—in2 ways, the 40th wizard—in 1 way. Thus, the answer is 40×39×38×···×2×1 = 40!. Problem 3 Solution. (a) A 5-digit palindromic number is defined by the first 3 digits. Answer: 9 × 10 × 10. (The first factor is 9 since the first digit cannot be 0.) (b) The first digit cannot be 0. There are 9 ways to choose the second digit since we cannot use the first digit but can use 0. There are 8 ways to choose the third digit since we cannot use the first and second. Answer: 9 × 9 × 8 = 648. (c) Since “2” is reserved for the last spot, we have 8 options for the first spot, 8 for the second (“0” is added), 7 for the third, and 6 for the fourth. Answer: 8 × 8 × 7 × 6=2,688. Problem Set 12: Combinatorics I. Review 305

(d) This is very similar to the previous question, except that the last digit can be either of 1 or 3 or 5 or 7 or 9. Thus the answer is 5 times bigger: 2,688 × 5=13,440.

Problem 4 Solution. A year ago, on the day when the third child was born, the total age of the two older children was 14 − 3=11.Therefore, at that time the total age of the parents was 70 − 11 = 59.Thenumber45 accounts for the total age of the parents when the first child was born. Thus, the total age of the parents grew by 59 − 45 = 14. So, the third child was born 7 years after the first one. At that time the second child was 11−7=4. Thus, the children are 8, 5, and 1.

Problem 5 Solution. For both (a) and (b) notice that once we have decided what happens to the diagonal squares, the rest of the covering is determined uniquely. Each diagonal square can have 4 different states, so the answers are (a) 16 and (b) 64. There are many alternative ways of counting the “right “ coverings.

Solutions to Additional Problems

Problem 1 Solution. 4×3×2. (The first “O” can be chosen in 4 way. The second “O” can always be chosen in 3 ways. “M” can be chosen in 2 ways.

Problem 2 Solution. (a) 25 × 24 = 600. (b) (25 × 24)/2 = 300.

Problem 3 Solution. Starting from B, we can choose O in 4 ways. For an “O” there are 2 ways to follow with the second “O”. Next, there are 3 ways to add “G”. Whichever way we choose “G”, there are 2 ways to add “I”, and 1 way to follow with “E”. Thus, the answer is 4 × 2 × 3 × 2 × 1=48.

Problem 4 Solution. (a) 3 × 6 × 5 × 4 = 360. (b) Start filling the slots from right to left: 4 × 6 × 5 × 4 = 480.

Problem 5 Solution. (a) Six slots, two types of robots for each: 2×2×2×2×2×2=26 =64. (b) Start by choosing a slot for the medical robot; follow by filling 5 slots: 6 × 2 × 2 × 2 × 2 × 2=6× 25 = 192. (c) There are twice as many as in the previous part, since the medical robot can be replaced by the supervisor: 2 × 180 = 360. 306 Solutions

Problem 6 Solution. (a) 38. (b) For every lowercase password, she can choose a letter to capitalize in 8 ways. Thus, there are 8 × 38 passwords. This is 8 timesasmanyasin (a). (c) She can choose a position for a digit in 9 ways; then she can choose a digit in 10 ways. Next, she can fill the leftover 8 slots with 3 options per slot, and after that, she can choose 1 letter to capitalize (8 options). The answer is 9 × 10 × 38 × 8.Thisis8 × 10 × 9 = 720 timesasmanyasin(a). Problem Set 13: Combinatorics II. Combinations 307

Session 13. Combinatorics II. Combinations Solutions to Warm-up Problems Warm-up 1 Solution. 99/9=11. Warm-up 2 Solution. Yes, it is possible. For example, suppose that the numbers are all equal to 0.01. (We take as many as needed to get to the sum of 10.) The square of such a number 0.0001, which is 100 times smaller than the number itself. Therefore, the sum of these squares is 100 times smaller than the sum of the numbers. 10/100 = 0.1. Warm-up 3 Solution. We can try to define 0! using the property of a factorial that n!=n × (n − 1)!.Then1! must be equal to 1 × 0!.Therefore, it follows that 0! = 1. An alternative way to define 0! is to interpret n! as the number of ways to arrange n objects. Then 0! must be equal to the number of ways to arrange 0 objects. We can do it 1 way. Thus, reasoning both ways we ended up with thesameresultof0! = 1.

Solutions to Take-Home Problems

−1 1 Problem 1 Solution. Yes, it is possible. For example, 2 and −2 . Problem 2 Solution. (a) 3 × 3 × 3 × 3=81. (b) There are 2 × 2 × 2 ways if the 2nd board is red, the same for the 4th, 6th, and 8th boards. Thus we have 4 × 2 × 2 × 2=32ways. (c) Because of symmetry the middle board should be red, and we should choose the color for boards 1 through 4 (the rest is determined according to the symmetry). Out of boards 1–4 we should have exactly 1 red board. Similarly to (b) above, the answer is 4 × 2 × 2 × 2=32. Problem 3 Solution. Solution 1. Choose M and no S. Then there are 18×17×16×···×12/7! ways to choose 7 girls for the leftover spots. Choose S and not M, Then there are 18 × 17 × 16 ×···×12/7! ways to choose 7 girls for the leftover spots. Choose M and S. Then there are 18 ×···×13/6! ways to choose the girls for the leftover spots. The answer is 2×18×17×···×12/7!+18×17×···×13/6! = 2 × C(18, 7) + C(18, 6). Solution 2. This is the total number of teams possible minus the number of teams with no 7th graders. The answer is 20 × 19 × ... × 13/8! − 18 × ....× 11/8! = C(20, 8) − C(18, 8) Problem 4 Solution. Any 3 points form a triangle. We can choose 3 points in 10 × 9 × 8/6 ways because there are 10 ways to choose the first point, 9 ways to choose the second and 8 ways to choose the third. Since each triangle was listed 3 × 2 × 1 times, we divide by 6. 308 Solutions

Problem 5 Solution. (a) 13!. (b) First, let’s find the number of ways to sit the 10 other girls; it is 10!. For each of these arrangements, we can choose a spot for the 3 girls in 11 different ways. For each way we choose the spot, we can arrange A, B, C in 3! ways. Therefore, the answer is 10! × 11 × 3! = 11! × 6. (c) Solution 1. First, let’s calculate the number of ways we can arrange the girls if M and D sit next to each other. That is 11! × 12 × 2 = 12! × 2. Next, we already know the total number of ways for 13 girls to sit in a row. Then the number of ways for M and D NOT to be next to each other equals the total number of ways for 13 girls minus the number of ways for M and Dtobenexttoeachother.Thatis13! − 12! × 2=(13− 2) × 12! = 11 × 12!. Solution 2. Let’s calculate the number of ways we can arrange 11 girls without M and D. That is 11!. Next, let’s find spots for M and D that are not next to each other. Prove that for any spot we choose for M, there will be 11 spots left for D. Indeed, suppose that M sits to the left of all the girls. Then there are 11 spots for D. The same is true if M sits to the right of all the girls or if M sits between the girls (not at the edge). Altogether, we can add M in 12 ways. After that, we always can add D in 11 ways. The answer is 11! × 12 × 11 = 12! × 11. Problem 6 Solution. Notice that each angle of this triangle is at least 60° because it contains an angle of an equilateral triangle inside it. But the sum of the angles of a triangle is 180°, so all three angles must be equal to 60° exactly. Then, the triangle is equilateral. Problem Set 14: Mathematical Auction 309

Session 14. Mathematical Auction Solutions to Warm-up Problem Warm-up 1 Solution. 12 − 9=3. 10 − 7=3. 11 − 10 = 1. 1 − 9+10=2.

Mathematical Auction A comment about the 16-dots problem: Remember to take into account squares with sides that are not grid-aligned.

Solutions to Take-Home Problems Problem 1 Solution. Let’s start with dividing both sides by A. We get AA + AA + 1 = 111. Therefore, AA + AA = 110,andAA =55.Thus, A =5. Problem 2 Solution. The answer is positive. One possible solution is to draw a very long and narrow rhombus with 1 diagonal equal to 1,000, and another diagonal equal to 1. Inside, place a rectangle with 1 side parallel to the longer diagonal. This rectangle should be long and narrow; it’s longer side should be around 900. For such a rectangle, the total length of the diagonals is at least 900 + 900 = 1,800, and the total length of the diagonals of the rhombus is 1,001.

Problem 3 Solution. Let t1 be the time spent by the first traveler, let t2 be the time spent by the second traveler, and let d be the distance between AandB. For the first traveler we have t1 =(d/2)/6+(d/2)/4, and, multiplying both parts by 24, 24t1 =2d +3d,sot1 =(5/24)d. For the second traveler, (t2/2) × 6+(t2/2) × 4=d,so5t2 = d and t2 =(1/5)d =(5/25)d. We can see that the first time is a tiny bit greater. Problem 4 Solution. No. Whatever the professor does, the leftmost number will always be smaller than its right neighbor. Problem 5 Solution. (a) Yes. An example is easily constructed. (b) No. Let’s color the little cubes black and white as on a 3D checker- board (adjacent cubes being of different colors). Without the center cube, there will be 12 cubes of 1 color and 14 of the other. On the other hand, a 1 × 1 × 2 brick always contains 1 black and 1 white cube. So, you can only construct shapes that have the same number of black and white cubes in them. 310 Solutions

Problem 6 Solution. Everyone, except for Baron Orange and the first victim, kills somebody once and then gets killed by someone. Therefore, we can place all the courtiers in a chain of killers, from Orange to the first guy. The titles in this chain change in the predefined pattern: baron, duke, count, baron,..., etc.,withevery3rdonebeinga count. Thusthe99thmember of the chain is a count, and the 100th member (the first victim) is a baron. Problem 7 Solution. Let’s suppose that it is not true. Then, for each x, there are no more than 100/x boxes containing at least x pearls. That allows us to come up with estimates on the total number of pearls, and even rough estimates are good enough. For example, there are less than 100 nonempty boxes and less than 10 of them contain at least 10. Also, no box has 100 pearls. Adding this up, we get that we have no more than 9 × 99 + 90 × 9 < 2,000 pearls, which is a contradiction. Problem Set 15: Combinatorics III. Complements. Snake Pit Game 311

Session 15. Combinatorics III. Complements. Snake Pit Game Solutions to Warm-up Problems Warm-up 1 Solution.

Warm-up 2 Solution.

Snake Pit, Snake 1 Problem 1 Solution. 35 = 243. Problem 2 Solution. 5 × 2 × 2 × 5 = 100. Problem 3 Solution. (2 × 3 × 2 × 3) + (3 × 2 × 3 × 2) = 2 × 36 = 72. Problem 4 Solution. 4 × (3 × 3 × 3) = 108. First, we make a word out of 3 vowels. Next, we insert RR—there are 4 ways to do it. Problem 5 Solution. 5 × 5 × 2=50. Problem 6 Solution. 3 × (3 × 3 × 2) = 54. The last 2 letters don’t affect the answer. Thus, we need to count 3-letter words that have 2 consonants and 1 vowel. Problem 7 Solution. 5 × 4 × 4 × 4 × 4. The first letter can be any of the 5; each next letter can be anything but the letter that precedes it. Problem 8 Solution. 5×5×5×5×5−4×4×4×4×4=3,125−1,024 = 2,101 (the number of all 5-letter words minus number of words without A).

Snake Pit, Snake 2 Problem 1 Solution. P (10, 3) = 10 × 9 × 8 = 720. Problem 2 Solution. C(10, 3) = 10 × 9 × 8/(3 × 2 × 1) = 720/6 = 120. Problem 3 Solution. We can choose the boys in C(5, 3) = 5 × 4 × 3/(3 × 2 × 1) = 10 ways and the girls in C(6, 2) = 6 × 5/2=15ways. Thus, the answer is 10 × 15 = 150. Problem 4 Solution. Girls: Use complements. The number of groups without both girls is the total number of groups of 4 girls minus the number 312 Solutions of groups of 4 girls with both Annie and Fannie included. This is C(6, 4) − C(4, 2) = 6 × 5 × 4 × 3/(4 × 3 × 2 × 1) − 4 × 3/2=15− 6=9. Here is an alternative way to count: for Annie and Fannie not to be in this group together, the group should contain either Annie only (C(4, 3) = 4 × 3 × 2/(3 × 2 × 1) = 4 ways) or Fannie only (4 ways) or neither of them (C(4, 4) = 1 way). 4+4+1=9. We can choose the boys in C(5, 2) = 5 × 4/(2 × 1) = 10 ways. Thus, the answer is 10 × 9=90. Problem 5 Solution. A pair of vertices to serve as a base for a triangle that points up: 5 × 4/2 = 10 ways. Thus, there are 10 × 5=50triangles that point up. The number of triangles that point is the same. Altogether there are 100 triangles. Problem 6 Solution. Let’s reformulate the problem: every arrangement of the kids in a circle corresponds to an arrangement in a row such that: - Abigail and Fiona are at the first two positions, and the rest of the kids stand to the right of them. Indeed, every row of kids like this, if closed into a loop, would correspond to exactly one way to place the kids in a circle. The number of such arrangements is 2 × (10 × 9 × 8 ×···×2 × 1) = 2 × 10!. Problem 7 Solution. We start with choosing 1 senior representative from each guild: this can be done in 2×5×3 ways.Wehave2spotsleftthatareto be filled with 1 baker, 4 goldsmiths, and 2 traders. There are no restrictions on whom to choose. Therefore, we need to pick 2 people from the group of 7. It can be done in 7 × 6/2 ways. The answer is 2 × 5 × 3 × 7 × 6/2 = 630. Problem 8 Solution. Choose 3 kids from 9 for the first team: 9 × 8 × 7/(3 × 2) = 84 ways. Out of the 6 kids that are left, choose 3 for the second team: 6×5×4/(3×2) = 20 ways. Altogether, there are 84×20 = 1,680 ways to choose the kids for the first two teams. Let’s observe that we have just 3 kids left; therefore, the third team is completely defined. Answer: 1,680.

Snake Pit, Snake 3 Problem 1 Solution. 95. Problem 2 Solution. All 5-digit numbers minus 5-digit numbers without zeroes: 9 × 104 − 95. Problem 3 Solution. 12 × 11 × 10 × 9/(4 × 3 × 2 × 1) = 450. Problem 4 Solution. All groups of 4 minus groups of 4 without those who know: 450 − 8 × 7 × 6 × 5/(4 × 3 × 2 × 1) = 450 − 70 = 380. Problem 5 Solution. If the dog is in the first or in the last car, there are 8 ways for the cat to choose a car. Otherwise, there are 7 ways for the cat to choose a car. Answer: 2 × 8+8× 7 = 16 + 56 = 72. Problem Set 15: Combinatorics III. Complements. Snake Pit Game 313

Problem 6 Solution. First, each pirate gets 1 coin; next, they have to share 3 coins. The options are: - One pirate gets all three coins (4 ways). - One pirate gets 2 coins, and one gets 1 coin (4 × 3 ways). - Three pirates get 1 coins each (4 ways). Answer: 4+12+4=20. Problem 7 Solution. Let’s start with positioning the black rook and follow with the white rook. A black rook can be placed in 64 ways; it always blocks one row and one column—15 squares total. Therefore, after the black rook is placed, there will be 64 − 15 = 49 positions possible for the white rook. Answer: 64 × 49. Problem 8 Solution. Let’s start with positioning the black king and follow with the white king. - If the black king is in a corner, it blocks 4 squares, and the white king has 64−4=60options. Since there are 4 corners, the number of placements is 4 × 60. - If the black king is on a side square that is not a corner square, the king blocks 6 squares, and the white king has 64 − 6=58options. Since there are 4 × 6=24squares like this, the number of such placements is 24 × 58. - If the black king is not on a side, then it blocks 9 squares, and the white king has 64 − 9=55options. Since there are 36 central squares, the number of placements is 36 × 55. Answer: 4 × 60 + 24 × 58 + 36 × 55.

Solutions to Take-Home Problems Problem 1 Solution. For the first master, there are 20 ways to choose a student, for the second one—19, for the third one—18. Thus, the answer is 20 × 19 × 18. Problem 2 Solution. Let’s use the complements principle: calculate this quantity as the difference between: - the number of ways to choose a group of 10 out of these 23 people - and the number of ways to choose a group of 10 out of these 23, with ALL counselors going (which is the same as choosing 7 kids out of 20). This will be C(23, 10) − C(20, 7). Problem 3 Solution. There are 9 ×10 ×10 ×10 ×10 ×10 6-digit numbers. Out of them, 56 are made of odd digits. Therefore, there are 9 × 105 − 56 numbers with at least 1 even digit. Problem 4 Solution. (a) There are 4 ways to secure spots for even numbers: EEOOO, OEEOO, OOEEO, OOOEE. For each of these arrangements, there are 2 ways to place the even numbers and 3! = 6 ways to place the odd numbers. Thus, the answer is 4 × 2 × 6=48. 314 Solutions

(b) Two solutions. First solution. Let’s observe that the numbers without even digits next to each other and the numbers with even digits next to each other altogether make an entire set of numbers that can be formed from the digits 1, 2, 3, 4, 5. There are 5! such numbers. Therefore, the answer is 5!−48 = 120−48 = 72. Second solution. The alternative solution would be to count arrange- ments: EOEOO, OEOEO, OOEOE, EOOEO, OEOOE, EOOOE. For each arrangement, there are 2 ways to place the even numbers and 3! easy to place the odd numbers: 6 × 2 × 3! = 72. Problem 5 Solution. In a blank square, let’s start adding lines one by one. Let’s prove that whenever we add a line and recolor, the number of black squares remains even. When we add the first line, everything is straightforward. This line splits the original square into two rectangles. One of these rectangles becomes black, another—white. At least one side of the newly minted black rectangle is even (it is equal to 1,000); therefore, its area is even. Suppose now that we have already added several lines and the total area of black rectangles is still even. Now, we are adding another line. Let’s prove that after we added it and recolored, the total black area remained even. Suppose that this line is a vertical line. We have just added this line; now, we need to adjust the colors. It works as follows: every region to the right of this line should be recolored: every little black 1 × 1 square should be colored white, and every little white 1 × 1 square should be colored black. Currently, the area of all the entire black region is even. Therefore, either the areas of the black regions to the right and to the left of the new line are both even or they are both odd. Moreover, the new line splits the big square into two rectangles of an even area. Therefore, if the black regions to the right and to the left of the line both have an even area, then the white regions are both even as well. Also, if they are both odd, then both white regions are odd as well. So, the white and black regions to the right of the line have areas of the same parity. Thus, when we recolor the white region black, we don’t change the parity of the entire black area. Problem 6 Solution. The red and blue segment obviously overlap. The part of the blue segment that is not red stretches from the rightmost midpoint of our segments to the right. Similarly, the part of the red segment that is not blue stretches from the leftmost midpoint to the left. The stretch between the leftmost and the rightmost midpoints is colored both blue and red. That means that, since the middle part is shared between both colors, the left half of the leftmost segment is 20 cm longer than the right half of the rightmost segment. Consequently, the leftmost segment is at least 40 cm longer than the rightmost. Problem Set 16: Combinatorics IV. Combinatorial Conundrum 315

Session 16. Combinatorics IV. Combinatorial Conundrum Solutions to Warm-up Problems Warm-up 1 Solution.

Warm-up 2 Solution.

Warm-up 3 Solution.

Solutions to Take-Home Problems Problem 1 Solution. (a) This is the standard combinations problem: choosing 4 from 10, order does not matter. Answer: C(10, 4) = 10×9×8×7/(4×3×2×1) = 210. (b) Think about this problem as follows: first, choose 4 planes from 10 for Tartaria mission. Next, choose 4 from 6 that are left for Rosalia. Two planes are left. These planes have to be sent to Santinia. Thus, the answer is C(10, 4) × C(6, 4) = 10 × 9 × 8 × 7/(4 × 3 × 2 × 1) × 6 × 5 × 4 × 3/(4 × 3 × 2 × 1) = 210 × 15 = 3,150. Problem 2 Solution. (a) This is another combinations problem. We need to choose 4 slots out of 10. It is, in fact, similar to the “Air Force” problem, part (a). The way to see the similarity is to set all 10 planes in a row and to mark the planes that are chosen for the Fingalia mission with the pictures of sapphires and to mark the rest of the planes with the pictures of rubies. This way, each 316 Solutions combination of 4 planes corresponds to a unique pattern of 4 sapphires and 6 rubies. Answer: 10 × 9 × 8 × 7/(4 × 3 × 2 × 1) = 210. (b) Let’s start by choosing locations for the 4 sapphires. There are 10 possible slots and, similarly to (a), C(10, 4) ways to choose 4 slots for the sapphires. C(10, 4) = 10 × 9 × 8 × 7/(4 × 3 × 2 × 1) = 210. Out of the 6 slots that are left, choose 4 for the rubies. This can be done in C(6, 4) = 6 × 5 × 4 × 3/(4 × 3 × 2 × 1) = 15 ways. Finally, the last 2 spots are left for the emeralds. The answer is C(10, 4) × C(6, 4) = 10 × 9 × 8 × 7/(4 × 3 × 2 × 1) × 6 × 5 × 4 × 3/(4 × 3 × 2 × 1) = 210 × 15 = 3,150. This problem is similar to the “Air Force” problem, part (b). (c) The reasoning is similar to (b). The answer is C(12, 4) × C(8, 3) × C(5, 4) × C(1, 1) = 695 × 56 × 5. It is fine to leave this answer as a formula. Problem 3 Solution. The total number of pieces of candy given is (4+2+1)× X =7× X,whereX is the number of problems. Also, this number is equal to 3 × 20 = 60.However,7 × X =60has no integer solutions. Problem 4 Solution. Suppose that R means moving one cell right, U— one cell up, B—one cell back. A path from point A to point B should be composed of four 4 R’s, 4 U’s, and 1 B. Thus, the problem can be reformulated as follows: “how many different patterns can be made from 4 R’s, 4 U’s, and 1 B?” The answer is C(9, 4) × C(5, 4) × C(1, 1) =9× 8 × 7 × 6/(4 × 3 × 2 × 1) × 5 × 4 × 3 × 2/(4 × 3 × 2 × 1) = 630. Problem 5 Solution. (a) Whenever a coin is tossed, 2 outputs are possible—H (heads) and T (tails). Therefore, the answer is 2 × 2 ×···×2=220. (b) Let’s imagine that whenever the rook lands on a square, it stamps a black mark on it. This way, a distinct way to hop from the first to the last square corresponds to a distinct pattern of marks. (The first and the last squares have to have marks.) Suppose that M stands for a marked square, N—for a square without a mark. Then the challenge is to count the number of distinct 20-letter patterns made of letters M and N, with the first and the last letters being M. Therefore, this problem is very similar to part (a), and the answer is 218. Problem 6 Solution. Prove that all cute numbers are X999...999 (where X is a single digit between 1 and 9). Indeed, if a number is different, we can always make it “cuter”, which means smaller, while preserving the same sum of digits. How can we do it? Problem Set 16: Combinatorics IV. Combinatorial Conundrum 317

First, we can rearrange the digits so that they would grow left to right. This new number would have the same sum of digits, and it will be smaller than (or equal to) the original. Next, suppose that we have two digits in this number next to each other, A and B, such that B is not 9 and A is not 0 and B is to the right of A. Then we can replace the digits A and B with the digits A − 1, B +1. The new number would be smaller. “Cutifying” a number this way, we will end up with X999...99.Thus, thecutenumbersare1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29,...,89, 99, 199, 299,...,999, 1,999, 2,999, 3,999,...,etc. Each new decimal position adds another 9 numbers. 200/9=22with remainder 2. Thus, the 200th cute number has 22 digits, and the first digit is 2: 2999...999.

Solutions to Additional Problems Problem 1 Solution. (a) There should be 5 “up” blocks and 8 “right” blocks. Thus, this is a problem about a pattern made up of 5 letter U’s and 8 letter R’s. This is the combinations problem C(13, 5) with answer 13 × 12 × 11 × 10 × 9/ (5 × 4 × 3 × 2 × 1). (b) The answer is equal to the number of ways to get from home to the Lucky Corner times the number of ways to get from the Lucky Corner to the Movie Theater: C(5, 2) ×C(8, 3) = 5 ×4 ×3/(2 ×1) ×8 ×7 ×6/(3 ×2 ×1) = 30 × 56. (c) That must be the total number of ways (which is C(13, 5))minus the number of ways to drive through the Unlucky Corner (which is C(9, 3) × C(4, 2)). Thus, the answer is C(13, 5) − C(9, 3) × C(4, 2). (d) The number of ways to get to the Lucky Corner times the difference between the number of ways to get from the Lucky Corner to the Theatre and the number of ways to get from the Lucky Corner to the Theater passing through the Unlucky Corner is C(5, 2) × (C(8, 3) − C(4, 1) × C(4, 2)). Problem 2 Solution. (a) Slot rule: Coin 1 has 3 options, coin 2 has 3 options, and so on. Thus, the answer is 37. (b) Here, the quantity matters. If 0 coins are in pocket 1, then there are 8 ways to split these 7 coins into two other pockets. If 1 coin is in pocket 1, then there are 7 ways to split these 6 coins into two other pockets. .... If 7 coins are in pocket 1, then there is 1 way to split 0 coins into two other pockets. The answer is 1+2+···+7+8=36. 318 Solutions

Session 17. Magic Squares and Related Problems Solution to Warm-up Problem Warm-up 1 Solution. There are 2 numbers that have the sum of the digits equal to 2: the numbers 11 and 2. There are 4 numbers that have sum 3: 111, 21, 12, and 3. There are 8 numbers that have sum 4: 1111, 211, 121, 112 , 22, 13, 31, and 4. At this moment, we can make a hypothesis: all the answers are powers of 2. This hypothesis is surprisingly easy to justify if we think about this problem in the right way. Let’s explore the numbers with the sum 4. If we start from the sequence of 4 1’s separated by commas (1, 1, 1, 1), we can get the rest of the numbers by replacing some of the commas by pluses. For example, (1, 1+1, 1) makes the number 121. And (1+1+1, 1) makes the number 31. Thus, by listing all possible sequences of commas and pluses of length 3, we can list all numbers with sum 4. The number of such sequences is easy to calculate by applying a simple slot rule: it is 23. Similarly, for the sum of digits equal to 6, the answer is 25 =32. And for the sum of digits equal to k,theansweris2k.

Solutions to Take-Home Problems Problem 1 Solution. Not possible. The first prime number is 2; it is even. The rest are all odd. Thus, the parity of the total in the row with “2” will be different from the parity in a row without “2”. Problem 2 Solution. The sum of the totals of the central row and the central column is equal to twice the magic constant. The sum of the totals on the two diagonals is equal to twice the magic constant as well. This first sum is equal to the sum of the four side cells and of two copies of the central cell. This second sum is equal to the sum of the four corner cells and of two copies of the central cell. Therefore, the total in the four corners is equal to the total of the four numbers on the sides. + +

Problem 3 Solution. (a) The gray squares are the union of the two diagonals. Therefore, the sum of the numbers on the gray squares is equal to the sum of the numbers Problem Set 17: Magic Squares and Related Problems 319 on two diagonals. (These two diagonals are clearly marked in the first picture below.) Therefore, this total is twice the magic constant. (b) Take another look at the picture on the left: the sum of the numbers in all the white squares (checkmarked) must be equal to twice the magic constant as well. Indeed, these white squares complement the gray squares. From part (a) we know that the sum of all the gray squares is twice the magic constant. Also, the total in the entire table is 4 times the constant. Take a look at the picture on the right. The sum of the two central rows and the two central columns is 4 times the constant. However, the total sum of the eight checkmarked squares (see the first picture below) is twice the constant. Therefore, the double total of the 4 central squares is twice the constant as well.

a) b)

Problem 4 Solution. A set of skills is described by a sequence of three words, each being “pass” or “fail”. For example, “pass, fail, pass” corresponds to the ability to cook, failure to write poems, and ability to fight. There are 8 such sequences and 10 princesses. If we designate the sets of skills to be pigeonholes and princesses to be pigeons, then we can apply the Pigeonhole Principle: there will be at least 2 princesses having the same set of skills.

Problem 5 Solution. (a) The minute hand rotates 6 degrees per minute, and an hour hand is 12 times slower. Therefore, it rotates 0.5 degrees per minute. (b) In one minute, the difference grows by 5.5 degrees. Therefore, in 5 minutes it is 5.5 × 5=27.5 degrees. (c) We are looking for the difference 180. It’ll be in 180/5.5=1,800/55 = 360/11 minutes, that is, 32 and 8/11 minutes. (d) To get an angle of 360 degrees we need to double the time required for 180: 64 and 16/11 minutes. This is 1 hour plus 5 and 5/11 minutes.

Problem 6 Solution. Prove that each knight ate an even number of raisins. Indeed, choose the knight who ate the smallest number of raisins. (If there are a few of them, choose one.) His neighbor on the left ate either 10 less or twice more. Since the knight we chose ate the smallest number of raisins, then the neighbor on the left ate twice as many. Therefore, the neighbor on the left ate an even number of raisins. His neighbor on the left ate an even number of raisins as well. Making the full circle, we’ll end us with the first knight, who must have eaten an even number of raisins as well. Therefore, the total number of raisins must be an even number. 320 Solutions

Problem 7 Solution. We can start from calculating the magic constant: it is (1 + ···+ 16)/4=34. Thus, the missing number in the second row from the top is 34 − 15 − 5 − 4=10. Next, according to the previous problem, the sum of the values of the 4 central squares must be equal to 34. So, the missing number in the 2 × 2 central square is 34 − 15 − 10 − 8=1. Next, we can restore the upper right corner: 34 − 10 − 1 − 7=16. (See the table below on the left.) Let’s denote the number in the upper left corner by x. Then the missing numbers in the bottom right corner is 11 − x. 16 x 16 4 15 10 5 4 15 10 5 1 8 1 8 7 7 11 − x Now, we have a few choices for the (x, 11 − x) pair: 1 and 10, 2 and 9, 3 and 8, 4 and 7, 5 and 6. The pairs (8, 3), (7, 4), and (6, 5) are to be discarded since the table already contains 8, 4, and 5. Therefore, the corner numbers are 2 and 9. Moreover, if we write 2 into the top left corner cell, then the leftover number in the first column must be 34 − (2+4+7)=23, which is way too big. Thus, 9 must belong to the top left cell. 9 16 4 15 10 5 14 1 8 11 7 2 The sum of the bottom two unknown numbers must be equal to 25. So, these are either 12 and 13, or 11 and 14, or 10 and 15, or 9 and 16. Since the table already contains 11, 10, and 2, we should go with 12 and 13. If the bottom number in the second column is 13, the top number should be 5. However, the table already contains 5. Therefore, the answer is 9 6 3 16 4 15 10 5 14 1 8 11 7 12 13 2 Problem Set 18: Double Counting, or There Is More than One Way . . . 321

Session 18. Double Counting, or There Is More than One Way to Cut a Cake Solutions to Warm-up Problems Warm-up 1 Solution. Split the coins into 3 groups of 7. Compare group 1 and group 2. If they are of the same weight, the fake coin is going to be in the third group. Otherwise, it is in the lighter group. Split the suspicious group of 7 coins into 3, 3, and 1. Compare 2 groups of 3. If one is lighter, the coin is in it. If both groups are of the same weight, the last coin is fake. From the 3 suspicious coins, choose any 2 and compare them. If they weigh the same, the third one is fake. Otherwise, the lighter is fake. Warm-up 2 Solution. Separate the coins into 2 groups, 12 and 18. (If the first group has x heads-up coins, the second one has to have 12 − x heads-up coins.) Then, if you turn over all the coins in the first group, you would get 12 − x heads-up coins in it as well.

Solutions to Take-Home Problems Problem 1 Solution. Choose a 6 × 6 section of the cake. It is possible to cutitinto92 × 2 squares. It follows that the total number of roses must be 9 × 2=18. It is also possible to cut this section into 12 3 × 1 pieces. It follows that the total number of roses must be 12 × 1=22. Contradiction. Problem 2 Solution. Calculate the total number of tassels in two ways. First, it is the number of hats times 6, which is an even number. Second, it is 25 × 3=75, which is odd. Contradiction. Problem 3 Solution. (a) 2 6 4 5 1 3 7

(b) Add the 3 sums along the lines. We get 3 × 12 = 36. Also, we get the sum of all 7 numbers, which is 28, plus 2 extra copies of the number in the center. Thus, 36 = 28 + 2x.Thus,x =4. (c) Suppose that the sum is different. Call it Y . The sum of the numbers on 2 circles is less than the total sum of numbers because we do not count the number in the center. Therefore, 2 × Y<28.Thus,Y ≤ 13.The sum of the numbers on all 3 lines is greater than the total sum of numbers because the center is counted 3 times. Therefore, 3×Y>28.Thus,Y ≥ 10. Also, 3 × Y − 28 is equal to twice the number in the center, which is even; 322 Solutions so, Y must be even. If Y were 10, then the number in the center would be (3 × 10 − 28)/2=1. However, the number is the center must be even as well. Indeed, the total sum of all the numbers, 28, is equal to the sum of the numbers on 2 circles and the number in the center. Thus, Y must be 12.

Problem 4 Solution. Let’s prove that the total number of conductors and inspectors (fake and not fake together) should be a factor of 5 and a factor of 8 at the same time. First, since the number of fakers is 4 times smaller than the number of real conductors and inspectors, then the total number of all kinds of conductors and inspectors together is a multiple of 5. Second, since the number of conductors is 7 times smaller than the number of inspectors, then altogether the number of conductors and inspectors is a multiple of 8. Since 40 is the only number that is a factor of both 5 and 8 and that is smaller than 60, there are therefore 60 − 40 = 20 passengers.

Problem 5 Solution. First, we can observe that there were no more than 3 films picked. Otherwise, we would have 4 judges voting for 4 different films. Now, we have 10 judges and no more than 3 top picks. If each top pick were voted by not more than 3 judges, we would end up with not more 9 votes. Contradiction.

Problem 6 Solution. Let’s concentrate on black squares and black diag- onals only. A chessboard has 15 black diagonals altogether—7 sloping up from left to right and 8 sloping down. One can count the number of pieces on these 15 black diagonals as the number on the first diagonal + the number on the second diagonal + ···+ the number on the last diagonal. If each of these numbers is odd, this total sum is odd. On the other hand, this sum is equal to twice the number of pieces on the black squares since each piece was counted exactly twice. This is a contradiction.

Solutions to Additional Problems

Problem 1 Solution. (a) Since each round was played by 2 students, the total number of rounds is 10 × 3/2=15. (b) Suppose that Lorenzo played x rounds with Isabella and y with Francesca. Then Isabella played 10−x rounds with Francesca, and Francesca played 10 − y rounds with Isabella. This can be possible only when x = y.

Problem 2 Solution. If each toddler takes home 3 toys of the same kind, then the total numbers of toys of every kind should be a multiple of 3. However, it is 13. Contradiction.

Problem 3 Solution. Counting daggers row by row we get that this num- ber is greater than 6 × 50 = 300. Counting the same quantity column by column, we get that it must be less than 6 × 50 = 300. Problem Set 18: Double Counting, or There Is More than One Way . . . 323

Problem 4 Solution. (a) Split the pigs into two groups: P1, P2, P3, P4 and P5, P6, P7, P8. Each group weighs at least 1,000 pounds. (b) We have pigs P1, P2, P3, P4, P5, P6. We know that P1+P2+P3+P4 > 1,000, P3+P4+P5+P6 > 1,000, P5+P6+P1+P2 > 1,000. Adding these three inequalities together, we get 2 × (P1+P2+P3+P4+P5+P6) > 1,000 × 3. Problem 5 Solution. Suppose that X is the number of orcs and Y is the number of goblins. Then the number of orc-goblin quarrels is equal to X × 10, and the number of goblin-orc quarrels is equal to Y × 9. Since these two numbers are equal, X × 10 = Y × 9. Therefore, X

Problem 9 Solution. If we found 2 candidates such that 1 is 10 ahead of the other, their endorsement totals would have to end in the same digit. Suppose that all endorsement totals end with different digits. Let’s count the total number of endorsements in 2 ways: candidate by candidate and day by day. The first sum should end with the same digit as the sum of all the numbers from 0 to 9, which is 5. However, the day-by-day sum is equal to (1 + ···+ 10) × 2. It ends with 0. This contradiction completes the proof.

Problem 10 Solution. Suppose that we can do it. Then the total sum over all 6 segments must be a multiple of 6: 6 × Y . This total sum is composed of 3 copies of the “vertex” numbers (the numbers at the endpoints of the segments) and 1 copy of the “central” numbers. This is the same as the sum over all circles plus double the “vertices” sum. The total over all circles is 0+1+2+···+9=45. Therefore, 45 + 2 × (total over 4 vertices)=6× Y . However, the sum of an odd and an even must be odd.

Problem 11 Solution. Denote numbers by X1, X2, ..., X7. First, let’s prove that the sum of all 7 numbers is a multiple of 5. We know that X1+X2+X3+X4+X5+X6 is a multiple of 5 and X2+X3+X4+X5+X6+X7 is a multiple of 5 and X3+X4+X5+X6+ X7+X1 is a multiple of 5 and so on until X7+X1+X2+X3+X4+X5. Therefore, the total sum of these 7 expressions must be a multiple of 5. Each number belongs to 6 of these expressions. Therefore, the total is equal to 6 × (X1+X2+···+ X7). For this product to be a multiple of 5, the sum of the 7 numbers must be a multiple of 5. Now, we know that the sum of 7 numbers is a multiple of 5 and the sum of any 6 is a multiple of 5. Therefore, each of these numbers must be a multiple of 5. Problem Set 18: Double Counting, or There Is More than One Way . . . 325

Problem 12 Solution. For every grid line, let’s calculate the number of dominoes this grid line cuts through. Next, let’s calculate the sum of these numbers. Since exactly 1 grid line goes through every domino piece, this sum is equal to the total number of dominoes in the rectangle. Thus, the total number of dominoes is a multiple of 4. Since the area of each domino piece is 2, the total area of the rectangle is a multiple of 8. Therefore, at least 1 side of the rectangle must be a multiple of 4. Problem 13 Solution. Let’s split this table into two: 1 2 3 4 0 0 0 0 1 2 3 4 4 4 4 4 1 2 3 4 8 8 8 8 1 2 3 4 12 12 12 12 Since these two tables add up to the original one, then we can calculate the sum over each table separately and add these two sums together. The sum of all the numbers in the first table is 0 since each column has 2 pluses and 2 minuses. The sum of all the numbers in the second table is 0 since each row has 2 pluses and 2 minuses. Problem 14 Solution. Take two gentlemen, A and B. Call the club that they belong to Club X. If all others belong to Club X, the problem is solved. If not, there must be a gentleman, call him C, who does not belong to Club X. Still, he has to be at the same club with A. So, he has to belong to some club, call it Y, that he shares with A (see the first picture below). Let’s prove that every other gentleman should belong to X, to Y, or to both. Suppose that there exists a gentleman who does not belong to X and Y. Then he cannot share a club with A because A already belongs to 2 clubs—X and Y. Next, since B and C do not belong to the common part of X and Y, there must be some club (call it Z) that they both belong to. We will prove that all the gentlemen who do not belong to both X and Y must belong to Z. Indeed, suppose that a gentleman, call him D, belongs to X but not to Y. Then, to be in the same club with C, he must belong to Z. Now, all the gentlemen are split into 3 sets—those who are in X and Y, in Y and Z, in X and Z. Remove the smallest set, which must be not greater than 9. Then the total of the 2 sets that are left is at least 18.

Club X Club X A A B B

Club Y C Club Y C Club Z 326 Solutions

Session 19. Mathematical Olympiad II Solutions to the First Set of Problems

Problem 1 Solution. It takes Mob as much time to get from the midpoint down to the bottom as it takes Bob to walk all the way. Since Mob also spent some time skiing, she will arrive late.

Problem 2 Solution. Each person who approached the rack changed the number of hats either from odd to even or from even to odd. In the beginning, the number of hats was even; it changed an odd number of times and became odd. So, it cannot be 10 since 10 is an even number.

Problem 3 Solution. (a) A flower that opens on day 1 becomes white on day 3. Therefore we know that 3 days ago 14 flowers opened and 2 days ago 11 flowers opened. That gives us 11 + 14 = 25 yellow flowers the day before yesterday. (b) A flower that turns white tomorrow had to be yellow yesterday. Out of 20 yellow flowers yesterday, 11 became white today. The rest will be white tomorrow, which gives us 9 white flowers. (Of course, this problem can be solved with equations.)

Problem 4 Solution. Suppose the sum at each vertex is X.Then6 × X is double the total sum of all numbers (each number is counted for 2 vertices). 6 × X =21. This is a contradiction since 21 is odd.

Problem 5 Solution. Each of the 3rd, 4th, and 5th segments are to in- tersect all remaining 5 segments. Therefore, the 1st segment intersects with the 3rd, 4th, and 5th only. Thus, the 2nd segment intersects the 3rd, 4th, 5th, and 6th. Thus, the 6th must intersect the 3rd, 4th, 5th, and 2nd.

Problem 6 Solution. Suppose that the first participant ate x hot dogs and that altogether the participants ate T hot dogs on the second day. Then all others except the first one ate x on the second day, and the first ate T − x. Then in two days, the first ate x +(T − x)=T hot dogs. The same is true for any other participants.

Solutions to the Second Set of Problems

Problem 7 Solution. Choose any 10 kids; 5 of them must be of the same age. Assign them numbers 1, 2, 3, 4, 5. From the 50 kids that are left, choose any 10; 5 of them must be of the same age. Assign them numbers 6, 7, 8, 9, 10, and so on.... We will end up with 10 groups of kids of the same age, 5 kidseach. (Thegroups are(1, 2, 3, 4, 5), (6, 7, 8, 9, 10), ..., (46, 47, 48, 49, 50).) Choose 1 child from each group. Out of these 10 group representatives, at least 5 are of the same age. Thus, at least 5 groups are composed of kids of the same age. Problem Set 19: Mathematical Olympiad II 327

Problem 8 Solution. If 1 thaler goes to the first charity, then 99 should be split between the 2 others. This can be done in 98 ways. If 2 thalers go to the first charity, then 98 should be distributed between the other 2. This can be done in 97 ways, and so on. The answer is 98+97+···+2+1 = 98∗99/2. Problem 9 Solution. Let’s number all columns and all rows with the numbers 1–8. Now consider 4 types of squares: Odd-Odd, Odd-Even, Even- Odd, and Even-Even. Denote by OO, OE, EO, and EE the total numbers of rooks on Odd-Odd, Odd-Even, Even-Odd, and Even-Even squares. Now notice that OO + OE = 4 (4 rooks on odd columns) and OE + EE = 4 (4 rooks on even rows). That means that OO = EE, so OO + EE is even. Problem 10 Solution. Let’s take 100 out so that the box would contain the same number of balls of each color. Then, add 100 balls of each color. Note that the number of balls of each color could only have increased. Also, note that altogether we have added 900 balls. (We have removed 100 and have added 1,000.)

Solutions to Additional Problems Problem 11 Solution. Let’s look at two sums of numbers opposite to each other. One sum is equal to 4 and another is 6. By adding 1 to two consecutive numbers we always increase both sums by 1, so they will never be equal. Therefore we cannot make all numbers equal. Problem 12 Solution. Let’s take 2 people who know each other. There is a 3rd person that knows them both. Let’s add him/her to the group. There is someone who knows all 3. Add him/her, and so forth until you get to 6 people who all know each other. Among these 6 there is 1 who knows the other 5. That will be the person who knows everybody. Problem 13 Solution. Two solutions: numerical and visual. Numerical: Let M be the number of white rabbits that came before 7, and let N be the number of white rabbits that came after 8. When the gray rabbits come an hour later, M white rabbits wait for an hour longer, and N gray rabbits have to wait 1 hour less. The total time changes by N − M. But N is not equal to M because the total number of white rabbits is odd. Visual: We can start by drawing a diagram (see below). The times when gray rabbits arrive (7 and 8) are marked with dark-colored dots, white rabbits—light-colored dots. Suppose that all the gray rabbits arrived at 7 PM. Let’s mark the waiting time as light-gray arches about the timeline. The arches on the left mark the time that the white rabbits who came before 7 had waited, and the arches on the right indicate the time the gray rabbits had waited for those white rabbits who came after 8. Suppose now that all the gray rabbits arrived at 8 PM. Let’s mark the waiting time as black arches below the timeline. The arches on the left mark 328 Solutions the time that the white rabbits who came before 7 had waited, and the arches on the right indicate the time the gray rabbits had waited for those white rabbits who came after 8. Therefore, if all the gray rabbits arrive at 7 PM, the total waiting time would be the sum of all intervals above. If all the gray rabbits arrive at 8 PM, the total waiting time would be the sum of all intervals below. Thus, our goal is to prove that the total sum of intervals above cannot be equal to the total sum of intervals below. Let’s notice that to the left of the dotted vertical line (total waiting time before 7) there is a perfect match of the lengths of segments above and below, and to the right of the dotted vertical line (after 8) there is a perfect match of the lengths of segments above and below. Thus, the total difference is equal to the difference of lengths of gray and black segments between 7 and 8. Each such segment is 1 hour long. However, since the number of white rabbits is odd, the number of segments “above” is not equal to the number of segments “below”. Thus, the difference cannot be 0.

7 time 8 Problem Set 20: Divisibility I. Review 329

Session 20. Divisibility I. Review Solution to Warm-up Problem Warm-up Solution. mom->mum->mud->mad->dad fall -> tall -> toll -> told -> cold sty -> say-> bay-> bag -> big -> pig five -> fire ->firm ->form -> foam -> foal -> foul -> four

Solutions to Prime Factorization Practice. Set 1 Problem 1 Solution. 11 × 7 × 2 = 154. Problem 2 Solution. 2 × 2 × 3=12. Problem 3 Solution. 2 × 2 × 3 × 7=84. Problem 4 Solution. 2 × 7 × 3=42. Problem 5 Solution. 2 × 3 × 3 × 2=36. Problem 6 Solution. 3 × 5 × 3 × 5 = 225. Problem 7 Solution. 3 × 5 × 2 × 5 × 2 = 300. Problem 8 Solution. The number 25 is divisible by 1, 5, 25. Problem 9 Solution. The number 16 is divisible by 1, 2, 4, 8, 16. Problem 10 Solution. The number 105 = 3 × 5 × 7 is divisible by 1, 3, 5, 7, 3 × 5, 3 × 7, 7 × 5, 3 × 5 × 7.

Solutions to Prime Factorization Practice. Set 2 Problem 1 Solution. Divisible by 2, 14, 98. Not divisible by 4, 12. Problem 2 Solution. (a) No. (b) Divisible by 8, 36, 27, 56. Not divisible by 16. Problem 3 Solution. Yes, it has prime factors 2 and 3. Problem 4 Solution. Yes, 5 × A has prime factor 3. Thus, A has to have it. Problem 5 Solution. Yes, one of the terms has to have prime factor 7. Problem 6 Solution. Not necessary, as the example 3 × 5 shows. Problem 7 Solution. Yes, since A has to be divisible by 11. Problem 8 Solution. Not necessary, as the example A2 =36shows. 330 Solutions

Solutions to Take-Home Problems Problem 1 Solution. No, since the number is even. Problem 2 Solution. 990 = 10 × 99 = 2 × 5 × 9 × 11 = 2 × 3 × 3 × 5 × 11. To be divisible by 990, N! must contain all these prime factors. However, if N is less than 11, N! does not have factor 11. Therefore, it is not divisible by 990. If N =11,thenN! contains the entire collection of prime factors of 990. Problem 3 Solution. Let’s count the number of prime factors 2 in 100!. Each of the numbers 2, 4, ..., 100 is divisible by 2. This gives us 50 factors. Each of the numbers 4, 6, ..., 100 is divisible by 22. This gives us 25 more factors of 2. Each of the numbers 8, 16, ..., 96 is divisible by 23.Thisgives us 12 more factors. Each of the numbers 16, 32, ... , 96 is divisible by 24. This gives us 6 more factors. Each of the numbers 32, 64, 96 is divisible by 25. This gives us 3 more factors. The number 64 is divisible by 26.Thisis 1 more factor 2. The total is 50+25+12+6+3+1=97.Thus,100! is not divisible by 2100. Problem 4 Solution. Rewrite as HE × HE − HE = S × 100. Then HE × (HE − 1) = S × 2 × 2 × 5 × 5. Thus, prime factors 2, 2, 5, 5 should be distributed among the numbers HE and HE − 1. Since these two numbers differ by 1, they cannot both be multiples of 2 or 5. Therefore, one number must contain 2×2,another—5×5. This second number must be odd. So, we are looking for two 2-digit numbers that are 1 apart from each other. These two numbers must be a multiple of 4 and a multiple 25, and the multiple of 25 must be odd. Thus, one of these numbers has to be either 25 or 75. If we choose 75, the other number must be 76 or 74. In this case, the product of these two numbers would be too big. If we choose 25, the other number must be 24 or 26. Since 25 × 24 = 600 and 25 × 26 = 650, we choose 24. Answer: 25 × 25 = 625. Problem 5 Solution. Suppose this can be done. Starting from the smallest number, let’s step clockwise from number to number. Each new number is equal to the previous number multiplied or divided by a prime number. Thus, the prime factorization of each new number contains 1 more or 1 less prime factors than that of the previous number. To get back to the original number, the number of prime factors added must be equal to the number of prime factors removed. However, there are 99 operations altogether. Since 99 is odd, the numbers of added and removed prime factors cannot be equal. Contradiction. Problem 6 Solution. Notice that the number of rooks on A plus the number of rooks on B is equal to 4 since there has to be exactly 1 rook in each of the first 4 rows. Similarly, the number of rooks on B plus the number of rooks on D is equal to 4 since there is 1 rook in each of the last 4 columns. Thus we have A + B =4=B + D and A = D. Problem Set 20: Divisibility I. Review 331

Solutions to Additional Problems Problem 1 Solution. Suppose the numbers are A and B. We know that 1,000 = 23 ×53. Therefore, these prime factors have to be distributed among A and B. If 2 and 5 belonged to the same number, this number would end with 0. Therefore, A =23 and B =53. Problem 2 Solution. Key idea: 1,000 is divisible by 8. Therefore, any number that ends with 3 zeroes is divisible by 8. Problem 3 Solution. No, if we use n =41, we get a composite number. Problem 4 Solution. A digit at the 1’s position of a perfect square could beoneofthese:0,1,4,5,6,9.Thisis6numberstotal.Therefore,according to the Pigeonhole Principle, there will be 2 numbers that end with the same digit. Problem 5 Solution. The last digit must be odd and not 5. Therefore, it mustbeequalto1,3,7,or9.Ifitis3or9,thenthesumofthedigitsofthe 3-digit number is either 6 or 18. Such a number is divisible by 3. Therefore, the last digit could be 1 or 7. The examples are 101 and 347. Problem 6. Proof by contradiction. Suppose that n+1 is not prime. Then it has a factor, the number k, that is greater than 1 and less than n +1. This number k is one of the terms in n!.Therefore,n! is divisible by k.So, n!+1 is not divisible by k. So, it is not divisible by n +1 either. Impossible. 332 Solutions

Session 21. Divisibility II. Relatively Prime Numbers; GCF and LCM Solutions to GCF and LCM In-Class Practice Problems

Problem 1 Solution. (a) The smallest common factor is 1. The greatest common factor is 2 × 52 × 11. (b) The least common multiple is 24 × 32 × 54 × 7 × 11 × 13.

Problem 2 Solution. The answer is the greatest common factor of 2, 3, 4, and 7. This number is 4 × 3 × 7=82. Thus, he should visit in 82 days.

Problem 3 Solution. (a) The prime factors of the product 23×52 should be distributed among the two numbers. Since the two numbers are relatively prime, the entire set of prime factors 2 should belong to one of the numbers. The same is true with 5. Thus, the two answers are: 23 and 52;1and23 × 52. (b) The factors of 28 × 35 should be distributed among x and y. Since the common factor is 6, each number should contain at least one copy of 2 and of 3. However, if both numbers contained more than one factor 2; the common factor would be at least 2 × 2 × 3. Therefore, one number must contain one factor 2; the other number must contain 27. Similarly, one number must contain 3; the other must contain 34. Thus, the answers are: 2 × 3 and 27 × 34; 27 × 3 and 2 × 34 ; 2 × 34 and 27 × 3.

Problem 4 Solution. (a) Emma is not right. For example, 36 is divisible by 6 and 4, but not by 24. However, since 8 and 3 are relatively prime, divisibility by 24 follows from divisibility by 8 and by 3. (b) Milo is not right. For example, 30 is divisible by 2, 3, and 10, but not by 60. However, since 3, 4, and 5 are all relatively prime, divisibility by 60 follows from divisibility by 3, by 4, and by 5. (c) Since 180 = 9 × 4 × 5 and since 9, 4, and 5 are all relatively prime, divisibility by 180 follows from divisibility by 9, by 4, and by 5.

Problem 5 Solution. (a) Example: 12 and 36. (b) If the GCF of two numbers is 24, then each must be a multiple of 24. So, their difference must be a multiple of 24 as well. Thus, it cannot be 12. (c) If the GCF of two numbers is 7, then each must be a multiple of 7. So, their difference must be a multiple of 7 as well. Thus, it cannot be 24.

Problem 6 Solution. (a) Both 93 and 102 are multiples of a price of a cookie. 93 = 3 × 31 and 102 = 3 × 34 = 3 × 2 × 17. So, a cookie could cost 1 or 3 copper coins. Problem Set 21: Divisibility II. Relatively Prime Numbers; GCF and LCM 333

(b) Both totals should be divisible by the price of a barrel. However, since they differ by 1, their greatest common factor is 1. So, the price of a barrel is 1. (c) Both totals should be divisible by the price of a single hat. Therefore, the difference of these totals, which is 6, must be divisible by this price as well. So, the price could be 1, 2, 3, or 6 silver coins. Examples; 61 and 67, 62 and 68, 63 and 69, 66 and 72. Problem 7 Solution. Each number must be a multiple of 150. Thus, the smallest such number is 150; so, the smallest possible product is 150 × 150. There is no greatest possible product. By setting the numbers A and B to products of 150 and two different big primes, A = P1 ×150 and B = P2 ×150, we can set the product to be as big as necessary. Problem 8 Solution. A = C×x, B = C×y. Therefore, A−B = C×(x−y).

Solutions to Take-Home Problems Problem 1 Solution. Suppose the price of a firecracker is k.Bothofthe amounts that Rina and Simon paid must be divisible by k.Thus,their difference, which is 12 shmollars, must be divisible by k as well. So, the possible values for k are 1, 2, 3, 4, 6, 12. However, Rina paid an odd number of shmollars. So, she couldn’t have paid a multiple of 2, 4, 6, or 12. Thus, the price of a firecracker must be 1 or 3 shmollars. Both answers are possible, as the examples (5, 17) and (3, 15) illustrate. Problem 2 Solution. Suppose that h is the number of horses and c is the number of cows. h = c/2+10 and c = h +20. Substituting, we get c = c/2+10+20. This means that c is 60 and h is 40. Problem 3 Solution. (a) Measure four 40-degree angles next to each other. (b) Measure a 160-degree angle and extend one of its sides to form a 180-degree angle. Their difference is a 20-degree angle. Problem 4 Solution. (a) This number is a multiple of 3, 4, and 5. Since 3, 4, and 5 are relatively prime, this number must be a multiple of their product 3×4×5= 60. The only such number that is less than 100 is 60. (b) Suppose that we add 1 coin to the stash. Then we get a number that is divisible by 4, 5, 6, and 7. The smallest such number is 2 × 2 × 3 × 5 × 7= 420. Thus, the king has 419 coins. Problem 5 Solution. To be divisible by 38n, a number must be divisible by 2n and by 19n. Since there are at least 9 even numbers between any 2 consecutive multiples of 19, a factorial that is divisible by 19n will be divisible by 2n. Thus, we are looking for the smallest n such that 1,000! is not divisible by 19n. 334 Solutions

There are 52 multiples of 19 that are smaller than 1,000; out of them 2 are multiples of 192.Thus,1,000! contains 52 + 2 = 54 prime factors 19. Therefore, n =55. Problem 6 Solution. 3*5 2*3 3*5 2*3 3*5 2*3 5*7 2*3*5*7* 2*3*5*7 11*13

2*7 5*7 2*7 5*7 11*13 7*11

Problem 7 Solution. (a) Suppose that we have a number smaller than p. Then, since p is prime,itcannotshareanycommonfactorwithit. Therefore,2,3,..., p − 1 are all relatively prime to p.Thisisp − 2 numbers altogether. (b) The only numbers less than p2 that are not relatively prime to p2 are 1 × p, 2 × p, 3 × p,..., (p − 1) × p. Therefore, to get all relatively prime numbers, we are to exclude this set from the list 2, 3,...,p2 −1.Thatmakes p2 − 2 − (p − 1) = p2 − 2 − p +1=p2 − p − 1 numbers altogether.

Solutions to Additional Problems Problem 1 Solution. (a) These numbers differ by 1. Therefore, the only common factor that they share is 1. (b) These numbers differ by 4. Therefore, all their possible common factors must be multiples of 4: the numbers 1, 2, and 4. However, since both numbers are odd, they are not divisible by 2 or by 4. Answer: 1. Problem 2. These 5 numbers should be composed of at least 10 different prime factors. The first 10 prime factors are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. Out of these factors, only 4 are less than 10. Therefore, at least 1 number has 2 prime factors which are greater than 10. This number is greater than 100. Problem Set 22: Divisibility III. Mathematical Race Game 335

Session 22. Divisibility III. Mathematical Race Game Solution to Warm-up Problem Warm-up 1 Solution. Hints: - Stress that both sacks are big. - Approve the suggestion to start from transferring lentils to the inn- keeper’s sack. This is the only meaningful first step, anyway. - Use plenty of drawings to illustrate the puzzle. In the drawings, always draw bags big and wide. For example, after the first step, the picture could look like the drawing below. (P stands for peas, L—for lentils.)

PL - Encourage “out of the box” ideas of how to use a bag. Solution: Pour the lentils into the innkeeper’s bag. Keeping the farm- er’s bag tied in the middle, turn it inside out. Pour the lentils to the overturned farmer’s sack. Unbind the farmer’s sack and pour the peas.

Solutions to the Mathematical Race Problems Problem 1 Solution. Since GCF(a, b)=10,thenbotha and b are mul- tiples of 10. Thus, the smallest that a can be is 10. Since GCF(b, c)=7, then both b and c are multiples of 7. Thus, the smallest value of c is 7. The smallest value of b is 10 × 7=70. The smallest value of a × b × c is 10 × 70 × 7=4,900. Problem 2 Solution. The prime factors of the product 23 ×52 ×133 should be distributed between the two numbers in question. Since the numbers are relatively prime, they cannot have any common prime factors. Therefore, the entire set of 2’s should belong to one of the numbers. The same is true for 5 and 13. Therefore, the options are 1 and 23 × 52 × 133; 23 and 52 × 133; 52 and 23 × 133; 133 and 52 × 23. Problem 3 Solution. Since 2 × 3 is a common factor of 2 numbers, each number should have prime factors 2 and 3. So, each number must contain 2 × 3. Thus, all that’s left is to split 115 between the 2 numbers. However, if each number had prime factor 11, their GCF would contain 11 as well. So, all prime factors 11 must belong to the same number. Therefore, the only possible answer is (2 × 3, 2 × 3 × 115). Problem 4 Solution. (a) Divisibility by 30 follows from divisibility by 3, 2, and 5 because these factors are relatively prime. Out of 5 consecutive numbers, at least 1 must be a multiple of 2. So, the product is divisible by 2. Also, at least 1 336 Solutions must be a multiple of 3; so, the product is divisible by 3. Similarly, 1 must be a multiple of 5. Thus, the product is divisible by 2 × 3 × 5. (b) Divisibility by 120 follows from divisibility by 3, 8, and 5. Out of 5 consecutive numbers, 2 must be even numbers that are 2 apart. So, 1 of them must be a multiple of 4. Thus, 1 of these even numbers must be a multiple of 4, and their product must be divisible by 2 × 4=8. Problem 5 Solution. (a) Nine numbers below 100 are multiples of 11: 11, 22, ..., 99. Thus, the answer is 9. (b) 35 = 5 × 7. Since 5 and 7 are relatively prime, we need divisibility by 5N and 7N . Divisibility by 5N would follow from divisibility by 7N since there are more factors 5 than factors 7. There are 14 multiples of 7 below 100: 7, 14, ..., 98. Two of them, 49 and 98, contain 2 copies of 7. Thus, the answer is 14 + 2 = 16. Problem 6 Solution. There are plenty of different proofs. For example, 50! is divisible by 37 but not divisible by 372. Problem 7 Solution. 1,000 = 23 ×53.Thus,n ×(n +1)×(n +2)×(n +3) should contain 3 copies of prime factor 2 and 3 copies of prime factor 5. Out of any 4 consecutive numbers, 1 must be a multiple of 2, and 1 must be a multiple of 4. Thus, divisibility by 8 can be taken for granted. Also, out of 4 consecutive numbers, only 1 could be a multiple of 5. Therefore, 1 of these numbers has to be divisible by 53 = 125. For the smallest n, we must have n + 4 = 125.Thus,theansweris122 × 123 × 124 × 125,andn = 122. Problem 8 Solution. (a) The difference between 4a +1and a +1is 3a, which is definitely divisible by 3. Therefore, 4a +1is divisible by 3. (b) The difference between 7a+16 and a+1 is 6a+15, which is definitely divisible by 3. Therefore, 7a +16is divisible by 3. (c) The sum of a +13and 2a − 13 is 3a, which is definitely divisible by 3. Therefore, 2a − 13 is divisible by 3. Problem 9 Solution. Every factorial starting from 10! ends with 00. Thus, only 1! + 2! + ···+9! matters. Since we need the last 2 digits of this sum, we should add the 2-digit ending of these 9 factorials. 1! ends with 01; 2! ends with 02; 3! ends with 06; 4! ends with 24; 5! ends with 20; 6! ends with 20; 7! ends with 40; 8! ends with 20; 9! ends with 80. 1+2+6+24+20+20+40+20+80ends with 1+2+6+4=13. Problem 10 Solution. 31 − a =33− (2 + a), and 33 is divisible by 11. Thus, 31 − a is divisible by 11. Problem 11 Solution. x +2y +6x +5y =7x +7y, which is divisible by 7. Problem 12 Solution. 1, 2, and 3. Other solutions are possible. Problem 13 Solution. 1, 2, 3, 6, 12, 24. Other solutions are possible. Problem Set 22: Divisibility III. Mathematical Race Game 337

Problem 14 Solution. (a) The smallest multiple of 9 with the sum of its digits adding up to 81 is composed of nine 9’s. Thus, it will be in the column 111111111. (b) Four consecutive number 27’s come first. For example, they will be under the numbers 9,369, 9,378, 9,387, 9,396. 338 Solutions

Session 23. Mathematical Auction Solutions to Take-Home Problems

Problem 1 Solution. The structure of the phrases is who-time-whom-verb. Then “ta” stands for the future, and “na” for the present; “ni”is“I ”, “u” is “you”, and “a”is“he”. For objects, we have “ku”for“you”, “tu”for“us”, “m”forhim,“wa” for them, etc. Answers: “utawapenda”, “ninamsumbua”.

Problem 2 Solution. (a) Since the number of vertices is odd, there will be 2 vertices of the same color next to each other. Name these vertices 1 and 2. Suppose that their color is black. Then the vertices on both sides of 1 and 2 (vertices 7 and 3) should be white. (Otherwise, we would have 3 black vertices in a row forming an isosceles triangle.). What color should the vertex opposite vertices 1 and 2 be (vertex 5)? If it is black, then 1, 2, and 5 form an isosceles triangle. If it is white, then 7, 3, and 5 form an isosceles triangle. (b) No, it is not. Suppose that vertices 1, 2, 5, and 6 are black and vertices 3, 4, 7, and 8 are white. Then no isosceles triangle can be found.

Problem 3 Solution. 15! has the factors 5, 10, 15. Therefore, it must end with 3 zeroes: 15! = 130 ∗ 674,368,000. Also, it is divisible by 9. Thus, the sum of the digits must be a multiple of 9: 1+3+∗+6+7+4+3+6+8 = 38+∗. Thus, the unknown digit must be equal to 7.

Problem 4 Solution. Key idea: 100 is divisible by 4. Therefore, any number that ends with two zeroes is divisible by 4.

Problem 5. Such a perfect square would be even. So, it should be divisible by 4. However, a number made from 6’s and 2’s ends with 22 or 66 or 62 or 26. So, it can never be divisible by 4.

Problem 6 Solution. Take a look at the numbers 101! + 2, 101! + 3,..., 101! + 101. These 100 numbers are all composites.

Problem 7 Solution. Let’s start with introducing notation: a man believ- ing in Sun—“S”, a man believing in Earth—“E”. Next, observe that if several men in a row share the same opinion, these men are “stable”. (They are never going to change their views.) Next, observe that since the number of wise men is odd, there must be 2 men next to each other who share the same opinion. Thus, they belong to some stable group; assume it is “S”. Moving clockwise, take a look at the first person who is not part of this group. (He is “E”.) If he is not a part of a stable E-group, then both his neighbors must be “S”. So, during the next iteration, he will join this S-group. If he is a part of a stable E-group, keep moving clockwise until we find the first lonely “E” surrounded by “S” on both sides or the first lonely “S” surrounded by “E” on both sides. Such a person, if found, will join a stable group during the next Problem Set 23: Mathematical Auction 339 iteration. If such a person cannot be found, this means everyone belongs to a stable group. Thus, each iteration the number of “lonely” wise men goes down by at least 1. This process will eventually stop; at that moment, everyone will become a member of a stable group. 340 Solutions

Session 24. Divisibility IV. Divisibility by 3 and Remainders Solutions to Take-Home Problems Problem 1 Solution. − 0 1 2 0 0 2 1 1 1 0 2 2 2 1 0 Problem 2 Solution. It cannot; this sum will always be divisible by 3. Indeed, three consecutive numbers span the entire set of remainders: 0, 1, and 2. The remainder of such a sum is 0+1+2 = 3. Alternative explanation: the numbers x, x +1, x +2addupto3x +3. Problem 3 Solution. 37 is divisible by 3 with remainder 1. Therefore, 372 has the remainder 1 × 1=1, etc. Thus, all powers of 37 have remainder 1 when divided by 3. Therefore, 3773 − 1 is divisible by 3. Problem 4. It follows that a price of 1 sombrero is a multiple of 3 plus 2: 3x+2. Then the price of 7 hats is 7∗(3x+2) = 7∗3∗x+14 = 7∗3∗x+12+2. 7 ∗ 3 ∗ x +12is a multiple of 3. Therefore, this quantity can be paid in 3- shmollar coins. Therefore, 2 is extra, and there will be a 1-shmollar change. It is possible to explain this problem without equations. Seven sombreros are 6 sombreros plus 1. The price of 6 sombreros is divisible by 3; so, it can be paid with 3-shmollar coins without change, so we’ll get the change from the 7th sombrero only. Problem 5 Solution. 16 is divisible by 3 with remainder 1. Thus, all powers of 16 have remainder 1 when divided by 3. Similarly, all powers of 7 have remainder 1 when divided by 3. Now, let’s take a look at the remainders of powers of 2. 21 has remainder 2; 22 has remainder 1; 23 has remainder 1 × 2=2; 24 has the same remainder as 2 × 2=4, which is 1. Thus, every odd power of 2 has remainder 2, and every even power—remainder 1. Therefore, 2101 has remainder 2. So, 1610 −2101 ×722 has the same remainder as 1 − 2 × 1=−1. This is remainder 2. Problem 6 Solution. The difference between these two numbers is 6. Therefore, their GCF could possibly be 1, 2, 3, or 6. However, 12n +1 is not divisible by 2, by 3, and by 6. Therefore, GCF(12n +1, 12n +7)=1. Problem 7 Solution. Each time the total number of pieces goes up by 3 or by 9. Since this total always goes up by a multiple of 3, it always has the same remainder when divided by 3. She starts with a number that has remainder 1; however, 2,000,000 has remainder 2. So, she can never get 2,000,000 pieces. Problem 8 Solution. Since the number of bunches is a perfect square, it is either divisible by 3 or has the remainder 1 when divided by 3. Indeed, if the number itself has remainder 1, its square has remainder 1. If the number Problem Set 24: Divisibility IV. Divisibility by 3 and Remainders 341 has remainder 2, its square has the same remainder as 2 × 2=4.Thus,it has remainder 1 as well. We know that the number is not divisible by 3, or the brothers could have divided their wheat easily. Therefore, the remainder is 1. But then, adding 2 more bunches will make it a number divisible by 3. So the brothers will be able to divide their harvest. Problem 9 Solution. Let’s pay attention to the colored squares only. (See the picture.) One could see that the bugs could jump onto the dark gray squares only if they sat on white squares before I clapped. Therefore, there will be 10 bugs on the 15 gray squares after all bugs have jumped. Thus, at least 5 dark gray squares will be left empty.

Solutions to Additional Problems Problem 1 Solution. It is easy to see that the amount of fuel the two ships received is divisible by 3. The number of tons of fuel in all the containers combined has remainder 2 when divided by 3; so the leftover container’s capacity should also have remainder 2. The only such container is the 20- ton container. Problem 2 Solution. No, since one of these numbers is a multiple of 3. If p is not a multiple of 3, then it has remainders 1 or 2. Then either p − 100 or p + 100 is a multiple of 3. Problem 3 Solution. Let’s use the fact that a perfect square cannot have remainder 2 when divided by 3. If both x2 and y2 are not divisible by 3, then each must have remainder 1 when divided by 3. Then their sum would have the remainder 2 when divided by 3; therefore, it cannot be equal to z2. Problem 4 Solution. Let’s take any multi-digit number, for example, 1,234. We know what the decimal notation means: 1,234 = 1 × 1,000 + 2 × 100 + 3 × 10 + 4. Wecanwriteitthisway: 1,234 = (1 + 2 + 3 + 4) + (1 × 999 + 2 × 99 + 3 × 9). The first set of parentheses contains the sum of the digits, and the second set of parentheses contains a number divisible by 3. Since we can always take away a number divisible by 3 and the remainder will not change, we can happily omit the second set of parentheses. And we are left with the sum of the digits. 342 Solutions

In more general form, n−1 1 a1a2 ...an−1an = a1 × 10 + ···+ an−1 × 10 + an

=(a1 + ···+ an−1 + an)+(a1 × 99 ...9+···+ an−1 × 9). Again, the first set of parentheses contains the sum of the digits, and all the numbers in the second set of parentheses are divisible by 3 and can be deleted without changing the remainder. Problem 5 Solution. n3 +2n = n × (n2 +2). Now notice that if n is divisible by 3, the whole thing is divisible by 3 as well. Otherwise, n2 gives a remainder of 1 when divided by 3, so n2 +2will be divisible by 3. The problem can also be solved by going through all possible remainders that n can give when divided by 3 and by calculating the remainder of the expression for each of them: n n2 n3 2n n3 +2n 0 0 0 0 0 1 1 1 2 0 2 1 2 1 0 Problem Set 25: Divisibility V. Divisibility and Remainders 343

Session 25. Divisibility V. Divisibility and Remainders Solutions to Warm-up Problems Warm-up 1 Solution. Ton. Warm-up 2 Solution. When you talk about time.

Solutions to Practice Problems Problem 1 Solution. The number is equal to 6x +1. Let’s start by figuring out all possible remainders of 6x when divided by 18. If x is divisible by 3, then 6x has remainder 0. If x has remainder 1 when divided by 3, then 6x =6(3k +1)=18k +6has remainder 6 when divided by 18. If x has remainder 2, then 6x =6(3k +2)=18k +12has remainder 12. No other remainder is possible. So, the possible remainders for 6x +1are 1, 7, 13. Problem 2 Solution. To be divisible by 4 and 6, the number must contain one copy of 3 and two copies of 2 in its prime factorization. Therefore, the number must be expressed as 12 × k.Ifk is divisible by 2, then the number is divisible by 24. If k has remainder 1 when divided by 2, then 12 × k has remainder 12. The answers are 0 and 12. Problem 3 Solution. Let’s start with constructing the table of the remain- ders of 8n when divided by 9: 81 has remainder 8; 82 has the same remainder as 8 × 8=64,whichis1;83 has the same remainder as 82 × 8,whichis 1 × 8=8; 84 has the same remainder as 83 × 8,whichisthesameasthe remainder of 8 × 8=64,whichis1. number 81 82 83 84 remainder 8 1 8 1 So, the rule is that every odd power has remainder 8 and every even power has remainder 1. Thus, the answer is 1. Problem 4 Solution. Let’s start with observing that the last digit would not change if we replace all the numbers by their last digits. Thus, we can replace the original expression by 1 · 2+2· 3+···+8· 9+9· 0+1· 2+2· 3+···+9· 0 =10· (1 · 2+2· 3+···+8· 9+9· 0). Whatever the last digit of the expression in the parentheses is, we mul- tiply it by 10. Therefore, the last digit of the entire expression is 0. Problem 5 Solution. The first product contains 7 consecutive numbers. So, one of them is divisible by 7, and the entire product 1,999 · 2,000 · 2,001 · 2,002 · 2,003 · 2,004 · 2,005 is divisible by 7 as well. 344 Solutions

To calculate the remainder of 1211, let’s start with writing the remainders of the low powers of 12: The remainder of 121 is 5. The remainder of 122 is the same as that of 5 × 12 = 60,whichis4. The remainder of 123 is the same as that of 4 × 12 = 48,whichis6. The remainder of 124 is the same as that of 6 × 12 = 72,whichis2. The remainder of 125 is the same as that of 2 × 12 = 24,whichis3. The remainder of 126 is the same as that of 3 × 12 = 36,whichis1. Now, since 1211 =125 × 126, we can calculate the remainder of 1211.It is 3 × 1=3. (Alternatively, we can observe that remainders repeat with period 6.) So, the final answer is the remainder of 0 − 3,whichis4.

Problem 6 Solution. Let’s construct the table of remainders when divided by 3. x modulo 3 0 1 2 x2 modulo 3 0 1 1 Thus, it is easy to see that the only possible remainders are 0 and 1. So, x2 +1could have remainders 1 or 2, but not 0.

Problem 7 Solution. n3 − n = n(n2 − 1). Solution 1. To prove that this expression is divisible by 24, it is sufficient to prove that it is divisible by 8 and by 3. Divisibility by 3 is easy to prove: either n is divisible by 3 or n2 has remainder 1. (See the previous problem.) To prove divisibility by 8, let’s write the table of remainders for n and n2 − 1.Sincen is odd, then n must have an odd remainder: n modulo 8 1 3 5 9 n2 modulo 8 1 1 1 1 Thus, n2 − 1 is divisible by 8. Solution 2. n3 − n = n(n2 − 1) = n(n − 1)(n +1). Out of any three consecutive numbers, one must be divisible by 3. Also, since n is odd, n − 1 and n +1are two consecutive even numbers. One must be divisible by 4, another by 2. Thus, their product must be divisible by 8.

Solutions to Take-Home Problems

Problem 1 Solution. It follows from the first condition that Tim had 3 times as many nuts as Tom. Therefore, the number of nuts he had is divisible by 3. Since it is still divisible by 3 after Tim gave some nuts to Tom, the number of nuts he gave also should be divisible by 3. Therefore, Tim gave Tom 3 nuts, the only number divisible by 3 that is not greater than 5. Problem Set 25: Divisibility V. Divisibility and Remainders 345

Problem 2 Solution. ax − a = a(x − 1). Since ax − a should be divisible by 7 and 7 is a prime number, either a or x − 1 is divisible by 7. Since it cannot be a,ithastobex − 1. Problem 3 Solution. Any number in a sum can be substituted for any leftover number, and the last digit of the sum does not change. So, all telephone numbers must end with the same digit D. 7 × D ends with a 9, so D must be equal to 7. A sum of 11 numbers ending in 7 ends with 7 as well. Problem 4 Solution. Squares of numbers give remainders 0, 1, 2, and 4 when divided by 7 (check!). Out of these, only the combination 0+0 will give you a number divisible by 7. Thus x and y have to be divisible by 7. That leaves us with 14 × 14 = 196 different combinations. Problem 5 Solution. The answer is “Yes”. Hours 1–2. Astronaut A: takes 2 tanks and starts walking toward B. He stops at 6 km and drops one full tank. (Let’s call this point “Intermediate Base 1”.) Next, he heads back to the base. Astronaut B: waits in the rover. Hour 3. Astronaut A: takes two full tanks and starts walking toward B. At Base 1, he drops the tank he was using (it has 1 hour of oxygen left) and picks up the full tank. Astronaut B: waits in the rover. Hour 4. Astronaut B: starts walking toward A. They meet 12 km away from the base at the end of the hour. B pick up the full tank from A and starts walking toward the base. He has enough oxygen to reach the base. A turns back. He still has 1 hour of oxygen left in his tank. Hour 5. At the end of this hour, both A and B reach Base 1. Astronaut A drops his empty tank and picks up the tank with a 1-hour supply. At the end of hour 6, both astronauts are at the base. Problem 6 Solution. It’s easy to see that all the coins’ denominations give the same remainder R when divided by 7 and the total sum of the loot has the same remainder R. Indeed, when each coin is removed, the rest is divisible by 7, so the coin must have the same remainder as the total sum. Suppose that the bag contains 100 coins. In this case, 99 coins would have remainder 99R. However, this number is not divisible by 7 for any nonzero R<7.IfR were 0, however, the total sum would be divisible by 7, which contradicts the first condition. Thus, the bag cannot contain 100 coins.

Solutions to Additional Problems Problem 1 Solution. The amount that she deposited during the first week is equal to the remainder of the allowance when divided by 3. Denote this remainder by x; it could be equal to 1 or 2. So, the remainder when divided by 6 could possibly be x or x +3, and the remainder of the allowance, when divided by 9, could be x, x +3,orx +6. The biggest possible value for the 346 Solutions sum of the three remainders is x +(x +3)+(x +6)=3x +9.Ifx =1, this value is less than 15. Therefore, for the sum of the remainders to be 15, x must be 2, and the two other remainders must be 5 and 8. Since the remainder when divided by 9 is 8, the remainder when divided by 18 could be 8 or 17. However, since the remainder, when divided by 6, is 5, the allowance is an odd number. Therefore, the remainder when divided by 18 must be odd. Thus, the remainder should be equal to 17. Problem 2 Solution. It is easy to see that among any ten consecutive numbers, where the first number is divisible by 10, there are exactly two with the sum of digits divisible by 5. Indeed, the sum of all digits but the last one does not change, and the last digit goes from 0 to 9, producing 10 consecutive sums of digits. Now we have to look at what happens with the ends. There is only one such number among 1, ..., 9 and one among 2,010,...,2,015. Adding this altogether we get 400 + 1 + 1 = 402 numbers. Problem 3 Solution. When you add 1 to such a number, it will be divisible by 3, 4, and 5. The smallest such number is 60 (it has to have prime factors 2, 2, 3, and 5). Thus the answer to the problem is 59. Problem 4 Solution. If a − b is divisible by 7, then a and b have the same remainders when divided by 7; the same is true for c and d.Thenac has the same remainder as bd and therefore ac − bd is divisible by 7. Problem 5 Solution. Factor 15 out: 15(2n − 3) must be divisible by 239. If we make 2n−3 divisible by 239, then we solve the problem. (The numbers 15 and 239 do not share any common factors.) Therefore, we are looking for an even number 2n that has remainder 3 when divided by 239. There are plenty of numbers like that. The simple solution would be to set 2n = 239+3; 2n = 242; n = 121. Problem Set 26: Graph Theory I. Graphs and Their Applications 347

Session 26. Graph Theory I. Graphs and Their Applications Solutions to Warm-up Problems Warm-up 1 Solution. (a) Vertices of a square. (b) Vertices of a regular pentagon. (c) Vertices of a regular pentagon and its center.

Warm-up 2 Solution.

1

2 3 2 3

1

Solutions to Take-Home Problems Problem 1 Solution. (a) There will be 4 × 9=36cable ends. Each cable has two ends. Therefore, we need 18 cables. (b) There will be 5 × 9=45cable ends. Therefore, we’ll need 45/2= 22.5 cables. That is not possible. Problem 2 Solution. Suppose that whenever an agreement between a pair of countries was crafted, it was signed by these two countries. To calculate the total number of signatures, we can add them country by country. We get 4 × 4+8× 5+3× 3=65. However, each agreement has 2 signatures. Therefore, the number of agreements is 65/2=32.5, which is impossible. Problem 3 Solution. Suppose x people played 5 games and y people played 6 games. Each game takes 2 players. Then the total number of games should be (5 ∗ x +6∗ y)/2.Inthiscase,5 ∗ x +6∗ y should be even. Therefore, 5 ∗ x should be even, and x should be even. Problem 4 Solution. Call those who shook hands with 2 guests only Tom and Bob. There are at least 2 guests at this party who did not shake hands with either with Bob or Tom. Each of these 2 guests has just 5 candidates left to shake hands with. Thus, these 2 cannot shake hands with 6. Answer: Not possible. Problem 5 Solution. Whenever an amoeba divides, the total number of amoebas goes up by an even number (either 4 or 6). Therefore, the parity of the number of amoebas remains the same. We start from 1 amoeba; therefore, we have to have an odd number of amoebas. Thus, we cannot get to 100. 348 Solutions

Problem 6 Solution. Proof by contradiction. Assume that no one waves. Let’s number the chairs 1 to 99. Since the total number of scientists is odd, there must be 2 scientists from the same planet sitting next to each other. Assume that these are Martians and that they sit on chairs 99 and 1. Then their neighbors on both sides, on chairs 2 and 98, must be from Venice. (Indeed, otherwise, we would have 3 Martians in a row, and the Martian in the center would have to wave to her 2 neighbors.) Also, the scientist directly across from them (on chair 45) must be from Venice as well. Indeed, otherwise, she would be waving to the Martians on chairs 1 and 99. However, in this case, the scientist on chair 45 must wave to the scientists on chairs 2 and 98—they all come from Venice. Contradiction. For Teachers: Whenever a problem involves a big number, like 99, it is always useful to start from exploring the same problem with a smaller number. For this problem, since parity clearly matters, the number 9 would be a good starting point. Solving the problem for 9 scientists would allow us to discover the key ideas of the solution in a simpler setting. Problem Set 27: Graph Theory II. Handshaking Theorem 349

Session 27. Graph Theory II. Handshaking Theorem Solutions to Warm-up Problems

Warm-up 1 Solution.

Warm-up 2 Solution. This question requires algebraic interpretation. Remember that 4 is the square of 2.

Solutions to In-Class Problems

Problem 1 Solution. No; if we have 3 vertices of degree 4, that means that we have 3 vertices that are connected to every other vertex of the graph. So, the remaining vertices must have at least 3 connections.

Problem 2 Solution. (a) Yes, an easy example is a polygon with 8 vertices, each connected to two neighbors and the opposite vertex. (b) No, this would mean an odd number of odd vertices. (c) Suppose that the graph has x vertices. Then the number of edge ends, if counted vertex by vertex, must be x × 3. Thus, the number of edges is x × 3/2=20. However, this equation has no integer solutions. Therefore, such a graph is impossible.

Problem 3 Solution. Suppose that we have two kids from different schools. Then the first child knows at least 7 kids from her school; the second child knows at least 7 kids from her school. Thus, there are at least 8 kids from each school. So, at least 16 kids should participate in the trip. Contradiction.

Problem 4 Solution. There must be a town with 0 roads, 1 road, 2 roads,..., 11 roads. However, if there is a town connected to 11 others, atownwith0roadsisimpossible.

Problem 5 Solution. Let’s treat amoebas as vertices of a graph. Then each handshake corresponds to an edge connecting a pair of vertices, and an odd-handed ameba corresponds to an odd vertex. The number of odd vertices must be odd. 350 Solutions

Solutions to Take-Home Problems Problem 1 Solution.

Problem 2 Solution. Suppose that a1 saucers landed on AB, b1 saucers landed on BC, and so on. Then a = a1+f1 bowlswerestoleninA,b = b1+a1 bowls—in B, c = c1+b1 bowls—in C, d = d1+c1 bowls—in D, e = d1+e1 bowls—in E, f = e1+d1 bowls—in F. Thus, a + c + e = b + d + f.So, f = a + c + e − b − d. Problem 3 Solution. Suppose that the graph is not connected. Then there are 2 vertices that are not connected by a path. Call them A and B. A is connected to at least 20 vertices, and B connected to at least 20 vertices. If these 2 sets of vertices had no intersections, then the total number of vertices must be at least 1+1+20+20=42.Thisisimpossible. Problem 4 Solution. (a) The example is below.

(b) The number of cable ends would be 30×5 = 150.Thus,thenumber of cables would be 75. (c) Suppose that the number of computers is x. In this case, the number of cables is x × 5/2. We have an equation to solve: x × 5=56× 2.Itis easy to see that such an equation does not have an integer solution. (The left-hand side is divisible by 5, and the right-hand side is not.) Problem 5 Solution. Even. If the person is a knight, then the total number of his friends is odd; if he is a liar, then it is odd as well. Thus, everyone on the island has an odd number of friends. We have a graph whose vertices are odd. But we know that in each graph the number of odd vertices is even. For such a graphs to exist, it should have an even number of vertices. Problem 6 Solution. Let’s suppose that these 2 flights belong to different airlines. Temporarily erase all flight of 1 airline (Royal, for example) from the map. In this case, we will be left with a map where all the airports have Problem Set 27: Graph Theory II. Handshaking Theorem 351

2 lines starting at them and 1 airport (the airport where Republican flies abroad) with 1 line. Such a graph is not possible since it would have only 1 “odd” vertex.

Solutions to Additional Problems Problem 1 Solution. Each of the 15 vertices is odd. Therefore, such a graph is impossible. Problem 2 Solution. Let’s count the number of intersection points. Each segment has 3; therefore, the total number of points segment by segment is 9 × 3=27. However, since every point belongs to 2 segments, we counted every point twice. Thus, the actual number of points must be 27/2=13.5, which is impossible. Therefore, such a configuration of segments is impossible to draw. Problem 3 Solution. If we add up the number of edges for each face, we get the total number of edges times two. Therefore, this number has to be even; thus, we cannot have only 1 face with an odd number of edges. (Notice that we did not use face coloring here at all. The solution that does use face coloring can be even simpler: the total number of edges = the sum of the number of edges for black faces = the sum of the number of edges for white faces. These two numbers are equal and therefore they cannot have different parity.) Problem 4 Solution. If all the girls know a different number of boys, then therearegirlswhoknow0,1,2,..., 10boys. Therefore,thetotalnumberof “links” from boys to girls is 55. If each boy knew the same number of girls, then the total number of links from boys to girls would be a multiple of 10. Therefore, it cannot be equal to 55. Problem 5 Solution. Proof by contradiction. Suppose that the graph is disconnected. Then we would have two groups of vertices that are not connected to each other. Suppose that we have x vertices in the first group and 10−x in the second. Choose vertex A from the first group. Originally, it was connected by an edge to each of the 10 − x vertices in the second group. All the 10 − x edges must have been removed. If we choose a vertex B from the second group, we can reason in a similar way: x edges used to connect B to the vertices from the first group must have been removed. Out of these two sets of edges that have been removed, only one edge—the edge AB—has been counted twice. Therefore, at least x +10− x − 1=9edges must have been removed. However, we know that only 8 edges have been removed. 352 Solutions

Session 28. Graph Theory III. Solving Problems with Graphs Solutions to Warm-up Problems Warm-up 1 Solution. The numbers with holes and without. Warm-up 2 Solution. The other half are daughters as well. Warm-up 3 Solution. 600 hens lay 300 eggs in 3 days. Therefore, 300 hens lay 150 eggs in 3 days.

Solutions to Take-Home Problems Problem 1 Solution. Yes, you can. Choose 3, 33, and 63 1’s. Problem 2 Solution. (a) No, you cannot: this graph must have 8 vertices total. However, in this case, the degree of a vertex must be smaller than 8. (b) No, you cannot. If 2 of the 8 vertices have degrees 7, then the rest of the vertices must have degrees at least 2. (c) No, you cannot because it is impossible to have an odd number of odd vertices. Problem 3. Let’s concentrate on green-blue connections. Suppose that we have g green vertices and b blue ones. Then 9 × g edges connect green vertices with blue. Also, b×10 edges connect blue vertices with green. Since these are the same edges, we have 9g =10b. Thus, we have more green vertices. Problem 4. This is impossible for all odd k since that would mean an odd number of “odd” vertices in the resulting graph. This is possible for all k =0, 2, ..., 100. Indeed, let’s arrange all the computers in a big circle and connect each of them with k/2 neighbors to the left and k/2 neighbors to the right. Problem 5 Solution. With one pump, the water rose by 20 cm in 10 minutes; with 2 pumps, it went down by 10 cm. So one pump makes the difference of 30 cm in 10 minutes. Two pumps do 60 cm in 10 minutes. Since we had 10 cm of water standing, it will be gone in 10/6 minutes. Problem 6 Solution. Let’s mark “Pirate A hates Pirate B” with an arrow from A to B. Then we have 60 points (pirates), and there is an arrow heading from each point to some other point. Let’s start with Pirate A and follow the arrows until we get a loop. (Eventually, we’ll get a loop since the number of pirates is not infinite. Pirate A himself does not have to belong to this loop. See the picture below.) A Problem Set 28: Graph Theory III. Solving Problems with Graphs 353

Since only one arrow comes from every vertex, no other loops can be connected to the same group of points. However, it is possible that more “tails” are connected to the same loop. (See the picture below.)

A

Now, let’s demonstrate how to split the pirates in each component into 3 groups. Let’s start with the actual loop. In such a loop, it is easy to split the pirates into groups: we can alternate group 1 and group 2 assignments. Also, if the number of pirates in the loop happens to be odd, the last pirate can be assigned to group 3. Next, let’s assign the pirates that belong to the “tails”. Starting from the pirate (point) that is in the main loop and moving away from the loop, we can alternate assigning pirates to groups 1, 2, and 3.

Problem 7 Solution. Let’s represent players with dots. Connect those who played on the first day with a red line and those who played on the second day with a blue line. We get 10 dots, each connected with 2 others by 1 blue and 1 red line. Note that these lines form loops. (If you start following these lines, your route can only end when you “arrive” at the starting dot!) Every loop has an even number of dots since the red and blue lines in a loop alternate. If we take every other dot in every cycle, we get 5 players that are not connected to each other. So, these 5 players did not play among themselves.

Problem 8 Solution. Let’s model this problem through graphs: planets are vertices, and shuttle routes are edges. This graph is complete—every vertex is connected to every other. Since we have two different shuttle companies, we will use two types of lines to mark these edges: solid lines for Royal routes and dashed lines for Spacehound. Now, we are going to prove that if Royal does not span the entire galaxy, then Spacehound does. Suppose that there exist two planets, call them A and B, such that it is not possible to get from A to B using Royal routes only. First, let’s take a look at all the planets that can be reached from A by Royal shuttles; let’s call this group of planets “A-orbit”, and the rest of the planets in Galaxy M31 – “not-A-orbit”. We are going to prove that: - Any A-orbit planet is connected to any not-A-orbit planet by a direct route that is served by Spacehound. Indeed, suppose that X is an A-orbit 354 Solutions planet and Y is not. If the direct route that connects X and Y were Royal, then Y would be reachable from A via Royal shuttles. Then Y would be in A-orbit. (See the picture below.)

A-orbit (reachable by Royal)

A X Y Royal routes

Spacehound routes

- From any A-orbit planet, we can get to any A-orbit planet by Space- hound shuttles. Indeed, suppose that X and Z are both A-orbit planets. Then X and Z must be connected to B by direct Spacehound routes. Then one can travel from X to Z by Spacehound with one transfer in B. (See the picture below.)

A X B

Z

- From any not-A-orbit planet, we can get to any other not-A-orbit planet by Spacehound shuttles. Indeed, suppose that C and D are both not-A-orbit planets. Then C and D must be connected to A by direct Spacehound routes. Then one can travel from C to D by Spacehound shuttles with one transfer in A.

C D A

This proves that each pair of planets can be reached via Spacehound routes only. So, if Royal does not span an entire galaxy, then Spacehound does. Thus, one of the companies can be eliminated. Problem Set 29: Mathematical Olympiad III 355

Session 29. Mathematical Olympiad III Solutions to the First Set of Problems Problem 1 Solution. See the picture. There are several solutions obtained by rotation and symmetry. 7 73 31 61 37 13 43 1 67 Problem 2 Solution.

Problem 3 Solution. First, we can observe that the wizard works twice as fast as the apprentice (1/3 of all and 1/6 of all). Next, note that by the time the wizard went to bed, 1/6 of all the frogs were not transformed yet. If the two work together, they transform 1/6 of all the frogs in 1 hour. However, since the magician is twice as fast, the apprentice transforms 1/3 of this amount in 1 hour, and the magician transforms 2/3 of this amount. Thus, the apprentice transforms 1/18 of all the frogs in 1 hour. Since the apprentice is left with 1/6 of all the frogs, it will take him 3 hours to finish. Problem 4 Solution. Notation:

Thur. Fri. Sat. Sun. Mon. Tues. Wed. Thur. Fri. x1 x2 x3 x4 x5 x6 x7 x8 x9

We have (arrows mean “greater than”)

x1 x2 x3 x4 x5 x6 x7

x5 >x4, x5 x5, x6 x6, x7 x7, x8

We can see that x3, x4, x5, x6, x7, x8 make a loop that can be traced in the direction of the arrows, which is impossible. Thus, he has to stop no later than on Wednesday. Example that shows that Wednesday is possible: x1 = 100, x2=99, x3=98, x4=50, x5=51, x6=52, x7=53. Problem 5 Solution. The possible charges for a face are −4, −2,0,2, and 4 (you cannot get an odd number by adding four +1 or −1 charges). Therefore, by the Pigeonhole Principle, out of 6 cells, we’ll have at least 2 with the same charge. Problem 6 Solution. Denote the wealth of the bosses by W 1, W 2, ..., W 9. Let’s use the first 3 questions to find W 1+W 2, W 3+W 4, W 5+W 6.Now, we are left with 3 unknown weights W 7, W 8,andW 9—and 3 questions. Let’s use up these 3 questions to find out the sums W 7+W 8, W 8+W 9, and W 9+W 7. Then, if we add these 3 sums and divide the total by 2, we get W 7+W 8+W 9.

Solutions to the Second Set of Problems Problem 7 Solution. Mark medals G1, S1, S2, S3, B1, B2, B3, B4, B5. First try S1+B1+B2 and S2+B3+B4. - If one of these sets is lighter (the left one, for example) then it contains the fake medal. In this case, compare B1 and B2. - If both sets weigh the same, the fake medal is in the G1, S3, B5 set. In this case, compare S3+B1 and B5+S1.(B1 and S1 are surely real.) If the left set is lighter, S3 is fake. If the right set is lighter, B5 is fake. If they are equal, G 1 is fake. Problem 8 Solution. Each 2 × 6 rectangle has sum 0; each 3 × 6 rectangle has sum 0. Thus, each 1 × 6 rectangle has sum 0. The 24 perimeter cells are made up of four 1 × 6 rectangles. Problem 9 Solution. Check these sets of doors: 5, 1, 2; 1, 3, 4; 2, 3, 4. In this case, each door except the 5th will be tried twice, and the 5th will be tried once. Thus, if we add these three numbers, the parity will depend on whether the tiger is behind the 5th door. Odd—yes. Even—no. Problem 10 Solution. Observe that at least 2 consecutive quarrels took place on the dates that are expressed by 2-digit numbers. Therefore, the strings of black digits must all have an even length. Also, observe that the total number of 1-digit dates is an odd number. (It is 9 of them.) Thus, if the first quarrel of the month took place on a 2-digit date, then the leftmost black string of digits would be of odd length, which is impossible. Therefore, the first quarrel must have taken place during the first 9 days (the 1-digit dates). However, if it took place before day 10 of the month and not on the first day, then the first string of black digits would have been too short. Problem Set 29: Mathematical Olympiad III 357

Problem 11 Solution. Write the prime factorization of all the numbers from 1 to 10: 1, 2, 3, 2 × 2,5,2 × 3,7,2 × 2 × 2, 3 × 3, 2 × 5.Forthe product of group 1 to be divisible by the product of group 2, each of these prime factors should be present in group 1 at least as many times as in group 2. Moreover, the quotient for each of these factors will be defined by the difference of the number of these factors in groups 1 and 2. Thus, the smaller this difference is, the better. Therefore, we cannot do better than the following: Group 1 2 × 2 × 2 × 2 3 × 3 5 7 Group 2 2 × 2 × 2 × 2 3 × 3

Can we split the numbers like this? Yes, we can: Group 1: 7, 10, 6, 3, 1, 4. Group2:5,8,9,2. (Other solutions may be possible.) Problem 12 Solution. The sum of all the numbers on the board represents the following entity: it is the number of all the sides separating a square with a mine from an empty one. In other words, it is the number of all pairs of cells next to each other, one empty and the other containing a mine. It is easy to see that the operation described in the problem does not change the number of cell sides separating empty squares from squares with mines. Therefore, the sum of the numbers on the board will not change.

Appendix to Session 6

“Convert Decimal to Binary” Blank Table

Number Number in 32 16 8 4 2 1 in base 10 binary 32 (= 25) 16 (= 24) 8(=23) 4(=22) 2(=21) 1(=20) 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

359

Bibliography

[1] A. Burago, Mathematical Circle Diaries, Year 1: Complete Curriculum for Grades 5 to 7, American Mathematical Society, 2012. [2] D. Fomin, S. Genkin, and I. Itenberg, Mathematical Circles (Russian Experience), American Mathematical Society, 1996. [3] Moscow Center for Continuing Math Education (MCCME), Internet-project Problems, http://www.problems.ru. Accessed April 30, 2017. [4]Z.StankovaandT.Rike,A Decade of the Berkeley Math Circle: The American Experience, Volume I, American Mathematical Society, 2008. [5] D. Vandervelde, Circle in a Box, American Mathematical Society, 2009. [6] S. Dorichenko, A Moscow Math Circle: Week-by-week Problem Sets, American Mathematical Society, 2012. [7] I. Yashchenko, Invitation to a Mathematical Festival, American Mathematical Society, 2013. [8]Z.StankovaandT.Rike,A Decade of the Berkeley Math Circle: The American Experience, Volume II, American Mathematical Society, 2014. [9] A. Shen, Geometry in Problems, American Mathematical Society, 2016. [10] A. P. Kiselev and A. Givental, Kiselev’s Geometry, Book I. Planimetry, Sumizdat, 2006. [11] D. Faires, First Steps for Math Olympians: Using the American Mathematics Competitions, Mathematical Association of America, 2006. [12] D. Faires and D. Wells, AMC Contest Problem Books, Mathematical Association of America, 2006. [13] S. Lehoczky and R. Rusczyk, The Art of Problem Solving, Volume 1: The Basics, Art of Problem Solving. [14] S. Lehoczky and R. Rusczyk, The Art of Problem Solving, Volume 2: And Beyond, Art of Problem Solving. [15] M. Saul and S. Zelbo, Camp Logic: A Week of Logic Games and Activities for Young People, Natural Math, 2014. [16] Alec Wilkinson, The pursuit of beauty, New Yorker Magazine, February 10, 2015. [17] A. Kordemsky. The Moscow puzzles, Dover, 1992. [18] Math Department of Moscow State University, Math Circles Archives, http://mmmf. msu.ru/archive/. Accessed April 30, 2017. [19] “Mathematical Festival” tournament, Russia, http://olympiads.mccme.ru/ matprazdnik/. Accessed April 30, 2017. [20] Center for Complimentary Education of Gifted Schoolchildren, Kirov, Russia, http://cdoosh.ru/. Accessed April 30, 2017. [21] Club “Mathematical Guru”, Samara, Russia, http://mathguru.ru/. Accessed April 30, 2017. [22] “Turlom” tournament, Russia, http://turlom.olimpiada.ru/ Accessed April 30, 2017.

361 362 Bibliography

[23] UW Math Hour Olympiad, https://sites.math.washington.edu/~mathcircle. Accessed April 30, 2017. [24] BAMO Olympiad, http://www.bamo.org/. Accessed April 30, 2017. [25] National Association of Mathematical Circles, http://www.mathcircles.org/. Accessed May 5, 2018. [26] Cut-the-Knot, Interactive Mathematics Miscellany and Puzzles, http://www.cut-the- knot.org/. Accessed April 30, 2017. [27] Mathematical Circles Topics by Tom Davis, http://www.geometer.org/mathcircles. Accessed March 14, 2018. [28] Prime Factor Math Circle. http://www.pfmathcircle.org. Accessed April 30, 2017. [29] Tanya Khovanova. Math Blog, linguistic puzzles. http://blog.tanyakhovanova.com/ 2009/02/linguistics-puzzles/. Accessed April 30, 2017. [30] Los Angeles Math Circle, http://www.math.ucla.edu/~radko/circles/. Accessed April 30, 2017. [31] Wichita State University. History of Math Project. http://www.math.wichita.edu/ history/index.html. Accessed April 30, 2017. [32] MathManiaCS. http://www.mathmaniacs.org/. Accessed April 30, 2017. [33] Math For Love, http://mathforlove.com/. Accessed April 30, 2017. [34] James Tanton, Thinking Mathematics! http://www.jamestanton.com/. Accessed April 30, 2017. [35] Enriching Mathematics. https://nrich.maths.org. Accessed April 30, 2017. [36] Richard Garlikov. The Socratic Method: Teaching by Asking Instead of by Telling. http://www.garlikov.com/Soc_Meth.html. Accessed January 24, 2012. [37] Brainden.com. Logic Riddles and Puzzles. http://brainden.com/logic-riddles.htm. Accessed November 8, 2016. [38] Learning Tree Matchstick Puzzles http://www.learning-tree.org.uk. Accessed November 9, 2016. [39] E. V. Smykalova, Sbornik zadach dlia 6go klassa, SMIO Press, 2002 (in Russian). [40] E. V. Smykalova, Sbornik zadach dlia 5go klassa, SMIO Press, 2002 (in Russian). [41] I. V. Raskina, Logika dlja vsex, ot piratov do mudretsov, MCNMO, Moscow, 2016 (in Russian). [42] K. A. Knop, Vzveshivania i Algoritmi, MCNMO, Moscow, 2013 (in Russian). [43] A. V. Spivak, Mattematicheskii Kruzhok, MCNMO, Moscow, 2010 (in Russian). [44] A. V. Spivak, Tisacha i odna zadacha po matematike, Prosvescehnie, Moscow, 2010 (in Russian). [45] A. V. Spivak, Matematicheskii prazdnik, Kvantum, Moscow, 2004 (in Russian). [46] I. F. Sharigin and L. N. Engarzhieva, Nagliadnaia Geometriia, Drofa, Moscow, 2009 (in Russian). [47] E. G. Kozlova, Skazki i podskazki. Zadachi dlja matematicheskogo kruzhka, MCCME, Moscow, 2006 (in Russian). [48] L. E. Mednikov, Chetnost, MCCME, Moscow, 2009 (in Russian). [49] P. V. Chulkov, Arifmeticheskie Zadachi, MCCME, Moscow, 2009 (in Russian). [50] V. O. Bugaenko, Turniri im. Lomonosova. Konkursi po Matematike, MCCME, Moscow, 1998, (in Russian). [51] R. Smullyan, The lady or the tiger, Knoph, New York, 1982. [52] R. Smullyan, The of Scheherazade, New York, Knoph, 1982. Mathematical circles, with their question-driven approach and emphasis on problem solving, expose students to the type of mathematics that stimulates the development of logical thinking, creativity, analytical abilities, and mathematical reasoning. These skills, while scarcely intro- duced at school, are in high demand in the modern world. This book, a sequel to Mathematical Circle Diaries, Year 1, teaches how to think and solve problems in mathematics. The material, distributed among twenty-nine weekly lessons, includes detailed lectures and discus- sions, sets of problems with solutions, and contests and games. In addition, the book shares some of the know-how of running a mathematical circle. The book covers a broad range of problem-solving strategies and proofing techniques, as well as some more advanced topics that go beyond the limits of a school curriculum. The topics include invariants, proofs by contradiction, the Pigeonhole principle, proofs by coloring, double counting, combinatorics, binary numbers, graph theory, divisibility and remainders, logic, and many others. When students take science and computing classes in high school and college, they will be better prepared for both the foundations and advanced material. The book contains everything that is needed to run a successful mathematical circle for a full year. This book, written by an author actively involved in teaching math- ematical circles for fifteen years, is intended for teachers, math coaches, parents, and math enthusiasts who are interested in teaching math that promotes critical thinking. Motivated students can work through this book on their own. In the interest of fostering a greater awareness and appreciation of mathematics and its connections to other disciplines and everyday life, MSRI and the AMS are publishing books in the Mathematical Circles Library series as a service to young people, their parents and teachers, and the mathematics profession.

For additional information and updates on this book, visit www.ams.org/bookpages/mcl-20

MCL/20