• Implement the codes must use the LinkedList implementation
• Add an additional empty node (“dummy node”) that connects the end of the list with the beginning, transforming the list to a circular list
Code in c++
The Josephus problem is named after the historian Flavius Josephus, who lived between the years 37 and 100 CE. Josephus was a reluctant leader of the Jewish revolt against the Roman Empire. When it appeared that Josephus and his band were to be captured, they resolved to kill themselves. Josephus persuaded the group by saying, “Let us commit our mutual deaths to determination by lot. He to whom the first lot falls, let him be killed by him that hath the second lot, and thus fortune shall make its progress through us all; nor shall any of us erish 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 6, simulate this problem.
Your program should take two parameters: n, the number of people that 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?
In: Computer Science
Do bonds reduce the overall risk of an investment portfolio? Let x be a random variable representing annual percent return for Vanguard Total Stock Index (all stocks). Let y be a random variable representing annual return for Vanguard Balanced Index (60% stock and 40% bond). For the past several years, we have the following data.
| x: |
28 |
0 |
38 |
25 |
17 |
33 |
28 |
−18 |
−21 |
−19 |
| y: |
18 |
−8 |
28 |
18 |
8 |
15 |
12 |
−9 |
−9 |
−4 |
Compute a 75% Chebyshev interval around the mean for x values and also for y values. (Round your answers to two decimal places.)
In: Math
This is the data analysis using technology part of the Midterm. Use Minitab or a graphing calculator to accomplish this assignment. You can copy and paste the data into a Minitab worksheet to run the analysis. If you use a graphing calculator, take a screen shot or a picture of the calculator output.
The table below is a sample data set from 50 people. Carefully read and answer the following questions:
|
Income($K) |
Gender |
Age |
|
84 |
m |
42 |
|
49 |
m |
33 |
|
8 |
m |
25 |
|
233 |
m |
57 |
|
85 |
m |
42 |
|
340 |
m |
56 |
|
461 |
m |
48 |
|
60 |
m |
39 |
|
28 |
m |
22 |
|
97 |
m |
37 |
|
14 |
m |
26 |
|
211 |
m |
34 |
|
18 |
m |
30 |
|
16 |
m |
23 |
|
24 |
m |
31 |
|
346 |
m |
45 |
|
254 |
m |
29 |
|
29 |
m |
40 |
|
286 |
m |
57 |
|
6 |
m |
26 |
|
31 |
m |
32 |
|
104 |
m |
37 |
|
72 |
m |
29 |
|
29 |
m |
38 |
|
391 |
m |
53 |
|
19 |
f |
22 |
|
125 |
f |
36 |
|
10 |
f |
24 |
|
25 |
f |
37 |
|
17 |
f |
25 |
|
72 |
f |
30 |
|
31 |
f |
25 |
|
23 |
f |
22 |
|
260 |
f |
62 |
|
72 |
f |
37 |
|
5 |
f |
21 |
|
61 |
f |
24 |
|
366 |
f |
42 |
|
77 |
f |
33 |
|
8 |
f |
21 |
|
26 |
f |
27 |
|
22 |
f |
38 |
|
55 |
f |
42 |
|
138 |
f |
30 |
|
158 |
f |
32 |
|
146 |
f |
41 |
|
123 |
f |
38 |
|
47 |
f |
27 |
|
21 |
f |
26 |
|
82 |
f |
50 |
In: Statistics and Probability
chi-squared test ( χ2 test) problem
We're interested in the weight of babies born not prematurely but
after a pregnancy shorter than average. Of a sample of 300 children
born in April, the found as follows:
. born after 37 weeks: 30 slightly underweight; 20 normal weight.
. born after 38 weeks: 40 slightly underweight; 60 normal weight.
. born after 39 weeks: 50 born slightly underweight; 100 normal weight.
(a) Identify the two variables studied in the sample and the values of the two variables they can take, then build a full frequency table.
b) Calculate the value χ2 from the table obtained in a). Explain why we can be almost certain that there is an interdependence between the number of weeks of pregnancy and birth weight.
(c) As it has been found that there is an interdependence between the two, an attempt will be made to establish a numerical relationship between the number of weeks of pregnancy and the proportion of children born underweight. What will our variables be here and what does our study tell us?
d) Calculate the equation for the regression line obtained from the
points found in c).
In: Statistics and Probability
Firms HL and LL are identical except for their financial leverage ratios and the interest rates they pay on debt. Each has $15 million in invested capital, has $3 million of EBIT, and is in the 40% federal-plus-state tax bracket. Firm HL, however, has a debt-to-capital ratio of 50% and pays 12% interest on its debt, whereas LL has a 35% debt-to-capital ratio and pays only 10% interest on its debt. Neither firm uses preferred stock in its capital structure. Calculate the return on invested capital (ROIC) for each firm. Round your answers to two decimal places.
ROIC for firm LL is %
ROIC for firm HL is %
Calculate the rate of return on equity (ROE) for each firm. Round your answers to two decimal places.
ROE for firm LL is %
ROE for firm HL is %
Observing that HL has a higher ROE, LL's treasurer is thinking of raising the debt-to-capital ratio from 35% to 60% even though that would increase LL's interest rate on all debt to 15%. Calculate the new ROE for LL. Round your answer to two decimal places.
In: Finance
chi-squared test ( χ2 test) problem
We're interested in the weight of babies born not prematurely but
after a pregnancy shorter than average. Of a sample of 300 children
born in April, the found as follows:
. born after 37 weeks: 30 slightly underweight; 20 normal weight.
. born after 38 weeks: 40 slightly underweight; 60 normal weight.
. born after 39 weeks: 50 born slightly underweight; 100 normal weight.
(a) Identify the two variables studied in the sample and the values of the two variables they can take, then build a full frequency table.
b) Calculate the value χ2 from the table obtained in a). Explain why we can be almost certain that there is an interdependence between the number of weeks of pregnancy and birth weight.
(c) As it has been found that there is an interdependence between the two, an attempt will be made to establish a numerical relationship between the number of weeks of pregnancy and the proportion of children born underweight. What will our variables be here and what does our study tell us?
d) Calculate the equation for the regression line obtained from the
points found in c).
Handwrite or detailed explanations of formula used please
In: Statistics and Probability
Java
Write a method, makeUserName, that is passed two Strings and an int: the first is a first name, the second is a last name, and the last is a random number. The method returns a user name that contains the last character of the first name, the first five characters of the last name (assume there are five or more characters in last name), and the random number. An example: Assume that “John”, “Smith”, 45, are passed when the method is called, it will return “nSmith45” as the user name.
In: Computer Science
Last year, Paul and Joanna Stillman bought a home with a dwelling replacement value of $200,000 and insured it (via an HO-5 policy) for $176,000. The policy reimburses for actual cash value and has a $500 deductible, standard limits for coverage C items, and no scheduled property. Recently, burglars broke into the house and stole a 3-year-old television set with a current replacement value of $700 and an estimated useful life of 9 years. They also took jewelry valued at $2,400 and silver flatware valued at $3,200.?
Assuming a 50% coverage C limit, calculate how much the Stillmans would receive if they filed a claim for the stolen items?
Round the answer to two decimal places.? $________
In: Accounting
First, visit the following websites on insider trading: Securities and Exchange Commission (SEC) website regarding insider trading. SEC enforcement actions (insider trading cases) These websites will help you become familiar with the general basics of the regulatory rules applying to insider trading. You are not expected to become an expert on this topic. Apply these rules to the facts of this very brief case: Someone you know has knowledge of an impending merger between two companies. The combination of the two firms will certainly change the market dynamics of the industry. Moreover, owners of stock in both companies will greatly benefit once the news of the merger is publicly announced. Project Requirements Your presentation must consist of 6 to 7 slides that are clear, legible and address the following: Discuss the general basics of the regulatory rules applying to insider trading and its implications and address the following: Legal implications Ethical implications Economic-social implications You must include a title slide in addition to the six to seven slides. The title page must include: The title of the project The names of the group members The area where the team member provided initiative (contributed to the project). Each slide will include a bulleted list highlighting important aspects of your research. Details of your research and citations will be presented in the notes section of each slide in the presentation.
In: Finance
1. A good quality lawnmower is supposed to start at the first try. In the third quarter, 50 craftsman lawnmowers are started every day and an average of 4 did not start. In the fourth quarter, the number of lawnmower did not start (out of 50) in the first 6 days are 4, 5, 4, 6, 7, 6, respectively. Was the quality of lawnmower changed in the fourth quarter?
2.There have been complaints that the sports page of the Dubuque
Register has lots of typos. The last 6 days have been examined
carefully, and the number of typos/page is recorded below. Is the
process in control?
| Day | Mon | Tue | Wed | Thurs | Fri | Sat |
| Typos | 2 | 1 | 5 | 3 | 4 | 0 |
In: Operations Management