Problem F. Chessboard Coloring

Size: px
Start display at page:

Download "Problem F. Chessboard Coloring"

Transcription

1 Problem F Chessboard Coloring You have a chessboard with N rows and N columns. You want to color each of the cells with exactly N colors (colors are numbered from 0 to N 1). A coloring is valid if and only if no row or no columns contains a duplicate color. That means in the final coloring each cell should be colored by a color from 0 to N 1. No row will contain two cells of the same color and same for the no column. Your friend already colored some of the cells in the top left corner (cells that are in the first R row and in the first C columns). Your job is to color the rest of the cells or tell it is impossible to color. starts with an integer T(1 T 50), the number of test cases. Each test case starts with a line containing integers N(1 T 50), R (0 R N) and C (0 C N). Each of the next R line contains C integers in each line. The j th integer in the i th line indicates the color of the cell located at row i and column j. The initial coloring will be always valid. That means No row or column will have duplicate integers. The initial colors are between 0 to N 1 inclusive. For each test case output YES when it is possible to color the rest of the cells or NO otherwise. YES 2 2 NO 1 2 YES

2 Problem G Half Nim Half Nim is a 2 player game in which player take turns removing stones from distinct heaps. There are N heaps with a 1,a 2,,a n number of stones. The player is permitted to take any positive number of stones from one pile for a move but no more than half. The player who cannot make his move loses. Given the number of stones in the piles you are to determine if the first player has a winning strategy. You can assume that both of the players play perfectly. starts with an integer T(1 T 100), the number of test cases. Each test case starts with a line containing N(1 N 100) the number of heaps. Next line contains N integers a 1,a 2,,a n. These numbers are between 1 and 2*10 18 inclusive. For each test case output contains a line in the format Case #x: M where x is the case number (starting from 1) and M will be YES if the first player wins and NO if the first player cannot win Case #1: NO Case #2: YES Case #: NO

3 Problem H Point inside a Polygon Given a test point and the vertices of a simple polygon, vertices, determine if the test point is in the interior, in the exterior or on the boundary of the polygon. For simplicity, all sides of the polygon will be horizontal or vertical, and the vertices and the test point will all be at integer coordinates. A simple polygon is a polygon that may or may not be convex, but self intersection is not allowed. Not even at a single point. First line of the input contains T the number of test cases. Each test case starts with a line containing N the number of points of the polygon. N is between and 100 inclusive. Each of the next N line contains 2 integers X and Y the co ordinate of a vertex of the polygon. The vertices will be given in order. No three consecutive points will be collinear. The final line will contain 2 integers TX and TY denoting the coordinate of the test point. All the co ordinates are between 1000 to inclusive. For each test case, output INTERIOR if the point is inside the polygon, EXTERIOR if the point is outside the polygon and BOUNDARY if the point is on the boundary of the polygon INTERIOR EXTERIOR BOUNDARY EXTERIOR

4 Problem I Spiral Consider all positive integers written in the following manner (you can imagine an infinite spiral) You task is to determine the position (row,column) of a given number N, assuming that the center (number 1) has position (0,0). Rows are numbered from top to bottom, columns are numbered from left to right (for example, number is at (1,1)). Your program should ouput a string containing the position of N in form (R,C) where R is the row and C is the column. R and C must not contain any leading zeroes. The first line of the input gives an integer T, which is the number of test cases. Each test case contains an integer N (1 N<2^1). For each test case, output the position as described above. See sample output for further clarification (0,1) (1,1) (-1,-1) (2,-2) (-2,1) (-1,) (-7,221)

5 Problem J Guitar Game You have been invited to a TV game show where you will play against another contestant to win free guitars. At the start of the game, there are n guitar cases arranged in a circle, each of which contains a single guitar. You make the first move by choosing one guitar and removing it from its case. The other player then chooses a guitar and removes it from its case. At this point, there might be one or two groups, where a group is defined as a maximal contiguous set of non empty cases. You continue to take turns choosing guitars, and on each turn, the current player chooses exactly one guitar from each group. The game ends when all the guitars have been chosen. Each player gets to keep all the guitars that he chooses during the game. Your goal is to maximize the total value of the guitars you choose. The guitars in the circle are numbered 0 to n 1 in clockwise order (guitar 0 is next to guitar n 1). Given the values of the guitars, compute the maximum possible total value you can get, assuming your opponent plays a perfect strategy. First line of the input contains T the number of test cases. Each test case starts with a line containing N, the number of guitars. N is between 2 and 100 inclusive. Next line contains N integers denoting the values of the guitars. All the values are between 1 and inclusive. For each test case output the maximum possible total value you can get, assuming your opponent plays a perfect strategy Sample

6 Problem K Marbles in a Bag Your friend Psycho Sid has challenged you to a game. He has a bag containing R red marbles and B blue marbles. There will be an odd number of marbles in the bag, and you go first. On your turn, you reach into the bag and remove a random marble from the bag; each marble may be selected with equal probability. After your turn is over, Sid will reach into the bag and remove a blue marble; if there is no blue marble for Sid to remove, then he wins. If the final marble removed from the bag is blue, you will win. Otherwise, Sid wins. Given the number of red and blue marbles in the bag, determine the probability that you win the game. The first line of the input gives an integer T, which is the number of test cases. Each test case contains 2 integers R and B. Both R and B are between 0 and 000 inclusive. R+B will always be odd. For each case, output the probability that you win the game. digits after the decimal Sample

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

I.M.O. Winter Training Camp 2008: Invariants and Monovariants I.M.. Winter Training Camp 2008: Invariants and Monovariants n math contests, you will often find yourself trying to analyze a process of some sort. For example, consider the following two problems. Sample

More information

BMT 2018 Combinatorics Test Solutions March 18, 2018

BMT 2018 Combinatorics Test Solutions March 18, 2018 . Bob has 3 different fountain pens and different ink colors. How many ways can he fill his fountain pens with ink if he can only put one ink in each pen? Answer: 0 Solution: He has options to fill his

More information

Problem Set 7: Games Spring 2018

Problem Set 7: Games Spring 2018 Problem Set 7: Games 15-95 Spring 018 A. Win or Freeze time limit per test: seconds : standard : standard You can't possibly imagine how cold our friends are this winter in Nvodsk! Two of them play the

More information

Solutions to Exercises on Page 86

Solutions to Exercises on Page 86 Solutions to Exercises on Page 86 #. A number is a multiple of, 4, 5 and 6 if and only if it is a multiple of the greatest common multiple of, 4, 5 and 6. The greatest common multiple of, 4, 5 and 6 is

More information

Standard Sudoku point. 1 point. P a g e 1

Standard Sudoku point. 1 point. P a g e 1 P a g e 1 Standard 1-2 Place a digit from 1 to 6 in each empty cell so that each digit appears exactly once in each row, column and 2X box. 1 point A 6 2 6 2 1 5 1 point B 5 2 2 4 1 1 6 5 P a g e 2 Standard

More information

Senior Math Circles February 10, 2010 Game Theory II

Senior Math Circles February 10, 2010 Game Theory II 1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Senior Math Circles February 10, 2010 Game Theory II Take-Away Games Last Wednesday, you looked at take-away

More information

2015 ACM ICPC Southeast USA Regional Programming Contest. Division 1

2015 ACM ICPC Southeast USA Regional Programming Contest. Division 1 2015 ACM ICPC Southeast USA Regional Programming Contest Division 1 Airports... 1 Checkers... 3 Coverage... 5 Gears... 6 Grid... 8 Hilbert Sort... 9 The Magical 3... 12 Racing Gems... 13 Simplicity...

More information

Week 1. 1 What Is Combinatorics?

Week 1. 1 What Is Combinatorics? 1 What Is Combinatorics? Week 1 The question that what is combinatorics is similar to the question that what is mathematics. If we say that mathematics is about the study of numbers and figures, then combinatorics

More information

LEVEL I. 3. In how many ways 4 identical white balls and 6 identical black balls be arranged in a row so that no two white balls are together?

LEVEL I. 3. In how many ways 4 identical white balls and 6 identical black balls be arranged in a row so that no two white balls are together? LEVEL I 1. Three numbers are chosen from 1,, 3..., n. In how many ways can the numbers be chosen such that either maximum of these numbers is s or minimum of these numbers is r (r < s)?. Six candidates

More information

n r for the number. (n r)!r!

n r for the number. (n r)!r! Throughout we use both the notations ( ) n r and C n n! r for the number (n r)!r! 1 Ten points are distributed around a circle How many triangles have all three of their vertices in this 10-element set?

More information

Jim and Nim. Japheth Wood New York Math Circle. August 6, 2011

Jim and Nim. Japheth Wood New York Math Circle. August 6, 2011 Jim and Nim Japheth Wood New York Math Circle August 6, 2011 Outline 1. Games Outline 1. Games 2. Nim Outline 1. Games 2. Nim 3. Strategies Outline 1. Games 2. Nim 3. Strategies 4. Jim Outline 1. Games

More information

PUTNAM PROBLEMS FINITE MATHEMATICS, COMBINATORICS

PUTNAM PROBLEMS FINITE MATHEMATICS, COMBINATORICS PUTNAM PROBLEMS FINITE MATHEMATICS, COMBINATORICS 2014-B-5. In the 75th Annual Putnam Games, participants compete at mathematical games. Patniss and Keeta play a game in which they take turns choosing

More information

The Mathematics of Playing Tic Tac Toe

The Mathematics of Playing Tic Tac Toe The Mathematics of Playing Tic Tac Toe by David Pleacher Although it has been shown that no one can ever win at Tic Tac Toe unless a player commits an error, the game still seems to have a universal appeal.

More information

ACM ICPC World Finals Warmup 2 At UVa Online Judge. 7 th May 2011 You get 14 Pages 10 Problems & 300 Minutes

ACM ICPC World Finals Warmup 2 At UVa Online Judge. 7 th May 2011 You get 14 Pages 10 Problems & 300 Minutes ACM ICPC World Finals Warmup At UVa Online Judge 7 th May 011 You get 14 Pages 10 Problems & 300 Minutes A Unlock : Standard You are about to finish your favorite game (put the name of your favorite game

More information

Problem A: Ordering supermarket queues

Problem A: Ordering supermarket queues Problem A: Ordering supermarket queues UCL Algorithm Contest Round 2-2014 A big supermarket chain has received several complaints from their customers saying that the waiting time in queues is too long.

More information

INTERNATIONAL MATHEMATICS TOURNAMENT OF TOWNS Junior A-Level Paper, Spring 2014.

INTERNATIONAL MATHEMATICS TOURNAMENT OF TOWNS Junior A-Level Paper, Spring 2014. INTERNATIONAL MATHEMATICS TOURNAMENT OF TOWNS Junior A-Level Paper, Spring 2014. 1. uring Christmas party Santa handed out to the children 47 chocolates and 74 marmalades. Each girl got 1 more chocolate

More information

Grade 7/8 Math Circles Game Theory October 27/28, 2015

Grade 7/8 Math Circles Game Theory October 27/28, 2015 Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Game Theory October 27/28, 2015 Chomp Chomp is a simple 2-player game. There is

More information

Problem A: Complex intersecting line segments

Problem A: Complex intersecting line segments Problem A: Complex intersecting line segments In this problem, you are asked to determine if a set of line segments intersect. The first line of input is a number c 100, the number of test cases. Each

More information

Grade 6 Math Circles Combinatorial Games November 3/4, 2015

Grade 6 Math Circles Combinatorial Games November 3/4, 2015 Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles Combinatorial Games November 3/4, 2015 Chomp Chomp is a simple 2-player game. There

More information

Southeastern European Regional Programming Contest Bucharest, Romania Vinnytsya, Ukraine October 21, Problem A Concerts

Southeastern European Regional Programming Contest Bucharest, Romania Vinnytsya, Ukraine October 21, Problem A Concerts Problem A Concerts File: A.in File: standard output Time Limit: 0.3 seconds (C/C++) Memory Limit: 128 megabytes John enjoys listening to several bands, which we shall denote using A through Z. He wants

More information

Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 2017 Rules: 1. There are six questions to be completed in four hours. 2.

Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 2017 Rules: 1. There are six questions to be completed in four hours. 2. Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 217 Rules: 1. There are six questions to be completed in four hours. 2. All questions require you to read the test data from standard

More information

12. 6 jokes are minimal.

12. 6 jokes are minimal. Pigeonhole Principle Pigeonhole Principle: When you organize n things into k categories, one of the categories has at least n/k things in it. Proof: If each category had fewer than n/k things in it then

More information

Take one! Rules: Two players take turns taking away 1 chip at a time from a pile of chips. The player who takes the last chip wins.

Take one! Rules: Two players take turns taking away 1 chip at a time from a pile of chips. The player who takes the last chip wins. Take-Away Games Introduction Today we will play and study games. Every game will be played by two players: Player I and Player II. A game starts with a certain position and follows some rules. Players

More information

Solving Big Problems

Solving Big Problems Solving Big Problems A 3-Week Book of Big Problems, Solved Solving Big Problems Students July 25 SPMPS/BEAM Contents Challenge Problems 2. Palindromes.................................... 2.2 Pick Your

More information

UW-Madison ACM ICPC Individual Contest

UW-Madison ACM ICPC Individual Contest UW-Madison ACM ICPC Individual Contest October th, 2015 Setup Before the contest begins, log in to your workstation and set up and launch the PC2 contest software using the following instructions. You

More information

Grade 7 & 8 Math Circles. Mathematical Games

Grade 7 & 8 Math Circles. Mathematical Games Faculty of Mathematics Waterloo, Ontario N2L 3G1 The Loonie Game Grade 7 & 8 Math Circles November 19/20/21, 2013 Mathematical Games In the loonie game, two players, and, lay down 17 loonies on a table.

More information

2005 Galois Contest Wednesday, April 20, 2005

2005 Galois Contest Wednesday, April 20, 2005 Canadian Mathematics Competition An activity of the Centre for Education in Mathematics and Computing, University of Waterloo, Waterloo, Ontario 2005 Galois Contest Wednesday, April 20, 2005 Solutions

More information

Figure 1: The Game of Fifteen

Figure 1: The Game of Fifteen 1 FIFTEEN One player has five pennies, the other five dimes. Players alternately cover a number from 1 to 9. You win by covering three numbers somewhere whose sum is 15 (see Figure 1). 1 2 3 4 5 7 8 9

More information

Figure 1: A Checker-Stacks Position

Figure 1: A Checker-Stacks Position 1 1 CHECKER-STACKS This game is played with several stacks of black and red checkers. You can choose any initial configuration you like. See Figure 1 for example (red checkers are drawn as white). Figure

More information

Game, Set, and Match Carl W. Lee September 2016

Game, Set, and Match Carl W. Lee September 2016 Game, Set, and Match Carl W. Lee September 2016 Note: Some of the text below comes from Martin Gardner s articles in Scientific American and some from Mathematical Circles by Fomin, Genkin, and Itenberg.

More information

ProCo 2017 Advanced Division Round 1

ProCo 2017 Advanced Division Round 1 ProCo 2017 Advanced Division Round 1 Problem A. Traveling file: 256 megabytes Moana wants to travel from Motunui to Lalotai. To do this she has to cross a narrow channel filled with rocks. The channel

More information

Cayley Contest (Grade 10) Thursday, February 25, 2010

Cayley Contest (Grade 10) Thursday, February 25, 2010 Canadian Mathematics Competition An activity of the Centre for Education in Mathematics and Computing, University of Waterloo, Waterloo, Ontario Cayley Contest (Grade 10) Thursday, February 2, 2010 Time:

More information

Impartial Combinatorial Games Berkeley Math Circle Intermediate II Ted Alper Evans Hall, room 740 Sept 1, 2015

Impartial Combinatorial Games Berkeley Math Circle Intermediate II Ted Alper Evans Hall, room 740 Sept 1, 2015 Impartial Combinatorial Games Berkeley Math Circle Intermediate II Ted Alper Evans Hall, room 740 Sept 1, 2015 tmalper@stanford.edu 1 Warmups 1.1 (Kozepiskolai Matematikai Lapok, 1980) Contestants B and

More information

We congratulate you on your achievement in reaching the second stage of the Ulpaniada Mathematics Competition and wish you continued success.

We congratulate you on your achievement in reaching the second stage of the Ulpaniada Mathematics Competition and wish you continued success. Dear Participant, We congratulate you on your achievement in reaching the second stage of the Ulpaniada Mathematics Competition and wish you continued success. Please fill in your personal details on this

More information

Team Round University of South Carolina Math Contest, 2018

Team Round University of South Carolina Math Contest, 2018 Team Round University of South Carolina Math Contest, 2018 1. This is a team round. You have one hour to solve these problems as a team, and you should submit one set of answers for your team as a whole.

More information

Solutions of problems for grade R5

Solutions of problems for grade R5 International Mathematical Olympiad Formula of Unity / The Third Millennium Year 016/017. Round Solutions of problems for grade R5 1. Paul is drawing points on a sheet of squared paper, at intersections

More information

18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY

18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY 18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY 1. Three closed boxes lie on a table. One box (you don t know which) contains a $1000 bill. The others are empty. After paying an entry fee, you play the following

More information

2. Nine points are distributed around a circle in such a way that when all ( )

2. Nine points are distributed around a circle in such a way that when all ( ) 1. How many circles in the plane contain at least three of the points (0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)? Solution: There are ( ) 9 3 = 8 three element subsets, all

More information

Contest 1. October 20, 2009

Contest 1. October 20, 2009 Contest 1 October 20, 2009 Problem 1 What value of x satisfies x(x-2009) = x(x+2009)? Problem 1 What value of x satisfies x(x-2009) = x(x+2009)? By inspection, x = 0 satisfies the equation. Problem 1 What

More information

4th Pui Ching Invitational Mathematics Competition. Final Event (Secondary 1)

4th Pui Ching Invitational Mathematics Competition. Final Event (Secondary 1) 4th Pui Ching Invitational Mathematics Competition Final Event (Secondary 1) 2 Time allowed: 2 hours Instructions to Contestants: 1. 100 This paper is divided into Section A and Section B. The total score

More information

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games May 17, 2011 Summary: We give a winning strategy for the counter-taking game called Nim; surprisingly, it involves computations

More information

BRITISH GO ASSOCIATION. Tournament rules of play 31/03/2009

BRITISH GO ASSOCIATION. Tournament rules of play 31/03/2009 BRITISH GO ASSOCIATION Tournament rules of play 31/03/2009 REFERENCES AUDIENCE AND PURPOSE 2 1. THE BOARD, STONES AND GAME START 2 2. PLAY 2 3. KOMI 2 4. HANDICAP 2 5. CAPTURE 2 6. REPEATED BOARD POSITION

More information

Binary Games. Keep this tetrahedron handy, we will use it when we play the game of Nim.

Binary Games. Keep this tetrahedron handy, we will use it when we play the game of Nim. Binary Games. Binary Guessing Game: a) Build a binary tetrahedron using the net on the next page and look out for patterns: i) on the vertices ii) on each edge iii) on the faces b) For each vertex, we

More information

Plan. Related courses. A Take-Away Game. Mathematical Games , (21-801) - Mathematical Games Look for it in Spring 11

Plan. Related courses. A Take-Away Game. Mathematical Games , (21-801) - Mathematical Games Look for it in Spring 11 V. Adamchik D. Sleator Great Theoretical Ideas In Computer Science Mathematical Games CS 5-25 Spring 2 Lecture Feb., 2 Carnegie Mellon University Plan Introduction to Impartial Combinatorial Games Related

More information

Subtraction games with expandable subtraction sets

Subtraction games with expandable subtraction sets with expandable subtraction sets Bao Ho Department of Mathematics and Statistics La Trobe University Monash University April 11, 2012 with expandable subtraction sets Outline The game of Nim Nim-values

More information

Problem 2A Consider 101 natural numbers not exceeding 200. Prove that at least one of them is divisible by another one.

Problem 2A Consider 101 natural numbers not exceeding 200. Prove that at least one of them is divisible by another one. 1. Problems from 2007 contest Problem 1A Do there exist 10 natural numbers such that none one of them is divisible by another one, and the square of any one of them is divisible by any other of the original

More information

Sept. 26, 2012

Sept. 26, 2012 Mathematical Games Marin Math Circle linda@marinmathcircle.org Sept. 26, 2012 Some of these games are from the book Mathematical Circles: Russian Experience by D. Fomin, S. Genkin, and I. Itenberg. Thanks

More information

Problem A To and Fro (Problem appeared in the 2004/2005 Regional Competition in North America East Central.)

Problem A To and Fro (Problem appeared in the 2004/2005 Regional Competition in North America East Central.) Problem A To and Fro (Problem appeared in the 2004/2005 Regional Competition in North America East Central.) Mo and Larry have devised a way of encrypting messages. They first decide secretly on the number

More information

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015 Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015 Chomp Chomp is a simple 2-player

More information

(b) In the position given in the figure below, find a winning move, if any. (b) In the position given in Figure 4.2, find a winning move, if any.

(b) In the position given in the figure below, find a winning move, if any. (b) In the position given in Figure 4.2, find a winning move, if any. Math 5750-1: Game Theory Midterm Exam Mar. 6, 2015 You have a choice of any four of the five problems. (If you do all 5, each will count 1/5, meaning there is no advantage.) This is a closed-book exam,

More information

Problem A. Jumbled Compass

Problem A. Jumbled Compass Problem A. Jumbled Compass file: 1 second Jonas is developing the JUxtaPhone and is tasked with animating the compass needle. The API is simple: the compass needle is currently in some direction (between

More information

Irish Collegiate Programming Contest Problem Set

Irish Collegiate Programming Contest Problem Set Irish Collegiate Programming Contest 2011 Problem Set University College Cork ACM Student Chapter March 26, 2011 Contents Instructions 2 Rules........................................... 2 Testing and Scoring....................................

More information

WPF PUZZLE GP 2018 ROUND 7 INSTRUCTION BOOKLET. Host Country: Netherlands. Bram de Laat. Special Notes: None.

WPF PUZZLE GP 2018 ROUND 7 INSTRUCTION BOOKLET. Host Country: Netherlands. Bram de Laat. Special Notes: None. W UZZLE G 0 NSTRUCTON BOOKLET Host Country: Netherlands Bram de Laat Special Notes: None. oints:. Balance 7. Letter Bags 5. Letter Bags. Letter Weights 5 5. Letter Weights 7 6. Masyu 7 7. Masyu. Tapa 6

More information

CS 491 CAP Intro to Combinatorial Games. Jingbo Shang University of Illinois at Urbana-Champaign Nov 4, 2016

CS 491 CAP Intro to Combinatorial Games. Jingbo Shang University of Illinois at Urbana-Champaign Nov 4, 2016 CS 491 CAP Intro to Combinatorial Games Jingbo Shang University of Illinois at Urbana-Champaign Nov 4, 2016 Outline What is combinatorial game? Example 1: Simple Game Zero-Sum Game and Minimax Algorithms

More information

On Modular Extensions to Nim

On Modular Extensions to Nim On Modular Extensions to Nim Karan Sarkar Mentor: Dr. Tanya Khovanova Fifth Annual Primes Conference 16 May 2015 An Instructive Example: Nim The Rules Take at least one token from some chosen pile. Player

More information

Mathematics. Programming

Mathematics. Programming Mathematics for the Digital Age and Programming in Python >>> Second Edition: with Python 3 Maria Litvin Phillips Academy, Andover, Massachusetts Gary Litvin Skylight Software, Inc. Skylight Publishing

More information

Olympiad Combinatorics. Pranav A. Sriram

Olympiad Combinatorics. Pranav A. Sriram Olympiad Combinatorics Pranav A. Sriram August 2014 Chapter 2: Algorithms - Part II 1 Copyright notices All USAMO and USA Team Selection Test problems in this chapter are copyrighted by the Mathematical

More information

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE The inclusion-exclusion principle (also known as the sieve principle) is an extended version of the rule of the sum. It states that, for two (finite) sets, A

More information

Counters in a Cup In and Out. The student sets up the cup, drops the counters on it, and records how many landed in and out of the cup.

Counters in a Cup In and Out. The student sets up the cup, drops the counters on it, and records how many landed in and out of the cup. Counters in a Cup In and Out Cup Counters Recording Paper The student sets up the cup, drops the counters on it, and records how many landed in and out of the cup. 3 + 4 =7 2 + 5 =7 For subtraction, take

More information

Junior Circle Games with coins and chessboards

Junior Circle Games with coins and chessboards Junior Circle Games with coins and chessboards 1. a.) There are 4 coins in a row. Let s number them 1 through 4. You are allowed to switch any two coins that have a coin between them. (For example, you

More information

Counting Things. Tom Davis March 17, 2006

Counting Things. Tom Davis   March 17, 2006 Counting Things Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles March 17, 2006 Abstract We present here various strategies for counting things. Usually, the things are patterns, or

More information

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game.

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game. CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25 Homework #1 ( Due: Oct 10 ) Figure 1: The laser game. Task 1. [ 60 Points ] Laser Game Consider the following game played on an n n board,

More information

4th Bay Area Mathematical Olympiad

4th Bay Area Mathematical Olympiad 2002 4th ay Area Mathematical Olympiad February 26, 2002 The time limit for this exam is 4 hours. Your solutions should be clearly written arguments. Merely stating an answer without any justification

More information

TOURNAMENT ROUND. Round 1

TOURNAMENT ROUND. Round 1 Round 1 1. Find all prime factors of 8051. 2. Simplify where x = 628,y = 233,z = 340. [log xyz (x z )][1+log x y +log x z], 3. In prokaryotes, translation of mrna messages into proteins is most often initiated

More information

2009 ACM ICPC Southeast USA Regional Programming Contest. 7 November, 2009 PROBLEMS

2009 ACM ICPC Southeast USA Regional Programming Contest. 7 November, 2009 PROBLEMS 2009 ACM ICPC Southeast USA Regional Programming Contest 7 November, 2009 PROBLEMS A: Block Game... 1 B: Euclid... 3 C: Museum Guards... 5 D: Knitting... 7 E: Minesweeper... 9 F: The Ninja Way... 10 G:

More information

UCF Local Contest August 31, 2013

UCF Local Contest August 31, 2013 Circles Inside a Square filename: circle You have 8 circles of equal size and you want to pack them inside a square. You want to minimize the size of the square. The following figure illustrates the minimum

More information

Problem Solving By Cynthia Northrup

Problem Solving By Cynthia Northrup UCI Math Circle September 28, 2013 Problem Solving By Cynthia Northrup 1. Graph Theory 2. The Game of Nim 3. The Calendar Game 4. Operating a Security System 5. Planets 6. Pie and Pawns 7. Games of Stones

More information

SAMPLE !!CAUTION!! THIS IS ONLY A SAMPLE PAPER !!CAUTION!! THIS PAPER IS MEANT ONLY FOR PRACTICE

SAMPLE !!CAUTION!! THIS IS ONLY A SAMPLE PAPER !!CAUTION!! THIS PAPER IS MEANT ONLY FOR PRACTICE SAMPLE THIS PAPER IS MEANT ONLY FOR PRACTICE PARTICIPANTS MUST NOT USE THIS SAMPLE AS THE ONLY QUESTIONS TO PREPARE OR TOPICS TO STUDY ACTUAL COMPETITION WILL BE VARIED AND COVER HIGH SCHOOL PORTION OF

More information

NCPC 2007 Problem C: Optimal Parking 7. Problem C. Optimal Parking

NCPC 2007 Problem C: Optimal Parking 7. Problem C. Optimal Parking NCPC 2007 Problem C: Optimal Parking 7 Problem C A Optimal Parking When shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs. Can you help

More information

OCTAGON 5 IN 1 GAME SET

OCTAGON 5 IN 1 GAME SET OCTAGON 5 IN 1 GAME SET CHESS, CHECKERS, BACKGAMMON, DOMINOES AND POKER DICE Replacement Parts Order direct at or call our Customer Service department at (800) 225-7593 8 am to 4:30 pm Central Standard

More information

Final Practice Problems: Dynamic Programming and Max Flow Problems (I) Dynamic Programming Practice Problems

Final Practice Problems: Dynamic Programming and Max Flow Problems (I) Dynamic Programming Practice Problems Final Practice Problems: Dynamic Programming and Max Flow Problems (I) Dynamic Programming Practice Problems To prepare for the final first of all study carefully all examples of Dynamic Programming which

More information

2008 ACM ICPC Southeast USA Regional Programming Contest. 25 October, 2008 PROBLEMS

2008 ACM ICPC Southeast USA Regional Programming Contest. 25 October, 2008 PROBLEMS ACM ICPC Southeast USA Regional Programming Contest 25 October, PROBLEMS A: Series / Parallel Resistor Circuits...1 B: The Heart of the Country...3 C: Lawrence of Arabia...5 D: Shoring Up the Levees...7

More information

# 1. As shown, the figure has been divided into three identical parts: red, blue, and green. The figures are identical because the blue and red

# 1. As shown, the figure has been divided into three identical parts: red, blue, and green. The figures are identical because the blue and red # 1. As shown, the figure has been divided into three identical parts: red, blue, and green. The figures are identical because the blue and red figures are already in the correct orientation, and the green

More information

PRIMES STEP Plays Games

PRIMES STEP Plays Games PRIMES STEP Plays Games arxiv:1707.07201v1 [math.co] 22 Jul 2017 Pratik Alladi Neel Bhalla Tanya Khovanova Nathan Sheffield Eddie Song William Sun Andrew The Alan Wang Naor Wiesel Kevin Zhang Kevin Zhao

More information

Counting Things Solutions

Counting Things Solutions Counting Things Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles March 7, 006 Abstract These are solutions to the Miscellaneous Problems in the Counting Things article at:

More information

Crossing Game Strategies

Crossing Game Strategies Crossing Game Strategies Chloe Avery, Xiaoyu Qiao, Talon Stark, Jerry Luo March 5, 2015 1 Strategies for Specific Knots The following are a couple of crossing game boards for which we have found which

More information

The 2013 British Informatics Olympiad

The 2013 British Informatics Olympiad Sponsored by Time allowed: 3 hours The 2013 British Informatics Olympiad Instructions You should write a program for part (a) of each question, and produce written answers to the remaining parts. Programs

More information

ACM International Collegiate Programming Contest 2010

ACM International Collegiate Programming Contest 2010 International Collegiate acm Programming Contest 2010 event sponsor ACM International Collegiate Programming Contest 2010 Latin American Regional Contests October 22nd-23rd, 2010 Contest Session This problem

More information

Coin Cappers. Tic Tac Toe

Coin Cappers. Tic Tac Toe Coin Cappers Tic Tac Toe Two students are playing tic tac toe with nickels and dimes. The player with the nickels has just moved. Itʼs now your turn. The challenge is to place your dime in the only square

More information

Grade 6 Math Circles. Math Jeopardy

Grade 6 Math Circles. Math Jeopardy Faculty of Mathematics Waterloo, Ontario N2L 3G1 Introduction Grade 6 Math Circles November 28/29, 2017 Math Jeopardy Centre for Education in Mathematics and Computing This lessons covers all of the material

More information

GENERALIZATION: RANK ORDER FILTERS

GENERALIZATION: RANK ORDER FILTERS GENERALIZATION: RANK ORDER FILTERS Definition For simplicity and implementation efficiency, we consider only brick (rectangular: wf x hf) filters. A brick rank order filter evaluates, for every pixel in

More information

Non-attacking queens on a triangle

Non-attacking queens on a triangle Non-attacking queens on a triangle Gabriel Nivasch gnivasch@yahoo.com Eyal Lev elgr@actcom.co.il Revised April 26, 2005 Most readers are surely familiar with the problem of placing eight nonattacking queens

More information

WPF PUZZLE GP 2018 ROUND 1 COMPETITION BOOKLET. Host Country: Turkey. Serkan Yürekli, Salih Alan, Fatih Kamer Anda, Murat Can Tonta A B H G A B I H

WPF PUZZLE GP 2018 ROUND 1 COMPETITION BOOKLET. Host Country: Turkey. Serkan Yürekli, Salih Alan, Fatih Kamer Anda, Murat Can Tonta A B H G A B I H Host Country: urkey WPF PUZZE GP 0 COMPEON BOOKE Serkan Yürekli, Salih Alan, Fatih Kamer Anda, Murat Can onta ROUND Special Notes: Note that there is partial credit available on puzzle for a close answer.

More information

Junior Circle Meeting 5 Probability. May 2, ii. In an actual experiment, can one get a different number of heads when flipping a coin 100 times?

Junior Circle Meeting 5 Probability. May 2, ii. In an actual experiment, can one get a different number of heads when flipping a coin 100 times? Junior Circle Meeting 5 Probability May 2, 2010 1. We have a standard coin with one side that we call heads (H) and one side that we call tails (T). a. Let s say that we flip this coin 100 times. i. How

More information

Distribution of Aces Among Dealt Hands

Distribution of Aces Among Dealt Hands Distribution of Aces Among Dealt Hands Brian Alspach 3 March 05 Abstract We provide details of the computations for the distribution of aces among nine and ten hold em hands. There are 4 aces and non-aces

More information

On Variations of Nim and Chomp

On Variations of Nim and Chomp arxiv:1705.06774v1 [math.co] 18 May 2017 On Variations of Nim and Chomp June Ahn Benjamin Chen Richard Chen Ezra Erives Jeremy Fleming Michael Gerovitch Tejas Gopalakrishna Tanya Khovanova Neil Malur Nastia

More information

NIM Games: Handout 1

NIM Games: Handout 1 NIM Games: Handout 1 Based on notes by William Gasarch 1 One-Pile NIM Games Consider the following two-person game in which players alternate making moves. There are initially n stones on the board. During

More information

Organization Team Team ID# If each of the congruent figures has area 1, what is the area of the square?

Organization Team Team ID# If each of the congruent figures has area 1, what is the area of the square? 1. [4] A square can be divided into four congruent figures as shown: If each of the congruent figures has area 1, what is the area of the square? 2. [4] John has a 1 liter bottle of pure orange juice.

More information

Problem A. Worst Locations

Problem A. Worst Locations Problem A Worst Locations Two pandas A and B like each other. They have been placed in a bamboo jungle (which can be seen as a perfect binary tree graph of 2 N -1 vertices and 2 N -2 edges whose leaves

More information

CS 32 Puzzles, Games & Algorithms Fall 2013

CS 32 Puzzles, Games & Algorithms Fall 2013 CS 32 Puzzles, Games & Algorithms Fall 2013 Study Guide & Scavenger Hunt #2 November 10, 2014 These problems are chosen to help prepare you for the second midterm exam, scheduled for Friday, November 14,

More information

Surreal Numbers and Games. February 2010

Surreal Numbers and Games. February 2010 Surreal Numbers and Games February 2010 1 Last week we began looking at doing arithmetic with impartial games using their Sprague-Grundy values. Today we ll look at an alternative way to represent games

More information

Introduction to Spring 2009 Artificial Intelligence Final Exam

Introduction to Spring 2009 Artificial Intelligence Final Exam CS 188 Introduction to Spring 2009 Artificial Intelligence Final Exam INSTRUCTIONS You have 3 hours. The exam is closed book, closed notes except a two-page crib sheet, double-sided. Please use non-programmable

More information

A Winning Strategy for the Game of Antonim

A Winning Strategy for the Game of Antonim A Winning Strategy for the Game of Antonim arxiv:1506.01042v1 [math.co] 1 Jun 2015 Zachary Silbernick Robert Campbell June 4, 2015 Abstract The game of Antonim is a variant of the game Nim, with the additional

More information

GEOGRAPHY PLAYED ON AN N-CYCLE TIMES A 4-CYCLE

GEOGRAPHY PLAYED ON AN N-CYCLE TIMES A 4-CYCLE GEOGRAPHY PLAYED ON AN N-CYCLE TIMES A 4-CYCLE M. S. Hogan 1 Department of Mathematics and Computer Science, University of Prince Edward Island, Charlottetown, PE C1A 4P3, Canada D. G. Horrocks 2 Department

More information

of Nebraska - Lincoln

of Nebraska - Lincoln University of Nebraska - Lincoln DigitalCommons@University of Nebraska - Lincoln MAT Exam Expository Papers Math in the Middle Institute Partnership 7-2006 The Game of Nim Dean J. Davis University of Nebraska-Lincoln

More information

F rederic F Pool. V o l u m e O n e

F rederic F Pool. V o l u m e O n e F rederic F Pool V o l u m e O n e The Rosetta Stone of Guitar specializes in offering the guitar student a simple way to explore fundamental concepts of music theory as they apply to the guitar. This

More information

Game 0: One Pile, Last Chip Loses

Game 0: One Pile, Last Chip Loses Take Away Games II: Nim April 24, 2016 The Rules of Nim The game of Nim is a two player game. There are piles of chips which the players take turns taking chips from. During a single turn, a player can

More information

MATHEMATICS LEVEL: (B - Γ Λυκείου)

MATHEMATICS LEVEL: (B - Γ Λυκείου) MATHEMATICS LEVEL: 11 12 (B - Γ Λυκείου) 10:00 11:00, 20 March 2010 THALES FOUNDATION 1 3 points 1. Using the picture to the right we can observe that 1+3+5+7 = 4 x 4. What is the value of 1 + 3 + 5 +

More information

BmMT 2015 Puzzle Round November 7, 2015

BmMT 2015 Puzzle Round November 7, 2015 BMmT Puzzle Round 2015 The puzzle round is a team round. You will have one hour to complete the twelve puzzles on the round. Calculators and other electronic devices are not permitted. The puzzles are

More information

THINGS TO DO WITH A GEOBOARD

THINGS TO DO WITH A GEOBOARD THINGS TO DO WITH A GEOBOARD The following list of suggestions is indicative of exercises and examples that can be worked on the geoboard. Simpler, as well as, more difficult suggestions can easily be

More information