SlideShare ist ein Scribd-Unternehmen logo
1 von 14
A General Solution to Josephus Problem
Yoav Francis
July 2007
Topics in Number Theory, 2007/2
COMAS – College of Management – Academic Studies, Rishon Lezion, Israel
Overview and Additional Problems
Motivation
• Given 𝑞 ∈ ℕ, find 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠 𝑞(𝑛), where 𝑛
denotes the number of people in the initial circle.
• Let us first consider the case in which 𝑞 = 3.
Recursive Solution to 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛)
Where:
• 𝑛 𝑚𝑜𝑑 3 = 0 → 𝑎 𝑛 = −2
• 𝑛 𝑚𝑜𝑑 3 = 1 → 𝑎 𝑛 = 1
• 𝑛 𝑚𝑜𝑑 3 = 2 → 𝑎 𝑛 = −
1
2
A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛)
For a group of 𝑛 people, each time we iterate on a person, we can provide
him with a new number. In such a scenario – the numbers 1,2 would become
𝑛 + 1, 𝑛 + 2. The number 3 would then be killed. 4,5 would become 𝑛 + 3, 𝑛 +
4. 6 would be killed, and so on.
Finally, 3𝑘 + 1, 3𝑘 + 2 would become 𝑛 + 2𝑘 + 1, 𝑛 + 2𝑘 + 2, and 3𝑘 + 3 would
be killed and so on.
Eventually the person denoted as 3𝑛 will be the sole survivor.
Illustration for 𝑛 = 10, 𝑞 = 3:
A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛)
• The 𝑘 𝑡ℎ person to be killed is denoted 3𝑘 (Example: the 10th person is
numbered “30”, the 9th is numbered “27” and so on)
• We can find out who is the survivor if we find the original number of the
person numbered 3𝑛 (let us mark 𝑁 = 3𝑛)
• If 𝑁 > 𝑛 then the person numbered 𝑁 necessarily had a previous number,
which we can find in the following manner:
• 𝑁 = 𝑛 + 2𝑘 + 1 or 𝑁 = 𝑛 + 2𝑘 + 2 (Similarly to how we found the next number of 3𝑘 + 1 and
3𝑘 + 2 in the previous slide)
• Thus 𝑘 =
𝑁−𝑛−1
2
. The previous number of the person was 3𝑘 + 1 or 3𝑘 + 2
– meaning, it was 3𝑘 + 𝑁 − 𝑛 − 2𝑘 = 𝑘 + 𝑁 − 𝑛 (using 𝑁 − 𝑛 − 2𝑘 = 1)
A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛)
We have received an algorithm for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛):
A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛)
Let us note that this can be somewhat improved. The algorithm is not
recursive, neither has a “closed” shape – but still allows us to compute the
answer rather quickly for a large 𝑛.
Luckily, we can improve it.
• Let us define 𝐷 = 3𝑛 + 1 − 𝑁 and use it instead of 𝑁.
• This change matches numbering from 3𝑛 to 1 instead of from 1 to 3𝑛.
• This yields the following:
A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛)
We can now write the algorithm in the following manner:
This is a much simpler form as 𝑛 enters the computation in a simple manner.
The General Algorithm for Josephus Problem
In a matter of fact, we can use the same justifications we used to show that
the survivor for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠 𝑞(𝑛) (where every 𝑞 𝑡ℎ
person is killed) is computed in
the following way:
This is the general algorithm. Let us note that for 𝑞 = 2 we’d get in every
phase 𝐷 = 2𝐷, so for the case of 𝑞 = 2 we get:
𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠2 𝑛 = 2 ⋅ 𝑛 − 2 log2 𝑛
+ 1
The General Algorithm for Josephus Problem
We can attempt to bring the algorithm to a “nicer” form.
It cannot be brought to a closed form (but for the case of 𝑞 = 2), due to the
“ceiling” function that we perform on every phase.
However – we can still tidy-up the algorithm. Let us recursively define:
These numbers do not have a “nice” form but for 𝑞 = 2, but if we agree to
accept the expression 𝐷 𝑛
(𝑞)
as a “known expression” – then the solution for the
general case of the Josephus problem would be:
(Where 𝑘 is the smallest one for which the following holds: Dk
(𝑞)
> 𝑞 − 1 ⋅ 𝑛 )
Additional Problems Derived From
Josephus Problem
Finding 𝐼 𝑛 the second-to-last person remaining in Josephus problem
(For example, if we want to find the last 2 people standing).
Let us denote 𝑛 = 2 𝑚 + 1 and get:
Additional Problems Derived From
Josephus Problem
Another problem: Josephus finds himself in the position 𝑗 (1 ≤ 𝑗 ≤ 𝑛).
Given that he can choose the “skip factor”(𝑞), which 𝑞 should he
choose so he stays alive?
Let us define 𝐿 𝑛 = 𝐿𝐶𝑀(1,2,3, … , 𝑛) and assume that 𝑛 > 2. By
Bertrand’s Postulate there exists a prime number
𝑛
2
< 𝑝 < 𝑛. We can
also assume that 𝑗 >
𝑛
2
.
We’d want to choose a q so the following holds:
• 𝑞 ≡ 1 𝑚𝑜𝑑
𝐿 𝑛
𝑝
and:
• 𝑞 ≡ 𝑗 + 1 − 𝑛 (𝑚𝑜𝑑 𝑝)
Additional Problems Derived From
Josephus Problem
Now, the people who would be removed (“killed”) are:
• 1,2,….,n−p, j+1, j+2,….,n, n−p+1,…..j−1
The 𝑗 𝑡ℎ
position would not be killed (we may get 𝑞 ≥ 𝑛 but that is still
valid for the problem)
Example:
• 𝑛 = 10, 𝑝 = 7. Josephus got 𝑗 = 6 and will decide: 𝑞 = 361
(This holds for the 2 requirements of 𝑞).
• LCM(1,….,10) = 2520
Thanks

Weitere ähnliche Inhalte

Was ist angesagt?

Makalah aplikasi integral dalam menghitung volume keranjang buah jeruk
Makalah aplikasi integral dalam menghitung volume keranjang buah jerukMakalah aplikasi integral dalam menghitung volume keranjang buah jeruk
Makalah aplikasi integral dalam menghitung volume keranjang buah jerukMutiaagustin15
 
Supremum dan infimum
Supremum dan infimum  Supremum dan infimum
Supremum dan infimum Rossi Fauzi
 
KELOMPOK 5_SIFAT ARCHIMEDES.pptx
KELOMPOK 5_SIFAT ARCHIMEDES.pptxKELOMPOK 5_SIFAT ARCHIMEDES.pptx
KELOMPOK 5_SIFAT ARCHIMEDES.pptxThomiAzZarowi
 
Binomial dan Multinomial
Binomial dan MultinomialBinomial dan Multinomial
Binomial dan MultinomialHeni Widayani
 
Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3
Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3
Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3Arvina Frida Karela
 
Makalah STATISTIK MAEMATIKA II VARIABEL RANDOM
Makalah STATISTIK MAEMATIKA II VARIABEL RANDOMMakalah STATISTIK MAEMATIKA II VARIABEL RANDOM
Makalah STATISTIK MAEMATIKA II VARIABEL RANDOMNila Aulia
 
Contoh Soal Matematika Kombinatorik
Contoh Soal Matematika KombinatorikContoh Soal Matematika Kombinatorik
Contoh Soal Matematika Kombinatoriksiska sri asali
 
PPT SPLDV dengan 3 metode penyelesaian
PPT SPLDV dengan 3 metode penyelesaianPPT SPLDV dengan 3 metode penyelesaian
PPT SPLDV dengan 3 metode penyelesaianYoanna Rianda
 
Analisis Vektor ( Bidang )
Analisis Vektor ( Bidang )Analisis Vektor ( Bidang )
Analisis Vektor ( Bidang )Phe Phe
 
kunci jawaban grup
kunci jawaban grupkunci jawaban grup
kunci jawaban grupchikarahayu
 
70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak
70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak
70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlakMuhammad Arif
 
Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...
Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...
Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...Onggo Wiryawan
 

Was ist angesagt? (20)

Makalah aplikasi integral dalam menghitung volume keranjang buah jeruk
Makalah aplikasi integral dalam menghitung volume keranjang buah jerukMakalah aplikasi integral dalam menghitung volume keranjang buah jeruk
Makalah aplikasi integral dalam menghitung volume keranjang buah jeruk
 
Supremum dan infimum
Supremum dan infimum  Supremum dan infimum
Supremum dan infimum
 
Makalah aturan trapesium
Makalah aturan trapesiumMakalah aturan trapesium
Makalah aturan trapesium
 
KELOMPOK 5_SIFAT ARCHIMEDES.pptx
KELOMPOK 5_SIFAT ARCHIMEDES.pptxKELOMPOK 5_SIFAT ARCHIMEDES.pptx
KELOMPOK 5_SIFAT ARCHIMEDES.pptx
 
Binomial dan Multinomial
Binomial dan MultinomialBinomial dan Multinomial
Binomial dan Multinomial
 
L i m i t
L i m i tL i m i t
L i m i t
 
Desimal, kerapatan dan kalkulator
Desimal, kerapatan dan kalkulatorDesimal, kerapatan dan kalkulator
Desimal, kerapatan dan kalkulator
 
Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3
Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3
Analisis Real (Barisan Bilangan Real) Latihan bagian 2.3
 
Handout analisis real
Handout analisis realHandout analisis real
Handout analisis real
 
notasi leibniz
notasi leibniznotasi leibniz
notasi leibniz
 
Makalah STATISTIK MAEMATIKA II VARIABEL RANDOM
Makalah STATISTIK MAEMATIKA II VARIABEL RANDOMMakalah STATISTIK MAEMATIKA II VARIABEL RANDOM
Makalah STATISTIK MAEMATIKA II VARIABEL RANDOM
 
Contoh Soal Matematika Kombinatorik
Contoh Soal Matematika KombinatorikContoh Soal Matematika Kombinatorik
Contoh Soal Matematika Kombinatorik
 
PPT SPLDV dengan 3 metode penyelesaian
PPT SPLDV dengan 3 metode penyelesaianPPT SPLDV dengan 3 metode penyelesaian
PPT SPLDV dengan 3 metode penyelesaian
 
Analisis Vektor ( Bidang )
Analisis Vektor ( Bidang )Analisis Vektor ( Bidang )
Analisis Vektor ( Bidang )
 
Induksi Matematika
Induksi MatematikaInduksi Matematika
Induksi Matematika
 
kunci jawaban grup
kunci jawaban grupkunci jawaban grup
kunci jawaban grup
 
70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak
70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak
70 soal dan pembahasan persamaan dan pertidaksamaan nilai mutlak
 
Teori bilangan
Teori bilanganTeori bilangan
Teori bilangan
 
Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...
Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...
Relasi rekursi (2) : Menentukan solusi relasi Rekursi Linier Homogen Berkoefi...
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
 

Andere mochten auch

Computer notes - Josephus Problem
Computer notes - Josephus ProblemComputer notes - Josephus Problem
Computer notes - Josephus Problemecomputernotes
 
Cloud Caching Proxy+ - Scalable Cloud-Based Proxy Server
Cloud Caching Proxy+ - Scalable Cloud-Based Proxy ServerCloud Caching Proxy+ - Scalable Cloud-Based Proxy Server
Cloud Caching Proxy+ - Scalable Cloud-Based Proxy ServerYoav Francis
 
15 algoritmos de busca em tabelas - sequencial e binaria
15   algoritmos de busca em tabelas - sequencial e binaria15   algoritmos de busca em tabelas - sequencial e binaria
15 algoritmos de busca em tabelas - sequencial e binariaRicardo Bolanho
 
