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 10:50
A911 dispatcher is the sole sender of messages to all police officers. while on patrol, officers communicate with the dispatcher who, in turn, relays messages to other officers. the officers do not communicate directly with one another. this illustrates a network.
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
What is outfitting a workplace with video in a technology
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
You know the right answer?
In computer science and mathematics, the josephus problem (or josephus permutation) is a theoretical...
Questions
question
Mathematics, 23.02.2021 20:20
question
Advanced Placement (AP), 23.02.2021 20:20
question
Mathematics, 23.02.2021 20:20
question
Mathematics, 23.02.2021 20:20
question
English, 23.02.2021 20:20
Questions on the website: 13722362