Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#5 & #6 return true 5. The Josephus problem is named after the historian Flavius Josephus, who lived between the years 37 and 100 CE.

#5 & #6 image text in transcribed
return true 5. The Josephus problem is named after the historian Flavius Josephus, who lived between the years 37 and 100 CE. Josephus was also a reluctant leader of the Jewish revolt against the Roman Empire. When it appeared that Josephus and his band were to be ca tured, they resolved to kill themselves. Josephus persuaded the group by saying, "Let us tual deaths to determination by lot. He to whom the first lot falls, let him 0 be killed by him that hath the second lot, and thus fortune shall make its progres through us all; nor shall any of us perish by his own right hand, for it would be unfair if, when the rest are gone, somebody should repent and save himself" (Flavius Josephus, The Wars of the Jews, Book III, Chapter 8, Verse 7, tr. William Whiston, 1737). Yet that is exactly what happened; Josephus was left for last, and he and the person he was to kill surrendered to the Romans. Although Josephus does not describe how the lots were assigned, the following approach is generally believed to be the way it was done. People form a circle and count around the circle some predetermined number. When this number is reached, that person receives a lot and leaves the circle. The count starts over with the next person. Using the circular-linked list developed in Exercise 4, simulate this problem. Your program should take two parameters: n, the number of people who start, and m, the number of counts. For example, try n = 20 and m = 12, where does Josephus need to be in the original list so that he is the last one chosen? 2 1 6. To mimic the procedure used by Josephus and his band strictly, the person eliminated 1 remains in the circle until the next one is chosen. Modify your program to take this into account. You may need to modify the circular-linked list class to make a copy of an it ator. Does this change affect the outcome? er return true 5. The Josephus problem is named after the historian Flavius Josephus, who lived between the years 37 and 100 CE. Josephus was also a reluctant leader of the Jewish revolt against the Roman Empire. When it appeared that Josephus and his band were to be ca tured, they resolved to kill themselves. Josephus persuaded the group by saying, "Let us tual deaths to determination by lot. He to whom the first lot falls, let him 0 be killed by him that hath the second lot, and thus fortune shall make its progres through us all; nor shall any of us perish by his own right hand, for it would be unfair if, when the rest are gone, somebody should repent and save himself" (Flavius Josephus, The Wars of the Jews, Book III, Chapter 8, Verse 7, tr. William Whiston, 1737). Yet that is exactly what happened; Josephus was left for last, and he and the person he was to kill surrendered to the Romans. Although Josephus does not describe how the lots were assigned, the following approach is generally believed to be the way it was done. People form a circle and count around the circle some predetermined number. When this number is reached, that person receives a lot and leaves the circle. The count starts over with the next person. Using the circular-linked list developed in Exercise 4, simulate this problem. Your program should take two parameters: n, the number of people who start, and m, the number of counts. For example, try n = 20 and m = 12, where does Josephus need to be in the original list so that he is the last one chosen? 2 1 6. To mimic the procedure used by Josephus and his band strictly, the person eliminated 1 remains in the circle until the next one is chosen. Modify your program to take this into account. You may need to modify the circular-linked list class to make a copy of an it ator. Does this change affect the outcome? er

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

More Books

Students also viewed these Databases questions

Question

=+1. How visible is your service/product?

Answered: 1 week ago

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago