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 06:50
Match the personality traits with their description
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Complete the sentence about a presentation delivery method
Answers: 2
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
question
Computers and Technology, 25.06.2019 04:20
Many prestigious universities have a system called a “legacy preference system” which is used to decide which applicants should be accepted to the university. if an applicant’s parent is an alumnus of the university, the applicant will be admitted with lower gpa and sat scores than if the parent is not an alumnus. (there is currently a lot of discussion about the fairness of this system, but universities get a lot of money from their alumni so they are unwilling to change ) your assignment for mp2 is to implement a computerized system like this for a very small prestigious university. the university has two schools, liberal arts and music, each with their own criteria for accepting students. your program must read in certain information about an applicant and print a message saying whether the applicant should be accepted or not.
Answers: 2
You know the right answer?
In computer science and mathematics, the josephus problem (or josephus permutation) is a theoretical...
Questions
question
English, 16.11.2020 21:00
question
Mathematics, 16.11.2020 21:00
Questions on the website: 13722360