72
A Problem-Solving Methodology using the Extremality Principle and its Application to CS Education Jagadish M. IIT Bombay 29 June 2015 (Advisor: Prof. Sridhar Iyer)

A Problem-Solving Methodology using the ... - IIT Bombay

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Problem-Solving Methodology using the ... - IIT Bombay

A Problem-Solving Methodology using theExtremality Principle and its Application to CS

Education

Jagadish M.IIT Bombay

29 June 2015

(Advisor: Prof. Sridhar Iyer)

Page 2: A Problem-Solving Methodology using the ... - IIT Bombay

Contribution in a nutshell

We have identified a few domains in theoretical computer scienceand devised problem-solving techniques for problems in eachdomain.

Page 3: A Problem-Solving Methodology using the ... - IIT Bombay

Problem-solving as a search process

‘If you can’t solve a problem, then there isan easier problem you can solve: find it.’

Page 4: A Problem-Solving Methodology using the ... - IIT Bombay

Problem-solving as a search process

Problem P

P1 P2

Sol1 Sol2 Sol3

Solution to P

P3 P4

Weaken-Identify-Solve-Extend (WISE).

Page 5: A Problem-Solving Methodology using the ... - IIT Bombay

Too general to be useful

Problem P ′

P1 P2 P3 P4

Sol1 Sol2 Sol3

Solution to P ′

Problem P

P1 P2

Sol1 Sol2 Sol3

Solution to P

P3 P4

Page 6: A Problem-Solving Methodology using the ... - IIT Bombay

How to give precision?

P1 ≈ P2

Problem P1

Solution to P1

Problem P2

Solution to P2

Page 7: A Problem-Solving Methodology using the ... - IIT Bombay

How to give precision?

1. Restrict the domain

2. Extremality principle

Looking at objects that maximize or minimize some properties.

Page 8: A Problem-Solving Methodology using the ... - IIT Bombay

Generate extremal instances

Step 1: Identify the properties of instances

Step 2: Define max/min functions on properties.

Page 9: A Problem-Solving Methodology using the ... - IIT Bombay

Generate extremal graphs

Step 1: Property: Number of edges

Step 2: Function: Maximum number of edges

Page 10: A Problem-Solving Methodology using the ... - IIT Bombay

Generate extremal graphs

Step 1: Property: Number of edges

Step 2: Function: Maximum number of edges

K6

Page 11: A Problem-Solving Methodology using the ... - IIT Bombay

Two types of extremal instances

Domain-specific.

Examples: Complete graph, path, binary tree, bipartite graph, etc.

Problem-specific.

Page 12: A Problem-Solving Methodology using the ... - IIT Bombay

Overview

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

Graph-theoretic problems

1

Page 13: A Problem-Solving Methodology using the ... - IIT Bombay

Overview

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

Graph-theoretic problems

1

Page 14: A Problem-Solving Methodology using the ... - IIT Bombay

Overview

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

Graph-theoretic problems

1

Page 15: A Problem-Solving Methodology using the ... - IIT Bombay

Overview

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

Graph-theoretic problems

1

Page 16: A Problem-Solving Methodology using the ... - IIT Bombay

Connectivity: An example

Problem We are given an adjacency matrix of a graph G = (V ,E ).How many entries do we have to probe to check if G is connected.

Page 17: A Problem-Solving Methodology using the ... - IIT Bombay

Our proof vs textbook proof

Page 18: A Problem-Solving Methodology using the ... - IIT Bombay

Connectivity: Textbook proof

Current textbook-proofs of this problem goes through invariantanalysis.

Drawback. Not easily generalizable to other properties.

Page 19: A Problem-Solving Methodology using the ... - IIT Bombay

Our proof: Main idea

Problem of proving a lower bound.

⇓ reduced to

Constructing a certain extremal graph.

I More generalizable than the invariant proof.

I Students find the second task easy (Pilot experiment).

Page 20: A Problem-Solving Methodology using the ... - IIT Bombay

Our proof: Main idea

Problem of proving a lower bound.

⇓ reduced to

Constructing a certain extremal graph.

I More generalizable than the invariant proof.

I Students find the second task easy (Pilot experiment).

Page 21: A Problem-Solving Methodology using the ... - IIT Bombay

Critical Graph

A graph G is called a critical graph with respect to property P if

I Graph G does not have the property P.

I But replacing any non-edge with an edge endows G with theproperty.

Page 22: A Problem-Solving Methodology using the ... - IIT Bombay

Connectivity

Kn/2

A

Kn/2

B

(a)

Kn/2

A

Kn/2

B

(b)

- G is not connected.- But replacing any non-edge with an edge makes it so.

Page 23: A Problem-Solving Methodology using the ... - IIT Bombay

Advantage of our proof

Critical graphs for other topological graph properties are easyto construct. Hence, proving lower bounds becomes easy.

Page 24: A Problem-Solving Methodology using the ... - IIT Bombay

Applicability

Property Extremal critical graph

Connectivity 2Kns

Triangle-freeness Star

Hamiltonicity 2Kns

Perfect matching 2Kns

Bipartiteness Kn,n

Cyclic Path

Degree-three node Cycle

Planarity Triangulated graph

Eulerian Cycle

Page 25: A Problem-Solving Methodology using the ... - IIT Bombay

Overview: Counterexamples

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

1

2

Page 26: A Problem-Solving Methodology using the ... - IIT Bombay

Overview: Counterexamples

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

1

2

Page 27: A Problem-Solving Methodology using the ... - IIT Bombay

Scope of problems

Task T

OptimizationProblem P

GreedyAlgorithm A

GreedyCounterexample C

Original Task

Page 28: A Problem-Solving Methodology using the ... - IIT Bombay

Max. Independent Set Problem (MIS)

A set of vertices S is said to be independent if no two vertices in Shave an edge between them.

a b

de

c

Given a simple graph G output the largest independent set.

Page 29: A Problem-Solving Methodology using the ... - IIT Bombay

Greedy strategy for MIS

1. Pick the vertex with the smallest degree (say v).

2. Delete v and its neighbours from G .

3. Recurse on the remaining graph.

Page 30: A Problem-Solving Methodology using the ... - IIT Bombay

Scope of problems

Task T

OptimizationProblem P

GreedyAlgorithm A

GreedyCounterexample C

Original Task

Page 31: A Problem-Solving Methodology using the ... - IIT Bombay

Definitions

Maximal setAn independent set is said to be maximal if we cannot extend it.

Discrepancy of G

The difference between the largest and the smallest maximal setsin G .

Page 32: A Problem-Solving Methodology using the ... - IIT Bombay

Extremal graphs of interest

Graphs with high discrepancy.

Graphs with low discrepancy.

Page 33: A Problem-Solving Methodology using the ... - IIT Bombay

MIS counterexample

. . .1 2 n

Maximum discrepancy graph

Greedy counterexample

Kn

. . .1 2 n

Minimum discrepancy graphBest Counterexample= Max. + Min. discrepancy graphs!

Page 34: A Problem-Solving Methodology using the ... - IIT Bombay

MIS counterexample

. . .1 2 n

Maximum discrepancy graph

Greedy counterexample

Kn

. . .1 2 n

Minimum discrepancy graphBest Counterexample= Max. + Min. discrepancy graphs!

Page 35: A Problem-Solving Methodology using the ... - IIT Bombay

MIS counterexample

. . .1 2 n

Maximum discrepancy graph

Greedy counterexample

Kn

. . .1 2 n

Minimum discrepancy graph

Best Counterexample= Max. + Min. discrepancy graphs!

Page 36: A Problem-Solving Methodology using the ... - IIT Bombay

MIS counterexample

. . .1 2 n

Maximum discrepancy graph

Greedy counterexample

Kn

. . .1 2 n

Minimum discrepancy graph

Best Counterexample= Max. + Min. discrepancy graphs!

Page 37: A Problem-Solving Methodology using the ... - IIT Bombay

Applicability

Problem St. I St. II

Independent Set Star Kn

Vertex Cover Star Centipede

Matching Paths Kn,n

Maxleaf Path Binary tree

Maxcut Kn,n Kn,n

Network Flow - Paths

Triangle-Free - Kns

Dominating Set Paths Paths

Page 38: A Problem-Solving Methodology using the ... - IIT Bombay

Pilot Experiments

Counterexample Construction

Discrepancy graphs. Students’ Approaches

Bad first choice

More general problem

Reduce from known problem

Try all small graphs

Page 39: A Problem-Solving Methodology using the ... - IIT Bombay

Pilot Experiments

Counterexample Construction

Discrepancy graphs. Students’ Approaches

Bad first choice

More general problem

Reduce from known problem

Try all small graphs

Page 40: A Problem-Solving Methodology using the ... - IIT Bombay

Pilot Experiments

Counterexample Construction

Discrepancy graphs. Students’ Approaches

Bad first choice

More general problem

Reduce from known problem

Try all small graphs

Page 41: A Problem-Solving Methodology using the ... - IIT Bombay

Pilot Experiments

Counterexample Construction

Discrepancy graphs. Students’ Approaches

Bad first choice

More general problem

Reduce from known problem

Try all small graphs

Page 42: A Problem-Solving Methodology using the ... - IIT Bombay

Pilot Experiments

Counterexample Construction

Discrepancy graphs. Students’ Approaches

Bad first choice

More general problem

Reduce from known problem

Try all small graphs

Page 43: A Problem-Solving Methodology using the ... - IIT Bombay

Overview: Tree-learning problem

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

1

2

3

Page 44: A Problem-Solving Methodology using the ... - IIT Bombay

Overview: Tree-learning problem

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

1

2

3

Page 45: A Problem-Solving Methodology using the ... - IIT Bombay

Problem description

r

13

11

5 8

10

9 2

15

12

1

6

4

Query: ‘Is node x a descendant of node y?’

Result: An O(n1.5 log n) algorithm. Previously, only O(n2) wasknown.

Joint work with Anindya Sen.

Page 46: A Problem-Solving Methodology using the ... - IIT Bombay

Problem description

r

13

11

5 8

10

9 2

15

12

1

6

4

Result: An O(n1.5 log n) algorithm. Previously, only O(n2) wasknown.

Joint work with Anindya Sen.

Page 47: A Problem-Solving Methodology using the ... - IIT Bombay

Key ideas via extremal trees

Idea Extremal Tree Generalization

I Path Bounded-leaves trees

II Complete binary tree Short-diameter trees

II Centipede Long diameter trees

Ideas I+II+II = O(n1.8 log n) algorithm

Joint work with Anindya Sen.

Page 48: A Problem-Solving Methodology using the ... - IIT Bombay

Overview: LPs

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

1

2

3

4

Page 49: A Problem-Solving Methodology using the ... - IIT Bombay

Overview: LPs

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

1

2

3

4

Page 50: A Problem-Solving Methodology using the ... - IIT Bombay

Motivation

Most books on linear programming assume knowledge of linearalgebra.

Page 51: A Problem-Solving Methodology using the ... - IIT Bombay

Motivation

Introduce linear programming to a younger audience usingweak duality.

Page 52: A Problem-Solving Methodology using the ... - IIT Bombay

Scope of problems

Math puzzles that can be formulated as a linear programs.

Page 53: A Problem-Solving Methodology using the ... - IIT Bombay

Scope of problems

Mathematical Olympiad Simple Polytopes

Main Idea: Certificates are easy to find.

Page 54: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling

Prove that every 10× 10 board cannot be tiled using straighttetraminoes.1

1F. Ardilla and R.P. Stanley. Tilings. Mathematical Intelligencer 2010