Fisheye State Routing (FSR) - Protocol Overview
Fisheye State Routing (FSR) - Protocol OverviewFisheye State Routing (FSR) - Protocol Overview
Fisheye State Routing (FSR) - Protocol OverviewYoav Francis
 
1953 and all that. A tale of two sciences (Kitcher, 1984)
1953 and all that. A tale of two sciences (Kitcher, 1984)1953 and all that. A tale of two sciences (Kitcher, 1984)
1953 and all that. A tale of two sciences (Kitcher, 1984)Yoav Francis
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)swajahatr
 

Andere mochten auch (6)

Computer notes - Josephus Problem
Computer notes - Josephus ProblemComputer notes - Josephus Problem
Computer notes - Josephus Problem
 
Cloud Caching Proxy+ - Scalable Cloud-Based Proxy Server
Cloud Caching Proxy+ - Scalable Cloud-Based Proxy ServerCloud Caching Proxy+ - Scalable Cloud-Based Proxy Server
Cloud Caching Proxy+ - Scalable Cloud-Based Proxy Server
 
15 algoritmos de busca em tabelas - sequencial e binaria
15   algoritmos de busca em tabelas - sequencial e binaria15   algoritmos de busca em tabelas - sequencial e binaria
15 algoritmos de busca em tabelas - sequencial e binaria
 
Fisheye State Routing (FSR) - Protocol Overview
Fisheye State Routing (FSR) - Protocol OverviewFisheye State Routing (FSR) - Protocol Overview
Fisheye State Routing (FSR) - Protocol Overview
 
1953 and all that. A tale of two sciences (Kitcher, 1984)
1953 and all that. A tale of two sciences (Kitcher, 1984)1953 and all that. A tale of two sciences (Kitcher, 1984)
1953 and all that. A tale of two sciences (Kitcher, 1984)
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 

Ähnlich wie General Solution for Josephus Problem

Introduction to polynomials
Introduction to polynomialsIntroduction to polynomials
Introduction to polynomialsnarayana dash
 
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsRecurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsMenglinLiu1
 
Комплекс тоо цуврал хичээл-2
Комплекс тоо цуврал хичээл-2Комплекс тоо цуврал хичээл-2
Комплекс тоо цуврал хичээл-2Март
 
Homogeneous Linear Differential Equations
 Homogeneous Linear Differential Equations Homogeneous Linear Differential Equations
Homogeneous Linear Differential EquationsAMINULISLAM439
 
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix MappingDual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mappinginventionjournals
 
BSC_Computer Science_Discrete Mathematics_Unit-I
BSC_Computer Science_Discrete Mathematics_Unit-IBSC_Computer Science_Discrete Mathematics_Unit-I
BSC_Computer Science_Discrete Mathematics_Unit-IRai University
 
BSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICSBSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICSRai University
 
One solution for many linear partial differential equations with terms of equ...
One solution for many linear partial differential equations with terms of equ...One solution for many linear partial differential equations with terms of equ...
One solution for many linear partial differential equations with terms of equ...Lossian Barbosa Bacelar Miranda
 
Functions of severable variables
Functions of severable variablesFunctions of severable variables
Functions of severable variablesSanthanam Krishnan
 
ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022
 ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022 ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022
ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022anasKhalaf4
 
A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵
A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵
A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵mathsjournal
 
Lesson 1: The Real Number System
Lesson 1: The Real Number SystemLesson 1: The Real Number System
Lesson 1: The Real Number SystemKevin Johnson
 
Lecture 1.3 methods of solutions of quadratic equations
Lecture 1.3 methods of solutions of quadratic equationsLecture 1.3 methods of solutions of quadratic equations
Lecture 1.3 methods of solutions of quadratic equationsnarayana dash
 
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاولملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاولanasKhalaf4
 
The binomial theorem class 11 maths
The binomial theorem class 11 mathsThe binomial theorem class 11 maths
The binomial theorem class 11 mathsDharmendra Dudi
 
thebinomialtheorem-170110005856.pdf
thebinomialtheorem-170110005856.pdfthebinomialtheorem-170110005856.pdf
thebinomialtheorem-170110005856.pdfRajDubey83
 
Lecture-1-Mech.pptx . .
Lecture-1-Mech.pptx                   . .Lecture-1-Mech.pptx                   . .
Lecture-1-Mech.pptx . .happycocoman
 

Ähnlich wie General Solution for Josephus Problem (20)

Introduction to polynomials
Introduction to polynomialsIntroduction to polynomials
Introduction to polynomials
 
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsRecurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
 
Комплекс тоо цуврал хичээл-2
Комплекс тоо цуврал хичээл-2Комплекс тоо цуврал хичээл-2
Комплекс тоо цуврал хичээл-2
 
G0733945
G0733945G0733945
G0733945
 
Homogeneous Linear Differential Equations
 Homogeneous Linear Differential Equations Homogeneous Linear Differential Equations
Homogeneous Linear Differential Equations
 
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix MappingDual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
 
BSC_Computer Science_Discrete Mathematics_Unit-I
BSC_Computer Science_Discrete Mathematics_Unit-IBSC_Computer Science_Discrete Mathematics_Unit-I
BSC_Computer Science_Discrete Mathematics_Unit-I
 
BSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICSBSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-1_DISCRETE MATHEMATICS
 
Systems of linear equation
Systems of linear equationSystems of linear equation
Systems of linear equation
 
One solution for many linear partial differential equations with terms of equ...
One solution for many linear partial differential equations with terms of equ...One solution for many linear partial differential equations with terms of equ...
One solution for many linear partial differential equations with terms of equ...
 
Functions of severable variables
Functions of severable variablesFunctions of severable variables
Functions of severable variables
 
Algebra
AlgebraAlgebra
Algebra
 
ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022
 ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022 ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022
ملزمة الرياضيات للصف السادس التطبيقي الفصل الاول الاعداد المركبة 2022
 
A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵
A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵
A Positive Integer 𝑵 Such That 𝒑𝒏 + 𝒑𝒏+𝟑 ~ 𝒑𝒏+𝟏 + 𝒑𝒏+𝟐 For All 𝒏 ≥ 𝑵
 
Lesson 1: The Real Number System
Lesson 1: The Real Number SystemLesson 1: The Real Number System
Lesson 1: The Real Number System
 
Lecture 1.3 methods of solutions of quadratic equations
Lecture 1.3 methods of solutions of quadratic equationsLecture 1.3 methods of solutions of quadratic equations
Lecture 1.3 methods of solutions of quadratic equations
 
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاولملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
ملزمة الرياضيات للصف السادس الاحيائي الفصل الاول
 
The binomial theorem class 11 maths
The binomial theorem class 11 mathsThe binomial theorem class 11 maths
The binomial theorem class 11 maths
 
thebinomialtheorem-170110005856.pdf
thebinomialtheorem-170110005856.pdfthebinomialtheorem-170110005856.pdf
thebinomialtheorem-170110005856.pdf
 
Lecture-1-Mech.pptx . .
Lecture-1-Mech.pptx                   . .Lecture-1-Mech.pptx                   . .
Lecture-1-Mech.pptx . .
 

Mehr von Yoav Francis

Marxism in the internet age and social networks
Marxism in the internet age and social networksMarxism in the internet age and social networks
Marxism in the internet age and social networksYoav Francis
 
States of Mind: can they be communicated and compared?
States of Mind: can they be communicated and compared?States of Mind: can they be communicated and compared?
States of Mind: can they be communicated and compared?Yoav Francis
 
Carnivores: Inspection under Philosophy of Action
Carnivores: Inspection under Philosophy of ActionCarnivores: Inspection under Philosophy of Action
Carnivores: Inspection under Philosophy of ActionYoav Francis
 
From Hierarchical to a One-Level view of Consciousness: Overview and Comparison
From Hierarchical to a One-Level view of Consciousness: Overview and ComparisonFrom Hierarchical to a One-Level view of Consciousness: Overview and Comparison
From Hierarchical to a One-Level view of Consciousness: Overview and ComparisonYoav Francis
 
Theories of Consciousness - Overview and Discussion
Theories of Consciousness - Overview and DiscussionTheories of Consciousness - Overview and Discussion
Theories of Consciousness - Overview and DiscussionYoav Francis
 
McTaggart's Argument on the Unreality of Time - Overview and Discussion
McTaggart's Argument on the Unreality of Time - Overview and DiscussionMcTaggart's Argument on the Unreality of Time - Overview and Discussion
McTaggart's Argument on the Unreality of Time - Overview and DiscussionYoav Francis
 
Epicurean Physics: on the Existence of Minimal Units
Epicurean Physics: on the Existence of Minimal UnitsEpicurean Physics: on the Existence of Minimal Units
Epicurean Physics: on the Existence of Minimal UnitsYoav Francis
 
Isaiah Berlin: Positive and Negative Freedom
Isaiah Berlin: Positive and Negative FreedomIsaiah Berlin: Positive and Negative Freedom
Isaiah Berlin: Positive and Negative FreedomYoav Francis
 
"A Single Man": Choosing Life in a Nietzschean Context
"A Single Man": Choosing Life in a Nietzschean Context"A Single Man": Choosing Life in a Nietzschean Context
"A Single Man": Choosing Life in a Nietzschean ContextYoav Francis
 
Durkheim, Weber and Comte: Comparative Analysis and Analysis
Durkheim, Weber and Comte: Comparative Analysis and AnalysisDurkheim, Weber and Comte: Comparative Analysis and Analysis
Durkheim, Weber and Comte: Comparative Analysis and AnalysisYoav Francis
 
Wii Sensor Bar Positioning in 3D Space
Wii Sensor Bar Positioning in 3D SpaceWii Sensor Bar Positioning in 3D Space
Wii Sensor Bar Positioning in 3D SpaceYoav Francis
 
NLP Literature Survey with focus on Computerized Deception Detection
NLP Literature Survey with focus on Computerized Deception DetectionNLP Literature Survey with focus on Computerized Deception Detection
NLP Literature Survey with focus on Computerized Deception DetectionYoav Francis
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesYoav Francis
 
Floodlight OpenFlow DDoS
Floodlight OpenFlow DDoSFloodlight OpenFlow DDoS
Floodlight OpenFlow DDoSYoav Francis
 

Mehr von Yoav Francis (14)

Marxism in the internet age and social networks
Marxism in the internet age and social networksMarxism in the internet age and social networks
Marxism in the internet age and social networks
 
States of Mind: can they be communicated and compared?
States of Mind: can they be communicated and compared?States of Mind: can they be communicated and compared?
States of Mind: can they be communicated and compared?
 
Carnivores: Inspection under Philosophy of Action
Carnivores: Inspection under Philosophy of ActionCarnivores: Inspection under Philosophy of Action
Carnivores: Inspection under Philosophy of Action
 
From Hierarchical to a One-Level view of Consciousness: Overview and Comparison
From Hierarchical to a One-Level view of Consciousness: Overview and ComparisonFrom Hierarchical to a One-Level view of Consciousness: Overview and Comparison
From Hierarchical to a One-Level view of Consciousness: Overview and Comparison
 
Theories of Consciousness - Overview and Discussion
Theories of Consciousness - Overview and DiscussionTheories of Consciousness - Overview and Discussion
Theories of Consciousness - Overview and Discussion
 
McTaggart's Argument on the Unreality of Time - Overview and Discussion
McTaggart's Argument on the Unreality of Time - Overview and DiscussionMcTaggart's Argument on the Unreality of Time - Overview and Discussion
McTaggart's Argument on the Unreality of Time - Overview and Discussion
 
Epicurean Physics: on the Existence of Minimal Units
Epicurean Physics: on the Existence of Minimal UnitsEpicurean Physics: on the Existence of Minimal Units
Epicurean Physics: on the Existence of Minimal Units
 
Isaiah Berlin: Positive and Negative Freedom
Isaiah Berlin: Positive and Negative FreedomIsaiah Berlin: Positive and Negative Freedom
Isaiah Berlin: Positive and Negative Freedom
 
"A Single Man": Choosing Life in a Nietzschean Context
"A Single Man": Choosing Life in a Nietzschean Context"A Single Man": Choosing Life in a Nietzschean Context
"A Single Man": Choosing Life in a Nietzschean Context
 
Durkheim, Weber and Comte: Comparative Analysis and Analysis
Durkheim, Weber and Comte: Comparative Analysis and AnalysisDurkheim, Weber and Comte: Comparative Analysis and Analysis
Durkheim, Weber and Comte: Comparative Analysis and Analysis
 
Wii Sensor Bar Positioning in 3D Space
Wii Sensor Bar Positioning in 3D SpaceWii Sensor Bar Positioning in 3D Space
Wii Sensor Bar Positioning in 3D Space
 
NLP Literature Survey with focus on Computerized Deception Detection
NLP Literature Survey with focus on Computerized Deception DetectionNLP Literature Survey with focus on Computerized Deception Detection
NLP Literature Survey with focus on Computerized Deception Detection
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and Practices
 
Floodlight OpenFlow DDoS
Floodlight OpenFlow DDoSFloodlight OpenFlow DDoS
Floodlight OpenFlow DDoS
 

Kürzlich hochgeladen

Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Call Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girl
Call Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girlCall Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girl
Call Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girlkumarajju5765
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Kürzlich hochgeladen (20)

Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girl
Call Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girlCall Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girl
Call Girls 🫤 Dwarka ➡️ 9711199171 ➡️ Delhi 🫦 Two shot with one girl
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 

General Solution for Josephus Problem

  • 1. A General Solution to Josephus Problem Yoav Francis July 2007 Topics in Number Theory, 2007/2 COMAS – College of Management – Academic Studies, Rishon Lezion, Israel Overview and Additional Problems
  • 2. Motivation • Given 𝑞 ∈ ℕ, find 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠 𝑞(𝑛), where 𝑛 denotes the number of people in the initial circle. • Let us first consider the case in which 𝑞 = 3.
  • 3. Recursive Solution to 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛) Where: • 𝑛 𝑚𝑜𝑑 3 = 0 → 𝑎 𝑛 = −2 • 𝑛 𝑚𝑜𝑑 3 = 1 → 𝑎 𝑛 = 1 • 𝑛 𝑚𝑜𝑑 3 = 2 → 𝑎 𝑛 = − 1 2
  • 4. A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛) For a group of 𝑛 people, each time we iterate on a person, we can provide him with a new number. In such a scenario – the numbers 1,2 would become 𝑛 + 1, 𝑛 + 2. The number 3 would then be killed. 4,5 would become 𝑛 + 3, 𝑛 + 4. 6 would be killed, and so on. Finally, 3𝑘 + 1, 3𝑘 + 2 would become 𝑛 + 2𝑘 + 1, 𝑛 + 2𝑘 + 2, and 3𝑘 + 3 would be killed and so on. Eventually the person denoted as 3𝑛 will be the sole survivor. Illustration for 𝑛 = 10, 𝑞 = 3:
  • 5. A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛) • The 𝑘 𝑡ℎ person to be killed is denoted 3𝑘 (Example: the 10th person is numbered “30”, the 9th is numbered “27” and so on) • We can find out who is the survivor if we find the original number of the person numbered 3𝑛 (let us mark 𝑁 = 3𝑛) • If 𝑁 > 𝑛 then the person numbered 𝑁 necessarily had a previous number, which we can find in the following manner: • 𝑁 = 𝑛 + 2𝑘 + 1 or 𝑁 = 𝑛 + 2𝑘 + 2 (Similarly to how we found the next number of 3𝑘 + 1 and 3𝑘 + 2 in the previous slide) • Thus 𝑘 = 𝑁−𝑛−1 2 . The previous number of the person was 3𝑘 + 1 or 3𝑘 + 2 – meaning, it was 3𝑘 + 𝑁 − 𝑛 − 2𝑘 = 𝑘 + 𝑁 − 𝑛 (using 𝑁 − 𝑛 − 2𝑘 = 1)
  • 6. A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛) We have received an algorithm for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛):
  • 7. A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛) Let us note that this can be somewhat improved. The algorithm is not recursive, neither has a “closed” shape – but still allows us to compute the answer rather quickly for a large 𝑛. Luckily, we can improve it. • Let us define 𝐷 = 3𝑛 + 1 − 𝑁 and use it instead of 𝑁. • This change matches numbering from 3𝑛 to 1 instead of from 1 to 3𝑛. • This yields the following:
  • 8. A General Method for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠3(𝑛) We can now write the algorithm in the following manner: This is a much simpler form as 𝑛 enters the computation in a simple manner.
  • 9. The General Algorithm for Josephus Problem In a matter of fact, we can use the same justifications we used to show that the survivor for 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠 𝑞(𝑛) (where every 𝑞 𝑡ℎ person is killed) is computed in the following way: This is the general algorithm. Let us note that for 𝑞 = 2 we’d get in every phase 𝐷 = 2𝐷, so for the case of 𝑞 = 2 we get: 𝐽𝑜𝑠𝑒𝑝ℎ𝑢𝑠2 𝑛 = 2 ⋅ 𝑛 − 2 log2 𝑛 + 1
  • 10. The General Algorithm for Josephus Problem We can attempt to bring the algorithm to a “nicer” form. It cannot be brought to a closed form (but for the case of 𝑞 = 2), due to the “ceiling” function that we perform on every phase. However – we can still tidy-up the algorithm. Let us recursively define: These numbers do not have a “nice” form but for 𝑞 = 2, but if we agree to accept the expression 𝐷 𝑛 (𝑞) as a “known expression” – then the solution for the general case of the Josephus problem would be: (Where 𝑘 is the smallest one for which the following holds: Dk (𝑞) > 𝑞 − 1 ⋅ 𝑛 )
  • 11. Additional Problems Derived From Josephus Problem Finding 𝐼 𝑛 the second-to-last person remaining in Josephus problem (For example, if we want to find the last 2 people standing). Let us denote 𝑛 = 2 𝑚 + 1 and get:
  • 12. Additional Problems Derived From Josephus Problem Another problem: Josephus finds himself in the position 𝑗 (1 ≤ 𝑗 ≤ 𝑛). Given that he can choose the “skip factor”(𝑞), which 𝑞 should he choose so he stays alive? Let us define 𝐿 𝑛 = 𝐿𝐶𝑀(1,2,3, … , 𝑛) and assume that 𝑛 > 2. By Bertrand’s Postulate there exists a prime number 𝑛 2 < 𝑝 < 𝑛. We can also assume that 𝑗 > 𝑛 2 . We’d want to choose a q so the following holds: • 𝑞 ≡ 1 𝑚𝑜𝑑 𝐿 𝑛 𝑝 and: • 𝑞 ≡ 𝑗 + 1 − 𝑛 (𝑚𝑜𝑑 𝑝)
  • 13. Additional Problems Derived From Josephus Problem Now, the people who would be removed (“killed”) are: • 1,2,….,n−p, j+1, j+2,….,n, n−p+1,…..j−1 The 𝑗 𝑡ℎ position would not be killed (we may get 𝑞 ≥ 𝑛 but that is still valid for the problem) Example: • 𝑛 = 10, 𝑝 = 7. Josephus got 𝑗 = 6 and will decide: 𝑞 = 361 (This holds for the 2 requirements of 𝑞). • LCM(1,….,10) = 2520