A DYNAMIC PROGRAMMING APPROACH. Guy Hawerstock Dan Ilan

Size: px
Start display at page:

Download "A DYNAMIC PROGRAMMING APPROACH. Guy Hawerstock Dan Ilan"

Transcription

1 THE n-queens PROBLEM A DYNAMIC PROGRAMMING APPROACH Guy Hawerstock Dan Ilan

2 A Short Chess Review A queen in chess can move anywhere along her row, column or diagonals. A queen can strike any unit by moving to its square.

3 The 8-queen Problem How many ways are there to place 8 queens on a chessboard so that no 2 queens will be on the same row, column or diagonal?

4 A Legal placement of 8-queens Notice that the 8-queen problem is a counting problem. The problem entertained the thoughts of mathematicians since the middle of the 19 th century. Used today as a benchmark problem.

5 From 8-queens to n-queens A generalization of the chess problem. How many ways are there to place n-queens on a n n chessboard so that no two queens will be placed on the same row, column or diagonal? Is there a feasible answer to the problem?

6 A Naive Approach Brute Force The simplest naive implementation: Given an n n Chessboard, try every possible placement of n-queens on the board. Sum up the placements that were legal. The Run-Time is clearly non-feasible (even when n is relatively small): The number of different placements: n 2 n

7 A Hard Problem Reductions from Other NP-hard problems exist. We ll show an algorithm that solves the problem in O(f(n) 8 n ) f(n) is a low-order polynomial.

8 Basic Terminology - Lines Line a maximal co-linear set of squares on the chessboard (row/column/diagonal) Closed Line if a queen is placed in one of the line s squares, the line is considered closed.

9 Lines How Many Lines are there in a n n chessboards? n rows. n columns. 2n 1diagonals from left-to-right 2n 1 diagonals from right-to-left A total of 6n 2 lines. 4 distinct lines pass through each square. 1 row, 1 column, 2 diagonals

10 Terminology - Candidates Candidate - a placement of at most n-queens on a n n chessboard. Feasible Candidate a candidate that doesn t place 2 queens that threaten each other. Feasible Candidate Candidate

11 Terminology - Completion A completion of a candidate is a placement of the remaining queens that result in a solution. It s possible that a candidate won t have a valid completion. It s also possible a candidate will have more than one possible completion.

12 Completion Example Candidate Possible Solution Candidate s Possible Completion

13 Lemma I Claim: Two Feasible candidates with the same number of closed lines contain the same number of queens. Proof: 4 lines pass in each square each queen closes 4 lines. n queens can t close more than 4n lines. If n queens close less than 4n lines, at least 2 queens share a closed line clash and contradiction to feasibility. A feasible candidate with K closed lines has K / 4 placed queens. 2 feasible candidates with K closed lines each have the same number of placed queens (K / 4).

14 Two candidates with the same completion Red and Green are 2 distinct feasible candidates with same set of closed lines. Blue is a completion fitting both.

15 Lemma II Claim: C 1, C 2 are feasible candidate with same set of closed lines a completion of C 1 is also a completion of C 2. Preliminaries: S is the shared set of closed lines. k is the number of placed queens in C 1. C is a completion of C 1.

16 Lemma II, proof C contains n k queens, since C C 1 is a solution. Due to Lemma I, C 2 also contains k queens. C C 2 contains n placed queens. Since C did not cause a clash when added to C 1 it will not cause a clash when added to C 2. (Since S is the same for both). Therefore C is a completion for C 2 as well.

17 Equivalency of Candidates Assume C 1, C 2 are feasible candidates with the same set of closed lines. Every completion for one is a completion for the other (Lemma II). Let an Equivalence Class be defined as sets with equivalent sets of closed lines. A given equivalence class will have the same completion for all members of the class. Counting Problem + Equivalence Overlapping Sub Problems

18 The Data Structure The Dynamic Programming Algorithm we ll show uses a set containing tuples of the form S, i. S - a set of closed lines. Defines an Equivalence Class. Used as Key (unique in set). i - an integer. Describes the number of feasible candidates reached by the algorithm so far that belong to the equivalence class S.

19 Algorithm Dynamic Programming Approach 1. [Initialization] Q φ, 1 2. [Square Selection] Choose an unexamined square. Let T be the set of four lines that pass through the square. 3. [Iteration] For every S, i Q such that S T = φ do: 1. [Compaction] if S T, j Q, replace j with i + j. 2. [Creation] Otherwise, add S T, i to Q. 4. [Termination] if an unexamined square remains, go to Square Selection. Otherwise, terminate

20 Example: Q Pre: * φ, Q Post: * φ, 1, T 1, 1 + T 1 : QSquare 1 * is T chosen. 1, 1 } φ, 1 is taken from Q. T 1 φ = φ. T(1) is a feasible addition to φ. T 1 φ, j Q

21 Example: Q Pre: * φ, 1, T(1), Q Post: * φ, 1, T 1, 1, T 2, 1 + T 2 : Square 2 is chosen. φ, 1 is taken from Q. TQ 2 Q φ = * Tφ. 2 T(2), 1 } is a feasible addition to φ. T 2 φ, j Q

22 Example: Q Pre: * φ, 1, T(1), Q Post: * φ, 1, T 1, 1, T 2, 1 + T 2 : Square 2 is chosen. T 1, 1 is taken from Q. T 2 T 1 φ. T(2) is not a feasible addition to T(1).

23 Example: Q Pre: * φ, 1, T 1, 1, T 2, Q Post: * φ, 1, T 1, 1, T 2, 1, T 3, T 3 : Square 3 is chosen. φ, 1 is taken from Q. φq TQ3 = * Tφ. 3 T(3), 1 } is a feasible addition to φ. T 3 φ, j Q

24 Example: Q Pre: * φ, 1, T 1, 1, T 2, Q Post: * φ, 1, T 1, 1, T 2, 1, T 3, 1 +, T 3 T(1), T 3 : Square 3 is chosen. T 1, 1 is taken from Q. QT(1) Q T* T3 3= φ. T(1), T(3) 1 is } a feasible addition to T(1). T 3 T(1), j Q

25 Example: Q Pre: * φ, 1, T 1, 1, T 2, Q Post: * φ, 1, T 1, 1, T 2, 1, T 3, 1, T 3 T(1), 1 +, T 2 T(3), 1 + T 3 : Square 3 is chosen. T 2, 1 is taken from Q. QT(2) Q T* T3 2= φ. T(3), 1 is } a feasible addition to T(2). T 2 T(3), j Q

26 Example: (Compaction) Q Pre: * , T(3) T(4) T(14) T(17), i, , T 2 T 6 T 12, j, Q Post: * , T(3) T(4) T(14) T(17), i +, j, , T 2 T 6 T 12, j, Square 18 is chosen. T 2 T 6 TQ 12 Q, j is * taken T(3) from T(4) Q. T(14) (T(2) T(17), T(6) i + T(12)) j + T 18 T(18) is a feasible addition tot(2) T(6) T(12). T(2) T(6) T(12) T 18 = T(3) T(4) T(14) T(17) = φ.

27 Determining number of solutions A feasible candidate is a solution if and only if it s set of closed lines contain all the rows and columns of the chessboard. Let M be the set of rows and columns. i, M S Define σ S, i = 0, oterwise In order to find the number of solutions: Run the Algorithm. Calculate σ S, i S,i Q

28 Space Complexity Analysis depends upon maximal size of Q and size of tuple. Number of Tuples: Let the maximum number of different lines on the chessboard be α. Maximum number of equivalence classes is 2 α. Size of Tuple: Number of possible candidates is O 2 n2. Therefore the size of an element in Q is O(n 2 ) Overall space complexity is O(2 α n 2 ). α is bound by 6n 2, space complexity is O(64 n n 2 ).

29 Run Time Complexity Square Selection Step is being called n 2 times. Each execution of the step takes O g n 2 α 2 α since Iteration requires passing over all of Q. g n is a low order polynomial that depends upon exact implementation. Overall run-time complexity is O f n 64 n f(n) = g n n 2, still a low-order polynomial. Can we reduce α?

30 Line Exhaustion A line l consists from at most n squares. There are at most n queen placements that close l. When the algorithm passes through all of l s squares, l is considered Exhausted. What happens then?

31 Line Exhaustion rows & columns Let S, i be a tuple in Q when l (which is a row or column) is exhausted. If l S everything is fine. If l S, the Algorithm will fail to find a completion to S (no further queen can close l) In this case, we can Simply discard S, i.

32 Line Exhaustion diagonal Let C 1, C 2 be two candidates. We say they differ in l if l is closed in one and only one of them. Claim: if C 1, C 2 exist in Q at the same time during the algorithm, and differ only in exhausted diagonals, then any completion of one is a completion of the other as well.

33 Diagonal Line Exhaustion Lemma Proof Mark differing exhausted diagonals as D. Let C be a completion of C 1. Proof: C 1, C 2 have the same number of queens. (Equal Rows by Lemma I) C won t place queens on any of the lines in D as they are Exhausted Lines. Both C 1 and C 2 are the same except for D therefore they will have the same completion C.

34 Improving the Algorithm Add the following lines after Iteration: 4. [Exhaustion Loop] For every line l that became exhausted, Do the following for every S, i Q. 1. [Deletion] if l is a row or column, and l S, remove S, i from Q. 2. [Reduction & Conjunction] if l is diagonal and l S, replace S, i with S *l+, i. If there s another S *l+, j Q, merge them (replace them both with S l, i + j )

35 Semi-Exhausted Lines By Improving the Algorithm, it s guaranteed that 2 equivalence classes in Q differ only in Semi- Exhausted Lines. Semi-Exhausted lines lines which are closed on some candidates in Q, but aren t completely exhausted yet. Size of Q is bound by the power-set of maximal semi-exhausted lines. Can we Bound the number to less than 6n 2?

36 Row-Major Bound Claim: When processing the chessboard in row-major order, the number of semi-exhausted lines is bound by 3n + c, for constant c

37 Row-Major Bound The 1 st line: First adds row, column, diagonal. (3) Non-first, non-last add column and 2 diagonals. (3) Last adds column, diagonal and exhausts row. (1) After Line ends 3n 2 semi-exhausted lines exist. On non 1 st, non last lines: First Adds row. Non first, non-last adds nothing. Last adds diagonal, but exhausts row and other diagonal. After the line ends, no change is made to number of semiexhausted lines. Last Line only reduces number of semi-exhausted lines.

38 Exhaustion and complexity The addition of the exhaustion mechanism to the algorithm reduces α. The upper boundary of α is now 3n, instead of 6n. Thus, the new complexities are: Space Complexity O 8 n n 2 Run-Time Complexity O f(n)8 n

39 Summary The n-queen problem was shown and discussed. The problem is considered hard, but we ve seen a dynamic programming approach to it that gave the first non-trivial upper bound to the problem. Questions

Probability & Combinatorics Test and Solutions February 18, 2012

Probability & Combinatorics Test and Solutions February 18, 2012 1. A standard 12-hour clock has hour, minute, and second hands. How many times do two hands cross between 1:00 and 2:00 (not including 1:00 and 2:00 themselves)? Answer: 119 Solution: We know that the

More information

One-to-one functions and onto functions

One-to-one functions and onto functions MA 3362 Lecture 7 - One-to-one and Onto Wednesday, October 22, 2008. Objectives: Formalize definitions of one-to-one and onto One-to-one functions and onto functions At the level of set theory, there are

More information

MATH 115, SUMMER 2012 LECTURE 12

MATH 115, SUMMER 2012 LECTURE 12 MATH 115, SUMMER 2012 LECTURE 12 JAMES MCIVOR - last time - we used hensel s lemma to go from roots of polynomial equations mod p to roots mod p 2, mod p 3, etc. - from there we can use CRT to construct

More information

Supplementary lecture notes on linear programming. We will present an algorithm to solve linear programs of the form. maximize.

Supplementary lecture notes on linear programming. We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2016 Supplementary lecture notes on linear programming CS 6820: Algorithms 26 Sep 28 Sep 1 The Simplex Method We will present an algorithm to solve linear programs of the form

More information

Loop Convergence. CS 536: Science of Programming, Fall 2018

Loop Convergence. CS 536: Science of Programming, Fall 2018 Solved Loop Convergence CS 536: Science of Programming, Fall 2018 A. Why Diverging programs aren t useful, so it s useful to know how to show that loops terminate. B. Objectives At the end of this lecture

More information

Linear Programming: Simplex

Linear Programming: Simplex Linear Programming: Simplex Stephen J. Wright 1 2 Computer Sciences Department, University of Wisconsin-Madison. IMA, August 2016 Stephen Wright (UW-Madison) Linear Programming: Simplex IMA, August 2016

More information

Math Lecture 23 Notes

Math Lecture 23 Notes Math 1010 - Lecture 23 Notes Dylan Zwick Fall 2009 In today s lecture we ll expand upon the concept of radicals and radical expressions, and discuss how we can deal with equations involving these radical

More information

Answers in blue. If you have questions or spot an error, let me know. 1. Find all matrices that commute with A =. 4 3

Answers in blue. If you have questions or spot an error, let me know. 1. Find all matrices that commute with A =. 4 3 Answers in blue. If you have questions or spot an error, let me know. 3 4. Find all matrices that commute with A =. 4 3 a b If we set B = and set AB = BA, we see that 3a + 4b = 3a 4c, 4a + 3b = 3b 4d,

More information

CS 6820 Fall 2014 Lectures, October 3-20, 2014

CS 6820 Fall 2014 Lectures, October 3-20, 2014 Analysis of Algorithms Linear Programming Notes CS 6820 Fall 2014 Lectures, October 3-20, 2014 1 Linear programming The linear programming (LP) problem is the following optimization problem. We are given

More information

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ).

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ). CMPSCI611: Verifying Polynomial Identities Lecture 13 Here is a problem that has a polynomial-time randomized solution, but so far no poly-time deterministic solution. Let F be any field and let Q(x 1,...,

More information

Lecture #21. c T x Ax b. maximize subject to

Lecture #21. c T x Ax b. maximize subject to COMPSCI 330: Design and Analysis of Algorithms 11/11/2014 Lecture #21 Lecturer: Debmalya Panigrahi Scribe: Samuel Haney 1 Overview In this lecture, we discuss linear programming. We first show that the

More information

Graph Theory. Thomas Bloom. February 6, 2015

Graph Theory. Thomas Bloom. February 6, 2015 Graph Theory Thomas Bloom February 6, 2015 1 Lecture 1 Introduction A graph (for the purposes of these lectures) is a finite set of vertices, some of which are connected by a single edge. Most importantly,

More information

CS261: A Second Course in Algorithms Lecture #12: Applications of Multiplicative Weights to Games and Linear Programs

CS261: A Second Course in Algorithms Lecture #12: Applications of Multiplicative Weights to Games and Linear Programs CS26: A Second Course in Algorithms Lecture #2: Applications of Multiplicative Weights to Games and Linear Programs Tim Roughgarden February, 206 Extensions of the Multiplicative Weights Guarantee Last

More information

Hermite normal form: Computation and applications

Hermite normal form: Computation and applications Integer Points in Polyhedra Gennady Shmonin Hermite normal form: Computation and applications February 24, 2009 1 Uniqueness of Hermite normal form In the last lecture, we showed that if B is a rational

More information

Parameterized Algorithms for the H-Packing with t-overlap Problem

Parameterized Algorithms for the H-Packing with t-overlap Problem Journal of Graph Algorithms and Applications http://jgaa.info/ vol. 18, no. 4, pp. 515 538 (2014) DOI: 10.7155/jgaa.00335 Parameterized Algorithms for the H-Packing with t-overlap Problem Alejandro López-Ortiz

More information

Dominating Configurations of Kings

Dominating Configurations of Kings Dominating Configurations of Kings Jolie Baumann July 11, 2006 Abstract In this paper, we are counting natural subsets of graphs subject to local restrictions, such as counting independent sets of vertices,

More information

9 Knapsack Cryptography

9 Knapsack Cryptography 9 Knapsack Cryptography In the past four weeks, we ve discussed public-key encryption systems that depend on various problems that we believe to be hard: prime factorization, the discrete logarithm, and

More information

Lecture 3. 1 Polynomial-time algorithms for the maximum flow problem

Lecture 3. 1 Polynomial-time algorithms for the maximum flow problem ORIE 633 Network Flows August 30, 2007 Lecturer: David P. Williamson Lecture 3 Scribe: Gema Plaza-Martínez 1 Polynomial-time algorithms for the maximum flow problem 1.1 Introduction Let s turn now to considering

More information

On Two Class-Constrained Versions of the Multiple Knapsack Problem

On Two Class-Constrained Versions of the Multiple Knapsack Problem On Two Class-Constrained Versions of the Multiple Knapsack Problem Hadas Shachnai Tami Tamir Department of Computer Science The Technion, Haifa 32000, Israel Abstract We study two variants of the classic

More information

What is proof? Lesson 1

What is proof? Lesson 1 What is proof? Lesson The topic for this Math Explorer Club is mathematical proof. In this post we will go over what was covered in the first session. The word proof is a normal English word that you might

More information

Rooks and Pascal s Triangle. shading in the first k squares of the diagonal running downwards to the right. We

Rooks and Pascal s Triangle. shading in the first k squares of the diagonal running downwards to the right. We Roos and Pascal s Triangle An (n,) board consists of n 2 squares arranged in n rows and n columns with shading in the first squares of the diagonal running downwards to the right. We consider (n,) boards

More information

Homework 1 (revised) Solutions

Homework 1 (revised) Solutions Homework 1 (revised) Solutions 1. Textbook, 1.1.1, # 1.1.2 (p. 24) Let S be an ordered set. Let A be a non-empty finite subset. Then A is bounded and sup A, inf A A Solution. The hint was: Use induction,

More information

Space and Nondeterminism

Space and Nondeterminism CS 221 Computational Complexity, Lecture 5 Feb 6, 2018 Space and Nondeterminism Instructor: Madhu Sudan 1 Scribe: Yong Wook Kwon Topic Overview Today we ll talk about space and non-determinism. For some

More information

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem? Admin Two more assignments No office hours on tomorrow NP-COMPLETE PROBLEMS Run-time analysis Tractable vs. intractable problems We ve spent a lot of time in this class putting algorithms into specific

More information

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011 Math 31 Lesson Plan Day 5: Intro to Groups Elizabeth Gillaspy September 28, 2011 Supplies needed: Sign in sheet Goals for students: Students will: Improve the clarity of their proof-writing. Gain confidence

More information

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality Math 336-Modern Algebra Lecture 08 9/26/4. Cardinality I started talking about cardinality last time, and you did some stuff with it in the Homework, so let s continue. I said that two sets have the same

More information

MATH CIRCLE Session # 2, 9/29/2018

MATH CIRCLE Session # 2, 9/29/2018 MATH CIRCLE Session # 2, 9/29/2018 SOLUTIONS 1. The n-queens Problem. You do NOT need to know how to play chess to work this problem! This is a classical problem; to look it up today on the internet would

More information

5 + 9(10) + 3(100) + 0(1000) + 2(10000) =

5 + 9(10) + 3(100) + 0(1000) + 2(10000) = Chapter 5 Analyzing Algorithms So far we have been proving statements about databases, mathematics and arithmetic, or sequences of numbers. Though these types of statements are common in computer science,

More information

Santa Claus Schedules Jobs on Unrelated Machines

Santa Claus Schedules Jobs on Unrelated Machines Santa Claus Schedules Jobs on Unrelated Machines Ola Svensson (osven@kth.se) Royal Institute of Technology - KTH Stockholm, Sweden March 22, 2011 arxiv:1011.1168v2 [cs.ds] 21 Mar 2011 Abstract One of the

More information

1 Closest Pair of Points on the Plane

1 Closest Pair of Points on the Plane CS 31: Algorithms (Spring 2019): Lecture 5 Date: 4th April, 2019 Topic: Divide and Conquer 3: Closest Pair of Points on a Plane Disclaimer: These notes have not gone through scrutiny and in all probability

More information

Topic 17. Analysis of Algorithms

Topic 17. Analysis of Algorithms Topic 17 Analysis of Algorithms Analysis of Algorithms- Review Efficiency of an algorithm can be measured in terms of : Time complexity: a measure of the amount of time required to execute an algorithm

More information

Dynamic Programming: Interval Scheduling and Knapsack

Dynamic Programming: Interval Scheduling and Knapsack Dynamic Programming: Interval Scheduling and Knapsack . Weighted Interval Scheduling Weighted Interval Scheduling Weighted interval scheduling problem. Job j starts at s j, finishes at f j, and has weight

More information

The Angel wins. October 19, Computer Science Department Boston University. Péter Gács (Boston University) The Angel wins October 19, / 59

The Angel wins. October 19, Computer Science Department Boston University. Péter Gács (Boston University) The Angel wins October 19, / 59 The Angel wins Péter Gács Computer Science Department Boston University October 19, 2007 Péter Gács (Boston University) The Angel wins October 19, 2007 1 / 59 The game The game The board is an infinite

More information

Eigenvalues & Eigenvectors

Eigenvalues & Eigenvectors Eigenvalues & Eigenvectors Page 1 Eigenvalues are a very important concept in linear algebra, and one that comes up in other mathematics courses as well. The word eigen is German for inherent or characteristic,

More information

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds

More information

Lecture 13 March 7, 2017

Lecture 13 March 7, 2017 CS 224: Advanced Algorithms Spring 2017 Prof. Jelani Nelson Lecture 13 March 7, 2017 Scribe: Hongyao Ma Today PTAS/FPTAS/FPRAS examples PTAS: knapsack FPTAS: knapsack FPRAS: DNF counting Approximation

More information

NON-CONJUGATE, ROOK EQUIVALENT t-cores

NON-CONJUGATE, ROOK EQUIVALENT t-cores NON-CONJUGATE, ROOK EQUIVALENT t-cores ALEX MONTOYE AND NATALIE RICH ADVISOR: HOLLY SWISHER OREGON STATE UNIVERSITY ABSTRACT. Consider a partition of a natural number n. The partition is called a t-core

More information

Functions and cardinality (solutions) sections A and F TA: Clive Newstead 6 th May 2014

Functions and cardinality (solutions) sections A and F TA: Clive Newstead 6 th May 2014 Functions and cardinality (solutions) 21-127 sections A and F TA: Clive Newstead 6 th May 2014 What follows is a somewhat hastily written collection of solutions for my review sheet. I have omitted some

More information

1 The Knapsack Problem

1 The Knapsack Problem Comp 260: Advanced Algorithms Prof. Lenore Cowen Tufts University, Spring 2018 Scribe: Tom Magerlein 1 Lecture 4: The Knapsack Problem 1 The Knapsack Problem Suppose we are trying to burgle someone s house.

More information

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

ENEE 459E/CMSC 498R In-class exercise February 10, 2015 ENEE 459E/CMSC 498R In-class exercise February 10, 2015 In this in-class exercise, we will explore what it means for a problem to be intractable (i.e. it cannot be solved by an efficient algorithm). There

More information

CIS 121. Analysis of Algorithms & Computational Complexity. Slides based on materials provided by Mary Wootters (Stanford University)

CIS 121. Analysis of Algorithms & Computational Complexity. Slides based on materials provided by Mary Wootters (Stanford University) CIS 121 Analysis of Algorithms & Computational Complexity Slides based on materials provided by Mary Wootters (Stanford University) Today Sorting: InsertionSort vs MergeSort Analyzing the correctness of

More information

Linear Programming and its Extensions Prof. Prabha Shrama Department of Mathematics and Statistics Indian Institute of Technology, Kanpur

Linear Programming and its Extensions Prof. Prabha Shrama Department of Mathematics and Statistics Indian Institute of Technology, Kanpur Linear Programming and its Extensions Prof. Prabha Shrama Department of Mathematics and Statistics Indian Institute of Technology, Kanpur Lecture No. # 03 Moving from one basic feasible solution to another,

More information

BMT 2018 Team Test Solutions March 18, 2018

BMT 2018 Team Test Solutions March 18, 2018 . A circle with radius is inscribed in a right triangle with hypotenuse 4 as shown below. What is the area of the triangle? Note that the diagram is not to scale. 4 Answer: 9 Solution : We wish to use

More information

CS 6783 (Applied Algorithms) Lecture 3

CS 6783 (Applied Algorithms) Lecture 3 CS 6783 (Applied Algorithms) Lecture 3 Antonina Kolokolova January 14, 2013 1 Representative problems: brief overview of the course In this lecture we will look at several problems which, although look

More information

Linear Algebra, Summer 2011, pt. 2

Linear Algebra, Summer 2011, pt. 2 Linear Algebra, Summer 2, pt. 2 June 8, 2 Contents Inverses. 2 Vector Spaces. 3 2. Examples of vector spaces..................... 3 2.2 The column space......................... 6 2.3 The null space...........................

More information

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

CSC 8301 Design & Analysis of Algorithms: Lower Bounds CSC 8301 Design & Analysis of Algorithms: Lower Bounds Professor Henry Carter Fall 2016 Recap Iterative improvement algorithms take a feasible solution and iteratively improve it until optimized Simplex

More information

Generating p-extremal graphs

Generating p-extremal graphs Generating p-extremal graphs Derrick Stolee Department of Mathematics Department of Computer Science University of Nebraska Lincoln s-dstolee1@math.unl.edu August 2, 2011 Abstract Let f(n, p be the maximum

More information

Advanced Mathematical Programming IE417. Lecture 24. Dr. Ted Ralphs

Advanced Mathematical Programming IE417. Lecture 24. Dr. Ted Ralphs Advanced Mathematical Programming IE417 Lecture 24 Dr. Ted Ralphs IE417 Lecture 24 1 Reading for This Lecture Sections 11.2-11.2 IE417 Lecture 24 2 The Linear Complementarity Problem Given M R p p and

More information

CSE 101. Algorithm Design and Analysis Miles Jones Office 4208 CSE Building Lecture 1: Introduction

CSE 101. Algorithm Design and Analysis Miles Jones Office 4208 CSE Building Lecture 1: Introduction CSE 101 Algorithm Design and Analysis Miles Jones mej016@eng.ucsd.edu Office 4208 CSE Building Lecture 1: Introduction LOGISTICS Book: Algorithms by Dasgupta, Papadimitriou and Vazirani Homework: Due Wednesdays

More information

Math 308 Discussion Problems #2 (Sections ) SOLUTIONS

Math 308 Discussion Problems #2 (Sections ) SOLUTIONS Math 8 Discussion Problems # (Sections.-.) SOLUTIONS () When Jake works from home, he typically spends 4 minutes of each hour on research, and on teaching, and drinks half a cup of coffee. (The remaining

More information

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM (FP1) The exclusive or operation, denoted by and sometimes known as XOR, is defined so that P Q is true iff P is true or Q is true, but not both. Prove (through

More information

Lecture 2. More Algorithm Analysis, Math and MCSS By: Sarah Buchanan

Lecture 2. More Algorithm Analysis, Math and MCSS By: Sarah Buchanan Lecture 2 More Algorithm Analysis, Math and MCSS By: Sarah Buchanan Announcements Assignment #1 is posted online It is directly related to MCSS which we will be talking about today or Monday. There are

More information

Discrete Structures for Computer Science

Discrete Structures for Computer Science Discrete Structures for Computer Science William Garrison bill@cs.pitt.edu 6311 Sennott Square Lecture #10: Sequences and Summations Based on materials developed by Dr. Adam Lee Today s Topics Sequences

More information

Lecture 23: More PSPACE-Complete, Randomized Complexity

Lecture 23: More PSPACE-Complete, Randomized Complexity 6.045 Lecture 23: More PSPACE-Complete, Randomized Complexity 1 Final Exam Information Who: You On What: Everything through PSPACE (today) With What: One sheet (double-sided) of notes are allowed When:

More information

Hidden Markov Models: All the Glorious Gory Details

Hidden Markov Models: All the Glorious Gory Details Hidden Markov Models: All the Glorious Gory Details Noah A. Smith Department of Computer Science Johns Hopkins University nasmith@cs.jhu.edu 18 October 2004 1 Introduction Hidden Markov models (HMMs, hereafter)

More information

More on Regular Languages and Non-Regular Languages

More on Regular Languages and Non-Regular Languages More on Regular Languages and Non-Regular Languages CSCE A35 Decision Properties of Regular Languages Given a (representation, e.g., RE, FA, of a) regular language L, what can we tell about L? Since there

More information

DIMACS Technical Report March Game Seki 1

DIMACS Technical Report March Game Seki 1 DIMACS Technical Report 2007-05 March 2007 Game Seki 1 by Diogo V. Andrade RUTCOR, Rutgers University 640 Bartholomew Road Piscataway, NJ 08854-8003 dandrade@rutcor.rutgers.edu Vladimir A. Gurvich RUTCOR,

More information

Chapter 7 Propositional Satisfiability Techniques

Chapter 7 Propositional Satisfiability Techniques Lecture slides for Automated Planning: Theory and Practice Chapter 7 Propositional Satisfiability Techniques Dana S. Nau University of Maryland 12:58 PM February 15, 2012 1 Motivation Propositional satisfiability:

More information

Distributed Optimization. Song Chong EE, KAIST

Distributed Optimization. Song Chong EE, KAIST Distributed Optimization Song Chong EE, KAIST songchong@kaist.edu Dynamic Programming for Path Planning A path-planning problem consists of a weighted directed graph with a set of n nodes N, directed links

More information

VC-DENSITY FOR TREES

VC-DENSITY FOR TREES VC-DENSITY FOR TREES ANTON BOBKOV Abstract. We show that for the theory of infinite trees we have vc(n) = n for all n. VC density was introduced in [1] by Aschenbrenner, Dolich, Haskell, MacPherson, and

More information

arxiv: v1 [math.co] 18 May 2018

arxiv: v1 [math.co] 18 May 2018 NEW EXPLICIT SOLUTION TO THE N-QUEENS PROBLEM AND ITS RELATION TO THE MILLENNIUM PROBLEM DMITRII MIKHAILOVSKII arxiv:1805.0739v1 [math.co] 18 May 018 Abstract. Using modular arithmetic of the ring Z n+1

More information

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3 EECS 70 Discrete Mathematics and Probability Theory Spring 014 Anant Sahai Note 3 Induction Induction is an extremely powerful tool in mathematics. It is a way of proving propositions that hold for all

More information

Simplicity of A5 Brute Force Method!

Simplicity of A5 Brute Force Method! Simplicity of A5 Brute Force Method! Step 1: List all the elements of A5. i (12)(12) (135) (13)(35) (12354) (12)(23)(35)(54) (12)(34) (12)(34) (145) (14)(45) (13425) (13)(34)(42)(25) (12)(35) (12)(35)

More information

LECTURE 22: COUNTABLE AND UNCOUNTABLE SETS

LECTURE 22: COUNTABLE AND UNCOUNTABLE SETS LECTURE 22: COUNTABLE AND UNCOUNTABLE SETS 1. Introduction To end the course we will investigate various notions of size associated to subsets of R. The simplest example is that of cardinality - a very

More information

We set up the basic model of two-sided, one-to-one matching

We set up the basic model of two-sided, one-to-one matching Econ 805 Advanced Micro Theory I Dan Quint Fall 2009 Lecture 18 To recap Tuesday: We set up the basic model of two-sided, one-to-one matching Two finite populations, call them Men and Women, who want to

More information

Week 3: Reductions and Completeness

Week 3: Reductions and Completeness Computational Complexity Theory Summer HSSP 2018 Week 3: Reductions and Completeness Dylan Hendrickson MIT Educational Studies Program 3.1 Reductions Suppose I know how to solve some problem quickly. How

More information

Partitioning Metric Spaces

Partitioning Metric Spaces Partitioning Metric Spaces Computational and Metric Geometry Instructor: Yury Makarychev 1 Multiway Cut Problem 1.1 Preliminaries Definition 1.1. We are given a graph G = (V, E) and a set of terminals

More information

CS 6505, Complexity and Algorithms Week 7: NP Completeness

CS 6505, Complexity and Algorithms Week 7: NP Completeness CS 6505, Complexity and Algorithms Week 7: NP Completeness Reductions We have seen some problems in P and NP, and we ve talked about space complexity. The Space Hierarchy Theorem showed us that there are

More information

Lecture 6 : Induction DRAFT

Lecture 6 : Induction DRAFT CS/Math 40: Introduction to Discrete Mathematics /8/011 Lecture 6 : Induction Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we began discussing proofs. We mentioned some proof

More information

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch] Undecidability Andreas Klappenecker [based on slides by Prof. Welch] 1 Sources Theory of Computing, A Gentle Introduction, by E. Kinber and C. Smith, Prentice-Hall, 2001 Automata Theory, Languages and

More information

An Algebraic Approach to Constraint Satisfaction Problems

An Algebraic Approach to Constraint Satisfaction Problems An Algebraic Approach to Constraint Satisfaction Problems Igor Rivin Wolfram Research, Inc. Champaign, Illinois 61826 Ramin Zabih Computer Science Department Stanford University Stanford, California 94305

More information

Journal of Symbolic Computation. On the Berlekamp/Massey algorithm and counting singular Hankel matrices over a finite field

Journal of Symbolic Computation. On the Berlekamp/Massey algorithm and counting singular Hankel matrices over a finite field Journal of Symbolic Computation 47 (2012) 480 491 Contents lists available at SciVerse ScienceDirect Journal of Symbolic Computation journal homepage: wwwelseviercom/locate/jsc On the Berlekamp/Massey

More information

Vector Spaces. 9.1 Opening Remarks. Week Solvable or not solvable, that s the question. View at edx. Consider the picture

Vector Spaces. 9.1 Opening Remarks. Week Solvable or not solvable, that s the question. View at edx. Consider the picture Week9 Vector Spaces 9. Opening Remarks 9.. Solvable or not solvable, that s the question Consider the picture (,) (,) p(χ) = γ + γ χ + γ χ (, ) depicting three points in R and a quadratic polynomial (polynomial

More information

Computing Minmax; Dominance

Computing Minmax; Dominance Computing Minmax; Dominance CPSC 532A Lecture 5 Computing Minmax; Dominance CPSC 532A Lecture 5, Slide 1 Lecture Overview 1 Recap 2 Linear Programming 3 Computational Problems Involving Maxmin 4 Domination

More information

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013 CMPSCI 250: Introduction to Computation Lecture 11: Proof Techniques David Mix Barrington 5 March 2013 Proof Techniques Review: The General Setting for Proofs Types of Proof: Direct, Contraposition, Contradiction

More information

Minmax Tree Cover in the Euclidean Space

Minmax Tree Cover in the Euclidean Space Journal of Graph Algorithms and Applications http://jgaa.info/ vol. 15, no. 3, pp. 345 371 (2011) Minmax Tree Cover in the Euclidean Space Seigo Karakawa 1 Ehab Morsy 1 Hiroshi Nagamochi 1 1 Department

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

Dynamic Programming( Weighted Interval Scheduling)

Dynamic Programming( Weighted Interval Scheduling) Dynamic Programming( Weighted Interval Scheduling) 17 November, 2016 Dynamic Programming 1 Dynamic programming algorithms are used for optimization (for example, finding the shortest path between two points,

More information

Olympiad Combinatorics. Pranav A. Sriram

Olympiad Combinatorics. Pranav A. Sriram Olympiad Combinatorics Pranav A. Sriram August 2014 Chapter 4: Existence 1 Copyright notices All USAMO and USA Team Selection Test problems in this chapter are copyrighted by the Mathematical Association

More information

PROOF WITHOUT WORDS MATH CIRCLE (BEGINNERS) 05/06/2012

PROOF WITHOUT WORDS MATH CIRCLE (BEGINNERS) 05/06/2012 PROOF WITHOUT WORDS MATH CIRCLE (BEGINNERS) 05/06/2012 If you ve been with us for a little while, you ve already seen some examples of proofs without words. Remember a proof is just an airtight argument

More information

Enumerating Distinct Chessboard Tilings and Generalized Lucas Sequences Part I

Enumerating Distinct Chessboard Tilings and Generalized Lucas Sequences Part I Enumerating Distinct Chessboard Tilings and Generalized Lucas Sequences Part I Daryl DeFord Washington State University January 28, 2013 Roadmap 1 Problem 2 Symmetry 3 LHCCRR as Vector Spaces 4 Generalized

More information

Complexity Theory Part II

Complexity Theory Part II Complexity Theory Part II Time Complexity The time complexity of a TM M is a function denoting the worst-case number of steps M takes on any input of length n. By convention, n denotes the length of the

More information

1 Sequences and Summation

1 Sequences and Summation 1 Sequences and Summation A sequence is a function whose domain is either all the integers between two given integers or all the integers greater than or equal to a given integer. For example, a m, a m+1,...,

More information

A gentle introduction to PSLQ

A gentle introduction to PSLQ A gentle introduction to PSLQ Armin Straub Email: math@arminstraub.com April 0, 200 Abstract This is work in progress. Please let me know about any comments and suggestions. What PSLQ is about PSLQ is

More information

Lecture 5: Latin Squares and Magic

Lecture 5: Latin Squares and Magic Latin Squares Instructor: Padraic Bartlett Lecture 5: Latin Squares and Magic Week Mathcamp 0 Today s application is to magic! Not the friendship kind though ; instead we re going to talk about magic squares

More information

Lecture notes for Analysis of Algorithms : Markov decision processes

Lecture notes for Analysis of Algorithms : Markov decision processes Lecture notes for Analysis of Algorithms : Markov decision processes Lecturer: Thomas Dueholm Hansen June 6, 013 Abstract We give an introduction to infinite-horizon Markov decision processes (MDPs) with

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Ahlswede Khachatrian Theorems: Weighted, Infinite, and Hamming

Ahlswede Khachatrian Theorems: Weighted, Infinite, and Hamming Ahlswede Khachatrian Theorems: Weighted, Infinite, and Hamming Yuval Filmus April 4, 2017 Abstract The seminal complete intersection theorem of Ahlswede and Khachatrian gives the maximum cardinality of

More information

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005 Jonathan Katz Lecture 3 1 Terminology For any complexity class C, we define the class coc as follows: coc def = { L L C }. One class

More information

Solving the N-Queens Puzzle with P Systems

Solving the N-Queens Puzzle with P Systems Solving the N-Queens Puzzle with P Systems Miguel A. Gutiérrez-Naranjo, Miguel A. Martínez-del-Amor, Ignacio Pérez-Hurtado, Mario J. Pérez-Jiménez Research Group on Natural Computing Department of Computer

More information

Logic I - Session 10 Thursday, October 15,

Logic I - Session 10 Thursday, October 15, Logic I - Session 10 Thursday, October 15, 2009 1 Plan Re: course feedback Review of course structure Recap of truth-functional completeness? Soundness of SD Thursday, October 15, 2009 2 The course structure

More information

INEQUALITIES OF SYMMETRIC FUNCTIONS. 1. Introduction to Symmetric Functions [?] Definition 1.1. A symmetric function in n variables is a function, f,

INEQUALITIES OF SYMMETRIC FUNCTIONS. 1. Introduction to Symmetric Functions [?] Definition 1.1. A symmetric function in n variables is a function, f, INEQUALITIES OF SMMETRIC FUNCTIONS JONATHAN D. LIMA Abstract. We prove several symmetric function inequalities and conjecture a partially proved comprehensive theorem. We also introduce the condition of

More information

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5. This homework is due October 6, 2014, at 12:00 noon.

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5. This homework is due October 6, 2014, at 12:00 noon. EECS 70 Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5 This homework is due October 6, 2014, at 12:00 noon. 1. Modular Arithmetic Lab (continue) Oystein Ore described a puzzle

More information

Proving languages to be nonregular

Proving languages to be nonregular Proving languages to be nonregular We already know that there exist languages A Σ that are nonregular, for any choice of an alphabet Σ. This is because there are uncountably many languages in total and

More information

Theorem 5.3. Let E/F, E = F (u), be a simple field extension. Then u is algebraic if and only if E/F is finite. In this case, [E : F ] = deg f u.

Theorem 5.3. Let E/F, E = F (u), be a simple field extension. Then u is algebraic if and only if E/F is finite. In this case, [E : F ] = deg f u. 5. Fields 5.1. Field extensions. Let F E be a subfield of the field E. We also describe this situation by saying that E is an extension field of F, and we write E/F to express this fact. If E/F is a field

More information

Chapter 3 Deterministic planning

Chapter 3 Deterministic planning Chapter 3 Deterministic planning In this chapter we describe a number of algorithms for solving the historically most important and most basic type of planning problem. Two rather strong simplifying assumptions

More information

Outline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm

Outline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm Outline 1 NP-Completeness Theory 2 Limitation of Computation 3 Examples 4 Decision Problems 5 Verification Algorithm 6 Non-Deterministic Algorithm 7 NP-Complete Problems c Hu Ding (Michigan State University)

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1 CS 70 Discrete Mathematics and Probability Theory Fall 013 Vazirani Note 1 Induction Induction is a basic, powerful and widely used proof technique. It is one of the most common techniques for analyzing

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Distinguish between a theorem, an axiom, lemma, a corollary, and a conjecture. Recognize direct proofs

More information

Dynamic Programming. Data Structures and Algorithms Andrei Bulatov

Dynamic Programming. Data Structures and Algorithms Andrei Bulatov Dynamic Programming Data Structures and Algorithms Andrei Bulatov Algorithms Dynamic Programming 18-2 Weighted Interval Scheduling Weighted interval scheduling problem. Instance A set of n jobs. Job j

More information