SlideShare a Scribd company logo
1 of 35
Download to read offline




Riset Operasi

Program Dinamik
endrayanto@ugm.ac.idirwanendrayanto
Irwan Endrayantoendrayanto
Puzzles
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
# Sisa Korek Api
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
# Sisa Korek Api
30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
# Sisa Korek Api
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
+ 4
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Matches Puzzle
30 matches
2 player (me vs opponent)
take 1 , 2 or 3 matches
me take first
the last person with 1 match is the
loser
Me Opponent
1
5
# Sisa Korek Api
9
13
+ 4
+ 4
+ 4
17
+ 4
21
+ 4
25
+ 4
29
+ 4
me take first 30
Exercise 1
Suppose there are 40 matches on a table.
I begin by picking up 1, 2, 3, or 4 matches.
Then my opponent must pick up 1, 2, 3, or 4 matches.
We continue until the last match is picked up.
The player who picks up the last match is the loser.
Can I be sure of victory? If so, how?
Winston, Operations Research: Applications and Algorithms, 4th Edition:
Ch. 18. Deterministic Dynamic Programming
18.1 Problem A, no.1
Water Jug Problem
9 gallon 4 gallon
Bagaimana saya bisa mendapatkan tepat 6
gallon dari dua gallon dengan ukuran 9 dan 4
ini?
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Water Jug Problem
9 gallon 4 gallon
6 0
6 4
9 1
0 1
1 0
1 4
5 0
5 4
9 0
0 0
9
4
Exercise 2
Given a 7-oz cup and a 3-oz cup, explain how we can return
from a well with 5 oz of water.
Winston, Operations Research: Applications and Algorithms, 4th Edition:
Ch. 18. Deterministic Dynamic Programming
18.1 Problem B, no.4
Exercise 3
Given a 5 gallon water jug and a 3 gallon water jug, explain how
we can return from a well with 4 gallon of water.
Problem from the movie DIE HARD 3: Die Hard with a Vengeance (1995)
Selamat belajar
endrayanto@ugm.ac.id
irwanendrayanto
Irwan Endrayanto
endrayanto

More Related Content

Similar to Program dinamik - Puzzle

Unit 12: Probability
Unit 12: ProbabilityUnit 12: Probability
Unit 12: Probability
Renegarmath
 

Similar to Program dinamik - Puzzle (6)

Training the Mind to Think Most Intelligently...
Training the Mind to Think Most Intelligently...Training the Mind to Think Most Intelligently...
Training the Mind to Think Most Intelligently...
 
Proper Training of the Mind...
Proper Training of the Mind...Proper Training of the Mind...
Proper Training of the Mind...
 
Working with Mental Puzzles Will Train the Mind
Working with Mental Puzzles Will Train the MindWorking with Mental Puzzles Will Train the Mind
Working with Mental Puzzles Will Train the Mind
 
It's Time to Exercise the Mind.pptx
It's Time to Exercise the Mind.pptxIt's Time to Exercise the Mind.pptx
It's Time to Exercise the Mind.pptx
 
It's great to have mental exercise constantly.pptx
It's great to have mental exercise constantly.pptxIt's great to have mental exercise constantly.pptx
It's great to have mental exercise constantly.pptx
 
Unit 12: Probability
Unit 12: ProbabilityUnit 12: Probability
Unit 12: Probability
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Program dinamik - Puzzle

  • 2. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser
  • 3. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent # Sisa Korek Api
  • 4. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 # Sisa Korek Api 30
  • 5. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 # Sisa Korek Api me take first 30
  • 6. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api + 4 me take first 30
  • 7. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api + 4 me take first 30
  • 8. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api + 4 me take first 30
  • 9. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 + 4 + 4 me take first 30
  • 10. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 me take first 30
  • 11. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 me take first 30
  • 12. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 me take first 30
  • 13. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 me take first 30
  • 14. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 15. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 16. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 17. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 18. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 19. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 20. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 21. Matches Puzzle 30 matches 2 player (me vs opponent) take 1 , 2 or 3 matches me take first the last person with 1 match is the loser Me Opponent 1 5 # Sisa Korek Api 9 13 + 4 + 4 + 4 17 + 4 21 + 4 25 + 4 29 + 4 me take first 30
  • 22. Exercise 1 Suppose there are 40 matches on a table. I begin by picking up 1, 2, 3, or 4 matches. Then my opponent must pick up 1, 2, 3, or 4 matches. We continue until the last match is picked up. The player who picks up the last match is the loser. Can I be sure of victory? If so, how? Winston, Operations Research: Applications and Algorithms, 4th Edition: Ch. 18. Deterministic Dynamic Programming 18.1 Problem A, no.1
  • 23. Water Jug Problem 9 gallon 4 gallon Bagaimana saya bisa mendapatkan tepat 6 gallon dari dua gallon dengan ukuran 9 dan 4 ini?
  • 24. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 25. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 26. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 27. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 28. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 29. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 30. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 31. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 32. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 33. Water Jug Problem 9 gallon 4 gallon 6 0 6 4 9 1 0 1 1 0 1 4 5 0 5 4 9 0 0 0 9 4
  • 34. Exercise 2 Given a 7-oz cup and a 3-oz cup, explain how we can return from a well with 5 oz of water. Winston, Operations Research: Applications and Algorithms, 4th Edition: Ch. 18. Deterministic Dynamic Programming 18.1 Problem B, no.4 Exercise 3 Given a 5 gallon water jug and a 3 gallon water jug, explain how we can return from a well with 4 gallon of water. Problem from the movie DIE HARD 3: Die Hard with a Vengeance (1995)