2017년 4월 3일 월요일

Problem of Josephus

Problem of Josephus

The problem (a problem of Josephus British: Josephus problem) of Josephus is one of the theoretical problems of comp-sci and the mathematics. With the problem of Josse Fass.

I am waiting for a row, executed one so that the human being of the person creates a circle. Skip the first person; more I skip a person (in other words I execute) which skips a person, and arrives at the person of the k joint, the person of the k joint. And from there again I skip a person and execute the person of the k joint. Meander in this (Japanese yen gradually becomes small) and release the one who stayed last.

The problem, But, there is it when I was given if I do the starting point where whether you can leave an authorized person till the last.

Table of contents

History

As for the problem of Josephus, the following problem that person (called for convenience false Hegesippus (English version)) who gave Hegesippus [1] wrote based on "Jewish account of war" (Flavius Josephus) in about A.D. 370 is considered to be the origin.

"It was time when the Jew resisted Rome and caused an independence war, and commander-in-chief Josephus of the Jewish side held out a siege in the town of ヨタパタ, but I was surrounded by the Rome forces and fell in 46 days and escaped with 40 comrades in the cave, but I was settled by the food having run out, and the consensus of opinion refusing surrender, and committing suicide, but two people of the friend of Josephus and him wanted to survive somehow, and it was finally in the group step which committed suicide, and Josephus suggested the method that there was, and it was circular, and it set all the members, and a located person had other comrades kill it, and I repeated this, and the last one was a thing to commit suicide third. Because everybody agreed to this suggestion, Josephus and the friend were located to the 16th and the 31st and of I were saved. "

That when this story looks at "the Jewish account of war" of Josephus, it is the same other than having taken a "problem method of Josephus" [2].

Problem of a Turk and the Christian

It depends on a book of the about 17th century. This is often called "a problem of Josephus", too.

"The ship which 15 Turks who was 15 Christians and pagan got on once was wrecked and threw away a load and lightened a ship, but it was still dangerous, and the captain set the passenger who should want that 15 were sacrificed and to jump into the sea in a ring as follows here and at first it was annular and set 13 Christians, Turk 15 and I decided that a captain counted it and cast the body to the sea every ninth and and lined up well and helped all the Christians."

In Japan "put up ままこ", and it

In Japan, I call a similar story "stepchild algorithm" saying "ままこ stand". "It appears when I have given the silver sleep cat which a westing Buddhist priest took from Yoritomo Minamoto based on "the Agatsuma mirror" that it is thought that I edited it in a book of the Muromachi era for Kamakura last years to the child who played at a door front of the Yoritomo's house with the point of "the stepchild algorithm", and what there is it, and Takakazu Seki studied reaches "Essays in Idleness" (Kenkou Yoshida) and "description of dust kalpa" (Mitsuyoshi Yoshida), the designer is ignorance.

Elucidation

At first,  I show the elucidation of the の case  About the の case a summary later description). I show recursive elucidation here.  A function to give back survivor (number) when I begin it in people   とする ). With one lap of the beginning, the person of all even number numbers is executed. With the second lap, the second new person is executed, and the fourth newer person is executed, and と spreads out. The first number of people in the case of an even number with the second lap   The person of the joint is the first lap   It is located in the joint  は option). Therefore,  A person of the joints the beginning   It is located in the joint. From this, next 漸化式 is provided.

 

In the case of an odd number, the first person is executed the first number of people in the first lap last. The second new person is executed with the second lap, and the fourth new person is executed afterwards…と spreads out. In this case,  A person of the joints the beginning   It would be located in the joint. Thus, next 漸化式 is provided.

 

  I make とそれに correspondence   The following pattern appears when I make a の level a table.

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  1 1 3 1 3 5 7 1 3 5 7 9 11 13 15 1

When I see this,  Is the progression to increase of the は odd number, and speak it, and index n comes 2; at the time of 乗   It is thought that it is reset に. Therefore,  And   With となるような m l When I chose を,  となる. The value in the upper table fulfills this expression. However, close proof is demanded in the mathematics. I show below proof by the induction.

A theorem:   And   Then,  である.

Proof:   I use the mathematical induction that it is. At first,  Then it is the truth.  But, in the case of an even number, in the case of an odd number, I distribute it and think.

  But, in the case of an even number,  And   となるよう    I choose を. Here,  である. Therefore, from above-mentioned 漸化式   The neighbor, this the second equal sign depend on an induction hypothesis.

  But, in the case of an odd number,  And   となるよう    I choose を. Here,  である. Therefore,  The neighbor, this the second equal sign depend on an induction hypothesis. (証明終)

The most concise elucidation is the binary scale   を is a method to express.   A cyclic shift is to let you do it and is provided to the を 1 bit left.  The thing which I expressed by the を binary scale   としたとき, the solution   となる. The proof of this    I am provided using a method to express と.

The simplest elucidation of the problem not to limit k is a thing using the dynamic programming. I use following 漸化式.

 I straighten it,  

This,  から   に increase if think about how the number of the survivor changes when did it, is clear. The computational complexity of this technique   But,  But, it is small   But, there is more effective technique when it is big. It is the first step; k joint, 2k joint,…,  With a thing to execute the person of the joint, and to change the numbering,  になる.

Footnote

  1. The real straight year of a person's death of church historiographer Saint Hegesippus (English version) (Hegesippus / ヘゲシッパス) where ^ "is genuine" is quite from A.D. 110 to 180
  2. It is unknown what kind of rule it was without writing ^ The War of the Jews 3.387-391, by the way, to choose the turn that Josephus dies saying "I pulled a lottery". In addition, saved another one does not intend to be saved from a beginning, and it is said that Josephus persuaded you when it was in a turn to kill him.

References

  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. It is Augmenting Data Structures, pp.318. Chapter 14

Outside link

This article is taken from the Japanese Wikipedia Problem of Josephus

This article is distributed by cc-by-sa or GFDL license in accordance with the provisions of Wikipedia.

Wikipedia and Tranpedia does not guarantee the accuracy of this document. See our disclaimer for more information.

In addition, Tranpedia is simply not responsible for any show is only by translating the writings of foreign licenses that are compatible with CC-BY-SA license information.

0 개의 댓글:

댓글 쓰기