You are on page 1of 11

WEEK 10

JOSEPHUS PROBLEM
LERSAN B. DEL MUNDO, MS
Josephus Problem

´ Flavius Josephus is a Jewish historian living in the 1st


century. According to his account, he and his 40
comrade soldiers were trapped in a cave, surrounded
by Romans. They chose suicide over capture and
decided that they would form a circle and start killing
one by skipping every two others. By luck, or maybe by
the hand of God, Josephus and another man remained
the last and gave up to the Romans.
Data Abstraction
3

´ There is nothing “circular” inside computer, and nothing can be


“removed” physically.
´ But we can arrange memory cells to “model” and “simulate” themè
data structure
´ Some common data structures
Model n People in a Circle
4

´ We can use “data structure” to model it.

´This is called a
“circular linked list”. 1
´ Each node is of some 8 2
“struct” data type
´ Each link is a “pointer”
7 3
6 4
5
Computer Simulation
5

´How to perform simulations on computers?


´We need to use what computer can do
to represent the model and perform
actions.

´https://www.geogebra.org/m/ExvvrBbR
(Use the link above to simulate the problem.
You can vary your n but set your k=2)
ASSESSMENT

Josephus Problem
https://www.youtube.com/watch?v=uCsD3ZGzMgE

Guide Questions:
´ Three (3) things that I significantly learned from the video
clip.
´ What observations/patterns do I see in this problem?
´ How do I generalize the problem?
Midterm Details
COVERAGE

´Problem Solving (PS)


´UPS✔ (Polya’s 4 Step to PS)
´Strategies to PS
COVERAGE

´10 PS (Week 9)
´Tower of Hanoi (Week 7)
´Monte Hall (Week 8)
´Josephus (Week 10)
INSTRUCTION

´The link will be opened on the schedule


date and time of the exam.
´Each student is allowed to take the exam
once. All examination taker's information is
recorded including the date and time of
access.
´There will be three parts of the exam.
TYPE OF TEST

´Regular (Scheduled)
´Multiple Choice
´True or False
´Oral Examination

You might also like