Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:10, anika420
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
image
Computers and Technology, 23.06.2019 09:10, babyskitt
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
image
Computers and Technology, 23.06.2019 10:50, Leffew
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, azainababbas
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
Do you know the correct answer?
In computer science and mathematics, the josephus problem (or josephus permutation) is a theoretical...

Questions in other subjects: