subject

In computer science and mathematics, the josephus problem (or josephus permutation) is a theoretical problem. following is the problem statement: there are n people standing in a circle waiting to be executed. the counting out begins at some point in the circle and proceeds around the circle in a fixed direction. in each step, a certain number of people are skipped and the next person is executed. the elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last person remains, who is given freedom. given the total number of persons n and a number k which indicates that k-1 persons are skipped and kth person is killed in circle. the task is to choose the place in the initial circle so that you are the last one remaining and so survive. for example, if n = 5 and k = 2, then the safe position is 3. firstly, the person at position 2 is killed, then person at position 4 is killed, then person at position 1 is killed. finally, the person at position 5 is killed. so the person at position 3 survives. if n = 7 and k = 3, then the safe position is 4. the persons at positions 3, 6, 2, 7, 5, 1 are killed in order, and person at position 4 survives.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
What kind of software users of all skill levels create web pages that include graphics, video, audio, animation, and other special effects? website authoring website software website publishing website editing
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
In computer science and mathematics, the josephus problem (or josephus permutation) is a theoretical...
Questions
question
Mathematics, 13.11.2019 04:31
question
English, 13.11.2019 04:31
question
Mathematics, 13.11.2019 05:31
Questions on the website: 13722359