with or without may 21, 2004 klára pintér– jános karsai with or without with and without...

34
With or Without May 21, 2004 Klára Pintér– János Karsai Klára Pintér– János Karsai With or Without With or Without With and Without With and Without Computing & Problem Computing & Problem Solving Solving

Upload: dante-roof

Post on 15-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Klára Pintér– János KarsaiKlára Pintér– János Karsai

With or WithoutWith or WithoutWith and WithoutWith and Without

Computing & Problem SolvingComputing & Problem Solving

Page 2: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

MottoMotto

Why should we solve every problem immediately?Cannot we enjoy the problem itself?

Miért kell minden problémát azonnal megoldani?Nem élvezetnénk magát a problémát?

Page 3: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

An introductory problemAn introductory problem

Problem 1Problem 1Uncle Joe is walking home at 0.7 m/s speed. His dog is running to him Uncle Joe is walking home at 0.7 m/s speed. His dog is running to him at 2 m/s speed. When they meet, they are at 10 m from the house. Then at 2 m/s speed. When they meet, they are at 10 m from the house. Then the dog runs back to the house, and then again to his owner, and so on. the dog runs back to the house, and then again to his owner, and so on. How long distance did the dog while his owner got home?How long distance did the dog while his owner got home?

Solution 1Solution 1Both are moving under the same time. Their velocities are known…

The properties are investigated without knowing the motion itself.

Page 4: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

An introductory problemAn introductory problem

Problem 1Problem 1Uncle Joe is walking home at 0.7 m/s speed. His dog is running to him Uncle Joe is walking home at 0.7 m/s speed. His dog is running to him at 2 m/s speed. When they meet, they are at 10 m from the house. Then at 2 m/s speed. When they meet, they are at 10 m from the house. Then the dog runs back to the house, and then again to his owner, and so on. the dog runs back to the house, and then again to his owner, and so on. How long distance did the dog while his owner got home?How long distance did the dog while his owner got home?

Solution 1Solution 1 Solution 2Solution 2Both are moving under the same time. Their velocities are known…

The properties are investigated without knowing the motion itself.

Describe the motion of the dog and sum the length of the pieces.Analogous to the billiard (here the wall is moving).Theory: Impulsive systems

2 4 6 8 10 12 14t

4

5

6

7

8

9

10

x

Experiments

Page 5: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Problem 2Problem 2

Another problemAnother problem

Uncle Joe was walking to his hous along a straight road at the speed 1 m/s. The neighbor’s dog watching at 20 m distance from the road and him observed and tried to catch him such that the dog was running at 1.4 km/h speed to the moving uncle Joe. How long distance did the dog take and how much time elapsed while the dog could catch uncle Joe?

Solution:Solution:Desribe the motion of the dog. Desribe the motion of the dog. Find the path and calculate the Find the path and calculate the length.length.

Known problem: the equation of the motion can be easily given.

Question: Can the eqn. be solved formally?

Experiments

5 10 15 20 25 30x

2.5

5

7.5

10

12.5

15

17.5

20y

Animation

Page 6: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Another problemAnother problem

Generalization: the path of the missile (Robinson and the cannibal)

• What is the orbit of the missile if it flies to the target?

• What happens if the target is controlled and its orbit is general?

• What happens with a slow missile?.

• Is there an optimal orbit?

• Are there catching or excaping strategies?

• What cases can be handled formally?

-1 1 2 3 4 5x

-1

-0.5

0.5

1

y

ExperimentsAnimation

Page 7: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

What is a problem?What is a problem?

Pólya : Finding routePólya : Finding route

Jackson: problem = target + difficultyJackson: problem = target + difficulty

Problem Problem Task Task

ProblemProblem

Page 8: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The flow of the problem-solving (after Pólya)The flow of the problem-solving (after Pólya)

The flowThe flow

Phenomenon

Solving processProblems

Solutions

Summary, discussion

