Question

In: Computer Science

For each of the following problems, indicate which are in P andwhich are in NP....

For each of the following problems, indicate which are in P and which are in NP. For
those you think are in P, give an outline of the algorithm to solve them. For those you think are
in NP, explain why you think they are not solvable in polynomial time. (Hint: think about an
algorithm to solve these problems, and then determine if it is polynomial.)
a. The Smarandache function, S(k), gives the smallest integer m, so that m! can be evenly
divided by k. For example, S(9) = 6 because 6!=720 and 9 does not divide any smaller
factorial. Calculate the Smarandache function for any number.
b. You have to seat N children in the smallest number of rows in an auditorium. For each
child, you have a list of who that child dislikes. Experience shows that if a child is in the
same row or any row behind a child that he or she dislikes, he or she will throw things at
the other child. Given this list, determine in which row to seat each child, or determine
that they cannot be seated.
c. You are in front of a wall that stretches infinitely in both directions. You know that there
is a door in the wall, but it is dark, and you have only a dim flashlight that allows you to
see no more than one step in either direction. Find the door.

Solutions

Expert Solution

Solution 1: It is a NP, this problem cannot be solved in a polynomial time because for the factorials of very large numbers the problem would require exponential amount of time to solve it.

Solution 2: It is a P, this problem can be solved in a Polynomial amount of time. Although it is a complex problem but the careful scheduling might lead to the solution of the problem in polynomial time.

SOlution 3: It is clearly a NP, since the wall is infinitely long and its midnight, therefore either the agent would be able to find the door right away or he/she can just keep looking for it all their life.


Related Solutions

What is NP? What is P? What is NP-complete? What is NP- hard?
What is NP? What is P? What is NP-complete? What is NP- hard? Give brief definitions. Give an example of an NP- complete problem. Is P equal to NP?
What is P-Problem? What is NP-Problem? What is NP-Complete problem?
What is P-Problem? What is NP-Problem? What is NP-Complete problem?
Instructions: For each of the following problems, indicate which therapeutic approach (psychodynamic, rational-emotive, systematic desensitization, modeling...
Instructions: For each of the following problems, indicate which therapeutic approach (psychodynamic, rational-emotive, systematic desensitization, modeling and social skills training, family therapy, drug therapy) that is likely to be the most useful for the following client scenarios. 1. Ernestine is terrified of elevators. She would rather walk up 100 flights of stairs than ride in an elevator. Even thinking about elevators makes her heart pound and her palms sweat. 2. Tamara is very depressed because she feels stupid, unloved, and...
. a) In each of the following changes indicate which are age related and which are...
. a) In each of the following changes indicate which are age related and which are age associated changes and age associated diseases. Us abbr AR,AS, ASD. b) Also indicate under each if the degree of age related changes could become age associated under the influence of life style ( indicate by yes if it can or no it does not) a. Reduced sex drive in females b. wrinkling of skin c. acute dementia d. impotent in males c. hypertension...
For the following problems write the balanced chemical equation, indicate which element is oxidized and which-is reduced
 For the following problems write the balanced chemical equation, indicate which element is oxidized and which-is reduced, and indicate the oxidation numbers for all species involved. (a) N2(g) + 3 H2(g) → 2 NH3(g) (b) Iron(II) Nitrate reacts with solid Aluminum to form Iron and Aluminum Nitrate. (c) Lead sulphate and water are formed by the reaction of Lead Sulfide and hydrogen peroxide. (d) Chlorine gas and Sodium Iodide react together to form Iodine and Sodium Chloride.
Show that if P=NP then there is a polynomial-time algorithm for the following search problem: given...
Show that if P=NP then there is a polynomial-time algorithm for the following search problem: given a graph, find its largest clique.
P. 4-2 For each of the following indicate the amount of revenue that Beanville should recognize...
P. 4-2 For each of the following indicate the amount of revenue that Beanville should recognize in its 2017 (1) government-wide statements and (2) governmental fund statements. Provide a brief justification or explanation for your responses. The state in which Beanville is located collects sales taxes for its cities and other local governments. The state permits small merchants to remit sales taxes quarterly. The state sales tax rate is 6 percent. In December 2016, city merchants collected $50 million in...
P. 4-2 For each of the following indicate the amount of revenue that Beanville should recognize...
P. 4-2 For each of the following indicate the amount of revenue that Beanville should recognize in its 2020 (1) government‐wide statements and (2) governmental fund statements. Provide a brief justification or explanation for your responses. The state in which Beanville is located collects sales taxes for its cities and other local governments. The state permits small merchants to remit sales taxes quarterly. The state sales tax rate is 6 percent. In December 2019, city merchants collected $50 million in...
For each of the following compounds, indicate the pH at which 50% of the compound will...
For each of the following compounds, indicate the pH at which 50% of the compound will be in a form that possesses a charge and at which pH more than 99% of the compound will be in a form that possesses a charge. CH3COOH (pKa = 4.76) CH3NH+3 (pKa = 10.7) Determine a pH at which pH more than 99% of CH3COOH will be in a form that possesses a charge. Express your answer using two decimal places.
For each of the following activities, indicate which of the objectives of managerial accounting activity is...
For each of the following activities, indicate which of the objectives of managerial accounting activity is involved. In some cases, several objectives may be involved. (You may select more than one answer. Single click the box with the question mark to produce a check mark for a correct answer and double click the box with the question mark to empty the box for a wrong answer. Any boxes left with a question mark will be automatically graded as incorrect.) 1....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT