Langford s Problem. Moti Ben-Ari. Department of Science Teaching. Weizmann Institute of Science.

Similar documents
On Some Properties of Digital Roots

1. By using truth tables prove that, for all statements P and Q, the statement

Resolution Proofs of Generalized Pigeonhole Principles

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Section 7 Fundamentals of Sequences and Series

Math 2112 Solutions Assignment 5

MATH 324 Summer 2006 Elementary Number Theory Solutions to Assignment 2 Due: Thursday July 27, 2006

Lecture 23 Rearrangement Inequality

PROPERTIES OF AN EULER SQUARE

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Different kinds of Mathematical Induction

Solutions to Math 347 Practice Problems for the final

Mini Lecture 10.1 Radical Expressions and Functions. 81x d. x 4x 4

SEQUENCES AND SERIES

and each factor on the right is clearly greater than 1. which is a contradiction, so n must be prime.

Chapter 7 COMBINATIONS AND PERMUTATIONS. where we have the specific formula for the binomial coefficients:

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is

End-of-Year Contest. ERHS Math Club. May 5, 2009

SEQUENCE AND SERIES NCERT

Roger Apéry's proof that zeta(3) is irrational

Sums, products and sequences

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

Weakly Connected Closed Geodetic Numbers of Graphs

ARITHMETIC PROGRESSION

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

2.4 - Sequences and Series

SOME TRIBONACCI IDENTITIES

ARITHMETIC PROGRESSIONS

Math F215: Induction April 7, 2013

Section 5.1 The Basics of Counting

Induction: Solutions

Square-Congruence Modulo n

subcaptionfont+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0 subcaption ALGEBRAIC COMBINATORICS LECTURE 8 TUESDAY, 2/16/2016

Mathematical Induction

Putnam Training Exercise Counting, Probability, Pigeonhole Principle (Answers)

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

CS / MCS 401 Homework 3 grader solutions

Zeros of Polynomials

CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

3sin A 1 2sin B. 3π x is a solution. 1. If A and B are acute positive angles satisfying the equation 3sin A 2sin B 1 and 3sin 2A 2sin 2B 0, then A 2B

Chapter Vectors

Optimally Sparse SVMs

Essential Question How can you recognize an arithmetic sequence from its graph?

THE KENNESAW STATE UNIVERSITY HIGH SCHOOL MATHEMATICS COMPETITION PART II Calculators are NOT permitted Time allowed: 2 hours

Find a formula for the exponential function whose graph is given , 1 2,16 1, 6

1 Lecture 2: Sequence, Series and power series (8/14/2012)

Optimization Methods: Linear Programming Applications Assignment Problem 1. Module 4 Lecture Notes 3. Assignment Problem

GENERALIZATIONS OF ZECKENDORFS THEOREM. TilVIOTHY J. KELLER Student, Harvey Mudd College, Claremont, California

arxiv: v1 [math.nt] 10 Dec 2014

Intermediate Math Circles November 4, 2009 Counting II

Summer High School 2009 Aaron Bertram

Chapter 6 Infinite Series

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

IP Reference guide for integer programming formulations.

Commutativity in Permutation Groups

Sequences of Definite Integrals, Factorials and Double Factorials

MATH 304: MIDTERM EXAM SOLUTIONS

6.3 Testing Series With Positive Terms

w (1) ˆx w (1) x (1) /ρ and w (2) ˆx w (2) x (2) /ρ.

NUMERICAL METHODS FOR SOLVING EQUATIONS

USA Mathematical Talent Search Round 3 Solutions Year 27 Academic Year

Lecture 2 Clustering Part II

Counting Well-Formed Parenthesizations Easily

NEW FAST CONVERGENT SEQUENCES OF EULER-MASCHERONI TYPE

Pairs of disjoint q-element subsets far from each other

Bertrand s Postulate

Fermat s Little Theorem. mod 13 = 0, = }{{} mod 13 = 0. = a a a }{{} mod 13 = a 12 mod 13 = 1, mod 13 = a 13 mod 13 = a.

Week 5-6: The Binomial Coefficients

Chapter 0. Review of set theory. 0.1 Sets

M17 MAT25-21 HOMEWORK 5 SOLUTIONS

Metric Space Properties

On a Smarandache problem concerning the prime gaps

Solutions to Problem Set 8

Injections, Surjections, and the Pigeonhole Principle

Infinite Sequences and Series

M A T H F A L L CORRECTION. Algebra I 1 4 / 1 0 / U N I V E R S I T Y O F T O R O N T O

A representation approach to the tower of Hanoi problem

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary

A 2nTH ORDER LINEAR DIFFERENCE EQUATION

Solutions. tan 2 θ(tan 2 θ + 1) = cot6 θ,

NAME: ALGEBRA 350 BLOCK 7. Simplifying Radicals Packet PART 1: ROOTS

Solutions to Problem Set 7

Math 475, Problem Set #12: Answers

Chapter 4. Fourier Series

You may work in pairs or purely individually for this assignment.

Lecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) =