Page 9: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The control of problem-solving (after The control of problem-solving (after Neumann)

ControlControl

The problem

The Mind

(Controller)Library

Solutions

Knowledge bases

.

.

.

.

.

.

Languages

Computerized

In mind

Page 10: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Example 1.Example 1.I can see apples on the tree. I do not pick apples from and do I can see apples on the tree. I do not pick apples from and do not leave apples on the tree. How many apples were on the not leave apples on the tree. How many apples were on the tree?tree?

The languageThe language

The importance of the languagesThe importance of the languages

Page 11: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The languageThe language

The importance of the languagesThe importance of the languages

Example 2.Example 2. Uncle Joe has 8 horses: 4 brown, 3 gray and 1 black. What Uncle Joe has 8 horses: 4 brown, 3 gray and 1 black. What is the probability of that any randomly chosen horse can say is the probability of that any randomly chosen horse can say about itself that uncle Joe has another horse of the same about itself that uncle Joe has another horse of the same color?color?

Page 12: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The languageThe language

The importance of the languagesThe importance of the languages

Example 3.Example 3. (x-a)(x-b)(x-c)…(x-z)=0(x-a)(x-b)(x-c)…(x-z)=0

Page 13: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The languageThe language

The importance of the languagesThe importance of the languages

Example 4.Example 4. Take an arbitrary point on each of two adjacent sides of a square. Take an arbitrary point on each of two adjacent sides of a square. Connect them with the opposite vertices. The green or red region is Connect them with the opposite vertices. The green or red region is bigger?bigger?

Page 14: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The languageThe language

The importance of the languagesThe importance of the languages

Example 4.Example 4. Take an arbitrary point on each of two adjacent sides of a square. Join Take an arbitrary point on each of two adjacent sides of a square. Join them with the opposite vertices. The green or red region is bigger?them with the opposite vertices. The green or red region is bigger?

Hint:

Page 15: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The languageThe language

Real manipulationReal manipulation

Mathematical formulationMathematical formulation n1

1

2n

VisualizatioVisualizationn

Some more examples!Some more examples!

Some languagesSome languages

Page 16: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

ApplicabilityApplicability

• Algorithmic problem Algorithmic problem

• „„A New Kind of Science A New Kind of Science (Wolfram)”(Wolfram)”

• Visualization, explorationVisualization, exploration

What is missedWhat is missed

• Heuristic methodsHeuristic methods

• IntuitionIntuition

• Theoretical basis Theoretical basis

• Singular casesSingular cases

The computerized knowledge basesThe computerized knowledge bases

(Programming) language + knowledge formulated in the language (Programming) language + knowledge formulated in the language

Computerized knowledge basesComputerized knowledge bases

Examples

Features

Typical formulationsTypical formulations

• Can be given → Give itCan be given → Give it

• Exists → Construct itExists → Construct it

• For all … → ???For all … → ???

• VisualizeVisualize

Main featuresMain features

• Symbolic, numeric operationsSymbolic, numeric operations

• Data handling, structure operationsData handling, structure operations

• VisualizationVisualization

• Well defined languageWell defined language

Page 17: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Simple mathematical constructionsSimple mathematical constructions

Example 1Example 1Give a function Give a function ff((xx) for which ) for which f’f’(0)=0, but zero is neither (0)=0, but zero is neither extremal nor inflection point. extremal nor inflection point.

Construction

Computer applications of basic level

Experiments and hand in the manual work

Result: deeper understand, illustrations, new problems

-0.04 -0.02 0.02 0.04

-0.0001

-0.00005

0.00005

0.0001

Page 18: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Simple mathematical constructionsSimple mathematical constructions

Example 2Example 2Take the powers 2Take the powers 2nn. What is the probability of that the first . What is the probability of that the first digit of 2digit of 2nn in the decimal system is 1,2,3,…,9. in the decimal system is 1,2,3,…,9.

Experiment

Computer applications of basic level

Experiments and hand in the manual work

Result: deeper understand, illustrations, new problems

Page 19: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

0

)( dttaProblem:Problem: Consider the differential equation Consider the differential equation x’’+a(t)x’+x=0x’’+a(t)x’+x=0..If If , then the equation has a solution that tends to zero as t , then the equation has a solution that tends to zero as t →∞.→∞.The problem is still open for the equation The problem is still open for the equation

x’’+a(t)x’+xx’’+a(t)x’+xnn=0 (n=0 (n 1). 1).

The method of phase-mappingThe method of phase-mapping

General problem:General problem: Consider the family of functions x(t,x Consider the family of functions x(t,x00) )

(x(0,x(x(0,x00)=x)=x00) such that x) such that x00 H H0 0 . The question is: How do the properties . The question is: How do the properties

of the phase maps Hof the phase maps Htt={x(t,x={x(t,x00), x), x00 H H00} depend on the time?} depend on the time?

0

2

4

6 1

0.5

0

0.5

1 1

0.5

0

0.5

1

0

2

4

6

1

0.5

0

0.5

1

Linear system

0

2.5

5

7.5

10 0.5 0.25

00.25

0.5 0.5

0.25

0

0.25

0.5

0

2.5

5

7.5

10

0.5

0.25

0

0.25

0.5

AnimationNonlinear system

Page 20: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

New Kind of Science

Computer applications of sophisticated level

Take use of that Computing is a science. Deep mutual influence

Result: „A New Kind of Science” (interdisciplinarity)

Page 21: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Examples

Substitution, pattern recognitionSubstitution, pattern recognition

a_ → f(a)a_ → f(a)

List rotations:List rotations:

{a,b,c} {a,b,c} → → {c,a,b}{c,a,b}

{a,b,c} → {b,c,a}{a,b,c} → {b,c,a}

-1

-0.5

0

0.5

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

-0.5

0

0.5

1

(Substitute anything by anything) (Substitute anything by anything)

Improve and extend the symbolism of Improve and extend the symbolism of structure structure operationsoperations

{a,b,c} {a,b,c} {x,y,z}{x,y,z} ={a ={axx,b,byy,c,czz}}

Two ideas and a constructionTwo ideas and a construction

New Kind of Science

Page 22: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Examples: Strange behavior of a systemExamples: Strange behavior of a system

Take the list of n real numbers:Take the list of n real numbers:X={xX={x11,x,x22,…,x,…,xnn}}

Define the mapping Define the mapping T: RT: Rnn→R→Rnn

T(T(X)={xX)={x11- x- xnn, x, x22-x-x11,…, x,…, xnn-x-xn-1n-1}=|X-Shift(X)|}=|X-Shift(X)|

Iterate T! (a discrete dinamical system)Iterate T! (a discrete dinamical system)

Experiments

Statements:Statements:

For odd For odd nn’s, the iteration can give periodic sequence’s, the iteration can give periodic sequence

For even For even nn’s, almost every sequence becomes zero after ’s, almost every sequence becomes zero after finite steps, but…finite steps, but…

Page 23: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

We have a 10x10 meter size square guarden. How many We have a 10x10 meter size square guarden. How many of unit square turves are needed to grass the garden, if of unit square turves are needed to grass the garden, if an empty square will be grassed if it has at least two an empty square will be grassed if it has at least two grassed neighbours. grassed neighbours.

Statement:Statement: 10 squares are sufficient. 10 squares are sufficient.

Examples: GrassingExamples: Grassing

Page 24: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Statement:Statement: 9 squares are not sufficient. 9 squares are not sufficient.

A smart method:A smart method: During the grassing During the grassing the circumference cannot increase.the circumference cannot increase.

Invariance principle !!!Invariance principle !!!(see energy conservation, perpetum (see energy conservation, perpetum

mobile, Ljapunov method, etc.)mobile, Ljapunov method, etc.)

Examples: GrassingExamples: Grassing

Page 25: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Statement:Statement: 9 squares are not sufficient. 9 squares are not sufficient.

9

100A smart method:A smart method: During the grassing During the grassing the circumference cannot increase.the circumference cannot increase.

Algorithmic method: See all the Algorithmic method: See all the possible casespossible cases

Understand the mechanism of the Understand the mechanism of the process. Grass can fill out only the process. Grass can fill out only the covering square.covering square.

Invariance principle !!!Invariance principle !!!(see energy conservation, Ljapunov (see energy conservation, Ljapunov

method, etc.)method, etc.)

Examples: GrassingExamples: Grassing

Simulations

Page 26: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Simple Generalizations:Simple Generalizations:

Simulations

• NxN sized squareNxN sized square

• How the grass diffuse if 1,2,3,4 grassed neighbours are How the grass diffuse if 1,2,3,4 grassed neighbours are needed to occupy an empty square. needed to occupy an empty square.

• What is the role of the initial shape? What is the role of the initial shape?

• How many grassed turvesHow many grassed turves can garantee full grassing for any initial shape?

Examples: GrassingExamples: Grassing

Page 27: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Further generalizationsFurther generalizations

Theory: life games, cellular automata, dinamical systems Theory: life games, cellular automata, dinamical systems

That is why S. Wolfram created That is why S. Wolfram created MathematicaMathematica

• What is the case of the torus and the sphere?What is the case of the torus and the sphere?

• The neighborhood is N, N-E, E, S-E, S, …The neighborhood is N, N-E, E, S-E, S, …

Examples: GrassingExamples: Grassing

Simulations

Page 28: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Even more generalizations : stochastic diffusion Even more generalizations : stochastic diffusion

Theory: stochastic cellular automata, theoretical ecologyTheory: stochastic cellular automata, theoretical ecology

Solution: Solution: Stochastic nonlinear models only with experimental results. Stochastic nonlinear models only with experimental results.

• How the grass is spreading if the probability of grassing is How the grass is spreading if the probability of grassing is P(i)P(i), where , where ii is the number of grassed neighbors? is the number of grassed neighbors?

• How can we handle the extinction? How can we handle the extinction?

• What about weeds among the valuable grass? What about weeds among the valuable grass?

Examples: GrassingExamples: Grassing

Page 29: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Aunty bought a hen. It layed two eggs and then aunty cooked it. Aunty bought a hen. It layed two eggs and then aunty cooked it. Either cocks or hens can hatch out of the eggs. The cocks are eaten, Either cocks or hens can hatch out of the eggs. The cocks are eaten, each hen lays two eggs and eaten after. Once, the barn-yard empties. each hen lays two eggs and eaten after. Once, the barn-yard empties. If we know that 2004 ccoks are eaten, can we say the number of If we know that 2004 ccoks are eaten, can we say the number of hens? hens?

Examples: hens and cocksExamples: hens and cocks

Page 30: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Examples: hens and cocksExamples: hens and cocks

Smart proof:Smart proof:

Chickens=eggs +1Chickens=eggs +1

H+C=2H+1H+C=2H+1

Aunty bought a hen. It layed two eggs and then aunty cooked it. Aunty bought a hen. It layed two eggs and then aunty cooked it. Either cocks or hens can hatch out of the eggs. The cocks are eaten, Either cocks or hens can hatch out of the eggs. The cocks are eaten, each hen lays two eggs and eaten after. Once, the barn-yard empties. each hen lays two eggs and eaten after. Once, the barn-yard empties. If we know that 2004 ccoks are eaten, can we say the number of If we know that 2004 ccoks are eaten, can we say the number of hens? hens?

Page 31: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Examples: hens and cocksExamples: hens and cocks

Algorithmic study Algorithmic study

Give an algorithm for the egg-Give an algorithm for the egg-laying process!laying process!

Construction

Smart proof:Smart proof:

Chickens=eggs +1Chickens=eggs +1

H+C=2H+1H+C=2H+1

Aunty bought a hen. It layed two eggs and then aunty cooked it. Aunty bought a hen. It layed two eggs and then aunty cooked it. Either cocks or hens can hatch out of the eggs. The cocks are eaten, Either cocks or hens can hatch out of the eggs. The cocks are eaten, each hen lays two eggs and eaten after. Once, the barn-yard empties. each hen lays two eggs and eaten after. Once, the barn-yard empties. If we know that 2004 ccoks are eaten, can we say the number of If we know that 2004 ccoks are eaten, can we say the number of hens? hens?

Page 32: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

Further questions:Further questions:

• What is the probability of stopping after What is the probability of stopping after nn steps? steps?

• What is the expected value of the time of stopping?What is the expected value of the time of stopping?

• What happens if there are mutant hens lying more or less eggs?What happens if there are mutant hens lying more or less eggs?

• What are the methods of the construction and investigation of trees? What are the methods of the construction and investigation of trees?

Construction of a tree

Examples: hens and cocksExamples: hens and cocks

Page 33: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

What is this?What is this?

Examples: Only a questionExamples: Only a question

Page 34: With or Without May 21, 2004 Klára Pintér– János Karsai With or Without With and Without Computing & Problem Solving

With or Without May 21, 2004

The Internet in 1998.Examples: Only a questionExamples: Only a question

See: http://research.lumeta.com/ches/map/