Page 55: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling

Every color appear appears 25 times (odd number).

Page 56: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling

Every tile covers even number of colors.

Page 57: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling

Every tile covers even number of colors.

Page 58: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling via LP

What is maximum number of non-overlapping tiles we canplace?

LP-formulation. We ensure this by saying that among all the tilesthat cover a cell c , at most one should be picked.

max:∑t∈T

t

∑t∈Tc

t ≤ 1 ∀c ∈ C

Page 59: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling - Dual

The dual will have one variable for each cell.

I Minimize the sum of cell-variables.

I Constraint : Sum of every four adjacent cells >= 1.

Page 60: A Problem-Solving Methodology using the ... - IIT Bombay

Tiling: Certificate

Every tile must lie on exactly one dark cell. But there are only 24dark cells.

Page 61: A Problem-Solving Methodology using the ... - IIT Bombay

Applicability

Problem Method

Baltic 2006 Small cases.

Ratio Ineq. Guess the certificate.

IMO 1965 Guess the tight constraints.

IMO 1977 Guess the certificate.

Engel. Guess the tight constraints.

Math. Lapok Small cases.

IMO 2007 Guess the certificate.

IMO 1979 Guess the tight constraints.

Math. Intel. Small cases.

Page 62: A Problem-Solving Methodology using the ... - IIT Bombay

Common theme

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

Lower bounds

Page 63: A Problem-Solving Methodology using the ... - IIT Bombay

Common theme

Extremality Principle

Ad-hoc problems Computer science domain

Query Lower Bounds

Counter Examples for Greedy Algorithms

Tree Learning Problem

Linear Programming

Lower bounds

Page 64: A Problem-Solving Methodology using the ... - IIT Bombay

Future Work

Counterexamples for online algorithms

Caching problem.

Counterexamples for LP

Instances with large integrality gaps.

Lower bounds in other areasNumber theory: What is a bad instance for Euclid’s GCDalgorithm?

Page 65: A Problem-Solving Methodology using the ... - IIT Bombay

Thank You

Page 66: A Problem-Solving Methodology using the ... - IIT Bombay

Titu Andreescu

In a set of 2n + 1 numbers the sum of any n numbers is smallerthan the sum of the rest. Prove that all numbers are positive.

Page 67: A Problem-Solving Methodology using the ... - IIT Bombay

Titu Andreescu

Page 68: A Problem-Solving Methodology using the ... - IIT Bombay

Duality-based solution

x + S > S ′

x + S ′ > S

2x + S + S ′ > S + S ′

x > 0

Page 69: A Problem-Solving Methodology using the ... - IIT Bombay

Our Proof vs Textbook Proof

Baseline for comparison.

Page 70: A Problem-Solving Methodology using the ... - IIT Bombay

Experiment

Phase Topic Students

S1 S2 S3 S4 S5

1*I Adv. Yes Yes No No No

6*III P1 8m 10m - 9m -P2 5m 5m 9m 6m 6mP3 8m - - 10m 9mP4 1m 2m 4m 2m 2mP5 1m 2m 2m 1m 2mP6 1m 1m 1m 1m 1m

Page 71: A Problem-Solving Methodology using the ... - IIT Bombay

Experiment

Phase Topic Students

S1 S2 S3 S4 S5

1*I Adv. Yes Yes No No No

6*III P1 8m 10m - 9m -P2 5m 5m 9m 6m 6mP3 8m - - 10m 9mP4 1m 2m 4m 2m 2mP5 1m 2m 2m 1m 2mP6 1m 1m 1m 1m 1m

Students found ourmethod easierthan Arora-Barak ¨̂

Page 72: A Problem-Solving Methodology using the ... - IIT Bombay

Role of experiments

Pilot Exp. Helped us iden-tify problem areas.

Refinement of AnchorMethod.

Critical Graph vs InvariantProof

Pilot Exp. Our method wasbetter than a baseline