Bounds for the Positive nth-root of Positive Integers

Assignment 5: Solutions

THE SOLUTION OF NONLINEAR EQUATIONS f( x ) = 0.

Recurrence Relations

MA131 - Analysis 1. Workbook 2 Sequences I

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

An Introduction to Randomized Algorithms

ON SOME DIOPHANTINE EQUATIONS RELATED TO SQUARE TRIANGULAR AND BALANCING NUMBERS

Math 155 (Lecture 3)

Alternating Series. 1 n 0 2 n n THEOREM 9.14 Alternating Series Test Let a n > 0. The alternating series. 1 n a n.

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

Properties and Tests of Zeros of Polynomial Functions

4 A Survey of Congruent Results 1

Transcription:

Lagford s Problem Moti Be-Ari Departmet of Sciece Teachig Weizma Istitute of Sciece http://www.weizma.ac.il/sci-tea/beari/ c 017 by Moti Be-Ari. This work is licesed uder the Creative Commos Attributio-ShareAlike 3.0 Uported Licese. To view a copy of this licese, visit http://creativecommos.org/liceses/by-sa/3.0/ or sed a letter to Creative Commos, 444 Castro Street, Suite 900, Moutai View, Califoria, 94041, USA.

The Defiitio of Lagford s problem Scottish mathematicia C. Dudley Lagford oticed that his so had arraged colored blocks i the followig arragemet: There is oe block betwee the two red blocks, two blocks betwee the blue blocks ad three blocks betwee the gree blocks. Therefore, the problem ca be expressed as follows: Give the bag of umbers {1,1,,,3,3}, ca they be arraged i a sequece such that for 1 i 3 there are i umbers betwee the two occurreces of i? 1 From the arragemet of the colored blocks, we see that a solutio is 3113. The geeralized problem is: Lagford s Problem L() Give the bag of umbers {1,1,,,3,3,...,,}, ca they be arraged i a sequece such that for 1 i there are i umbers betwee the two occurreces of i? Lagford s problem as a coverig problem Lagford s problem ca be posed usig arrays. For L(3), there are 6 colums, oe for each of the 3 umbers. The rows are defied by the defiitio of the problem: the two occurreces of k must have k umbers betwee them. It is easy to see that there are four possible placemets of 1, three of ad two of 3: 1 3 4 5 6 1 1 1 1 1 3 1 1 4 1 1 5 6 7 8 3 3 9 3 3 To solve the problem, we eed to select oe row for the 1 s i the sequece, oe row for the s ad oe row for the 3 s, such that if we stack these rows o top of each other, o colum cotais more tha oe umber: 1 A bag is like a set except that duplicate elemets may appear.

1 3 4 5 6 1 1 7 8 3 3 First, ote that row 9 is ot eeded because of symmetry: startig with row 9 just gives the reversal of the sequece obtaied by startig with row 8. Row 8 is the oly oe cotaiig 3 s so it must be chose ad the result is 3 3. Ay row with umbers i colums 1 ad 5 ca o loger be used, because oly oe umber ca be placed at each positio. Let us deote the permissible ad forbidde rows by 1,, 3, 4, 5, 6, 7, 8. Row 7 is the oly remaiig row cotaiig s so must be chose ad the result is 3 3. Deletig rows that ca o loger be used gives: 1,, 3, 4, 5, 6, 7, 8. Choosig the oly remaiig row, row, gives the solutio 3113. Furthermore, the aalysis has show that this is the oly solutio. Here is the array for L(4): Lagford s problem L(4) 1 3 4 5 6 7 8 1 1 1 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 8 9 10 11 1 3 3 13 3 3 14 3 3 15 3 3 16 4 4 17 4 4 18 4 4 We leave it to the reader to show that the oly solutio is 413143. 3

For which values of is Lagford s problem solvable? Theorem L() has a solutio if ad oly if = 4k or = 4k 1. We give two proofs of the forward implicatio based o Miller (014).. For the coverse, see Davies (1959). Proof 1 If the first occurrece of the umber k is at positio i k, the secod occurrece is at positio k + 1. The sum of the positios of all the umbers is: S = ( k + 1). But S, the sum of the positios, is simply 1 + + 3 + +, so: S = ( + 1) k =, usig the formula for the sum of a arithmetic progressio. Simplifyig: S = ( k + 1) = Equatig the two formulas for S gives: (k + 1) = ( + 3). ( + 3) = ( + 1), ad: i k = 1 ( ( + 1) ) ( + 3) = 3. 4 The left-had side is the sum of itegers (the positios), so it must be a iteger. The right-had side must also be a iteger. Whe is 3 3 divisible by 4? Factorig gives 3 = (3 1), so if is a multiple of 4, the product is divisible by 4. Whe is 3 1 divisible by 4? Ay iteger ca be expressed as = 4i + j for j = 0, 1,, 3. If 3 1 is divisible by 4, the so is 3(4i + j) 1 = 1i + 3j 1. Clearly, 1i is divisible by 4, ad it is easy to see that 3j 1 is divisible by 4 (for j = 0, 1,, 3) oly if j = 3, that is, = 4i + 3 = 4(i + 1) 1. 4

Proof Cosider the solutio for = 4: 1 3 4 5 6 7 8 4 1 3 1 4 3 The positios of the occurreces of 4 are 1 ad 6, ad the positios of the occurreces of are 5 ad 8. Oe positio is odd ad oe is eve. I the geeral case, if i is the positio of the first occurrece of a eve umber k, the the positio of the secod occurrece is i + k + 1. Sice k is eve, k + 1 is odd. Sice odd plus odd is eve ad eve plus odd is odd, oe of i, i + k + 1 must be odd ad the other eve. The positios of the occurreces of 1 are ad 4 ad the positios of the occurreces of 3 are 3 ad 7. For ay odd umber k, k + 1 is eve, so if i is eve, the i + k + 1 is eve, ad if i is odd, the i + k + 1 is odd. Obviously, the positios 1,,..., 1, cotai a equal umber of eve ad odd positios. Whe placig the two occurreces of a umber i the sequece, they take over two positios. Whe the sequece is complete, there must be a equal umber of eve ad odd positios take over. We use the term parity for the differece betwee the umber of eve ad odd positios take. Iitially, the parity is zero, ad if the problem has a solutio, the completed sequece also has a parity of zero. Whe the two occurreces of a eve umber is placed, they take over oe eve positio ad oe odd positio, so the parity remais the same. Whe the two occurreces of a odd umber is placed, the parity becomes + or, so we must be able to associate this pair with aother odd pair placed at positios that balace out the parity. I other words, there must be a eve umber of pairs of odd umbers, that is, there must be a eve umber of odd umbers i {1,..., }. The theorem claims that if there is a solutio, either = 4k or = 4k 1, ad if there is o solutio, the either = 4k or 4k 3. The proof is by iductio. For the base case, k = 1, it is easy to see that the sets {1} ad {1, } have o solutio; furthermore, they have a odd umber of odd umbers. For the sets {1,, 3} ad {1,, 3, 4}, we showed that they have solutios; furthermore, they have a eve umber of odd umbers. The iductive hypothesis is that solutios are possible for {1,..., 4k j}, k 1, j = 0, 1 (ad they have a eve umber of odd umbers), ad solutios are impossible for j =, 3 (ad they have a odd umber of odd umbers). Sice 4k + 1 is odd, addig it icreases the umber of odd umbers by oe, so there is o solutio. Similarly, addig 4k + 1, 4k + has o solutio sice 4k + 1 is odd ad 4k + is eve. Addig 4k + 1, 4k +, 4k + 3 or 4k + 1, 4k +, 4k + 3, 4k + 4 adds two odd umbers so there is still a eve umber of odd umbers ad there ca be a solutio. We have proved the claim for 4(k + 1) j ad by iductio the theorem holds for all 1. 5

SAT solvig I propositioal logic, a assigmet of true ad false to the atomic propositios of a formula A satisfies A if A evaluates to true. A SAT solver is a computer program that checks if a formula i CNF is satisfiable or usatisfiable. (For a overview of SAT solvig, see Be-Ari (01), Chapter 6.) Kuth (015) shows how solutios to Lagford s problem ca be foud by a SAT solver, by ecodig the array represetatio as a CNF formula. Let x i be true if row i is chose. For L(3), the followig clauses ecode that exactly oe of rows 1 4 cotaiig 1 must be chose: [x1,x,x3,x4], [~x1,~x], [~x1,~x3], [~x1,~x4], [~x,~x3], [~x,~x4], [~x3,~x4] The first clause ecodes that at least oe row must be chose. The ext clause ecodes that if row 1 is chose, x 1 = true, the row caot be chose, x = false, ad similarly for the other pairs of rows. Other clauses ecode that exactly oe of rows 5, 6, 7 must be chose ad that the row 8 must be chose. Clauses are also eeded to express the costraits o the colums. For example, colum 1 requires that exactly oe of rows 1, 5, 8 be chose: [x1,x5,x8], [~x1,~x5], [~x1,~x8], [~x5,~x8] Ruig a SAT solver returs the solutio that rows, 7 ad 8 should be chose: Satisfyig assigmets: [x1=0,x=1,x3=0,x4=0,x5=0,x6=0,x7=1,x8=1] CNF formulas for L(3) ad L(4) ca be foud i the archive for LearSAT, a SAT solver I developed for teachig. O my website http://www.weizma.ac.il/sci-tea/beari/ follow the liks for Software ad Learig Materials ad the LearSAT. Refereces M. Be-Ari. Mathematical Logic for Computer Sciece (Third Editio), Spriger, 01. R.O. Davies. O Lagford s problem (II), Mathematical Gazette, 43, 1959, 53-5. D.E. Kuth. The Art of Computer Programmig, Volume 4, Fascicle 6: Satisfiability, Pearso, 015. J.E. Miller. Lagford s Problem, Remixed, http://dialectrix.com/lagford.html, 014. 6