Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 12, Problem 39CRP
Program Plan Intro
Class
It is defined as the problem that can be solved in a polynomial time and it is a subset of class
Class
It is defined as the set of all decision problems.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The wolf-goat-cabbage ProblemDescription of the problem: There is a farmer who wishes to cross a river but he is not alone. He also has a goat, a wolf, and a cabbage along with him. There is only one boat available which can support the farmer and either of the goat, wolf or the cabbage. So at a time, the boat can have only two objects (farmer and one other).
But the problem is, if the goat and wolf are left alone (either in the boat or onshore), the wolf will eat the goat. Similarly, if the goat and cabbage are left alone, then goat will eat the cabbage. The farmer wants to cross the river with all three of his belongings: goat, wolf, and cabbage.Complete the state space of this problem. The green state is valid state (you should expand it until to reach the goal state) and orange state is invalid state (you should not expand it).• w: wolf• g: goat• c: cabbage• f: framer• ||: rive.
Label the following statements as True of False. You do not need to justify your answer.
Every half-solvable problem is also solvable.
Program behavior problems are generally unsolvable.
It is possible for a program that solves a language L to crash on a string x Î
If a problem cannot be solved by any C++ program, then the problem also cannot be solved by any program written by other programming languages.
If a set S1 is a proper subset of set S2 and S2 is solvable, then S1 must be solvable too.
Problem 4
We can use lists of numbers like l to represent a mathematical vector. Recall from math classes that a vector is an object with a magnitude and direction. The magnitude is the sqrt of the sum of the squares (for a vector (x,y) it's the Pythagorean theorem for the magnitude (x^2 + y^2)**(1/2)). For a vector of any other length, the formula generalizes to (l[0]^2 + l[1]^2 + l[2]^2 + ... )**(1/2).
For this problem use l from Problem 1 and a for loop to compute the magnitude of l with the result stored in l_mag. For l above, its magnitude is 12.96.
Python gives you the ** exponentiation operator to raise a number to a power. You could also import math and use math.sqrt().
l = [1, 2, 3, 4, 5, 7, 8]
Please give proper explanation and typed answer only.
Chapter 12 Solutions
Computer Science: An Overview (12th Edition)
Ch. 12.1 - Prob. 1QECh. 12.1 - Prob. 2QECh. 12.1 - Prob. 3QECh. 12.1 - Prob. 4QECh. 12.2 - Prob. 1QECh. 12.2 - Prob. 2QECh. 12.2 - Prob. 3QECh. 12.2 - Prob. 4QECh. 12.2 - Prob. 5QECh. 12.3 - Prob. 1QE
Ch. 12.3 - Prob. 3QECh. 12.3 - Prob. 5QECh. 12.3 - Prob. 6QECh. 12.4 - Prob. 1QECh. 12.4 - Prob. 2QECh. 12.4 - Prob. 3QECh. 12.5 - Prob. 1QECh. 12.5 - Prob. 2QECh. 12.5 - Prob. 4QECh. 12.5 - Prob. 5QECh. 12.6 - Prob. 1QECh. 12.6 - Prob. 2QECh. 12.6 - Prob. 3QECh. 12.6 - Prob. 4QECh. 12 - Prob. 1CRPCh. 12 - Prob. 2CRPCh. 12 - Prob. 3CRPCh. 12 - In each of the following cases, write a program...Ch. 12 - Prob. 5CRPCh. 12 - Describe the function computed by the following...Ch. 12 - Describe the function computed by the following...Ch. 12 - Write a Bare Bones program that computes the...Ch. 12 - Prob. 9CRPCh. 12 - In this chapter we saw how the statement copy...Ch. 12 - Prob. 11CRPCh. 12 - Prob. 12CRPCh. 12 - Prob. 13CRPCh. 12 - Prob. 14CRPCh. 12 - Prob. 15CRPCh. 12 - Prob. 16CRPCh. 12 - Prob. 17CRPCh. 12 - Prob. 18CRPCh. 12 - Prob. 19CRPCh. 12 - Analyze the validity of the following pair of...Ch. 12 - Analyze the validity of the statement The cook on...Ch. 12 - Suppose you were in a country where each person...Ch. 12 - Prob. 23CRPCh. 12 - Prob. 24CRPCh. 12 - Suppose you needed to find out if anyone in a...Ch. 12 - Prob. 26CRPCh. 12 - Prob. 27CRPCh. 12 - Prob. 28CRPCh. 12 - Prob. 29CRPCh. 12 - Prob. 30CRPCh. 12 - Prob. 31CRPCh. 12 - Suppose a lottery is based on correctly picking...Ch. 12 - Is the following algorithm deterministic? Explain...Ch. 12 - Prob. 34CRPCh. 12 - Prob. 35CRPCh. 12 - Does the following algorithm have a polynomial or...Ch. 12 - Prob. 37CRPCh. 12 - Summarize the distinction between stating that a...Ch. 12 - Prob. 39CRPCh. 12 - Prob. 40CRPCh. 12 - Prob. 41CRPCh. 12 - Prob. 42CRPCh. 12 - Prob. 43CRPCh. 12 - Prob. 44CRPCh. 12 - Prob. 46CRPCh. 12 - Prob. 48CRPCh. 12 - Prob. 49CRPCh. 12 - Prob. 50CRPCh. 12 - Prob. 51CRPCh. 12 - Prob. 52CRPCh. 12 - Prob. 1SICh. 12 - Prob. 2SICh. 12 - Prob. 3SICh. 12 - Prob. 4SICh. 12 - Prob. 5SICh. 12 - Prob. 6SICh. 12 - Prob. 7SICh. 12 - Prob. 8SI
Knowledge Booster
Similar questions
- I want an answer for a begainer on Netbeansarrow_forwardThe Knapsack Problem is a famous computer science problem that is defined as follows: imagine you are carrying a knapsack with capacity to hold a total of weight C. You are selecting among n items with values A={a_1, a_2, ... , a_n} and associated weights W={w_1, w_2, ... , w_n}. Here the weights and values are all positive (but not necessarily unique). You wish to maximize the total value of the items you select not exceeding the given weight capacity, i.e. maximize sum_{a in A} such that sum_{w in W} <= C. Please note that you can only select your items once. a) We can reformulate this as a 2D bottom-up dynamic programming problem as follows. Define T_{i,j} as the highest possible value sum considering items 1 through i and total weight capacity j (j <= C). What is the base case i.e. T_{0,j} for all j and T_{i,0} for all i?, and What is the loop statement?arrow_forwardGiven a set of object-values, A = {1, 3, 4, 7} and VAL = 6. Implement the Dynamic Programming paradigm to determine whether it is possible to form a summation that equals to value of VAL using any combination of the elements of A where the frequency of use for each element is just one.arrow_forward
- Identify a problem that belongs to P class and justify that why that problem is not belongs to NP complete?arrow_forwardTURING MACHINEarrow_forwardDescription Implement a Taylor series approximation of some mathematical functions. In mathematics, the Taylor series is a way of approximating transcendental functions such as sin x or log x. In this approach, we can approximate a mathematical function as closely as we might want to by adding together numbers that get us closer and closer to the true value of the function. For example, the exponential function e" can be approximated as: 73 e" = 1+x + 2! 3! - nl and the sin function can be approximated as: (-1)" 73 sin z = x - 3! „5 77 2n+1 (2n + 1)! 5! 7! n=0 The more terms we include in our approximation, the better an approximation we get of sin x. In this assignment, you must implement Taylor series approximations for these two functions. Your functions should take two parameters: the value of x and the number of terms to use in the approximation: /** * Calculate an approximate value for the exponential function. @param the value to raise e to the power of (i.e., e to the x) *…arrow_forward
- Implement Thirsty problem using semaphore. Write the code in C/C++ Scenario: To drink, a thirsty person must have three things; water, ice and a glass. There are three thirsty people, each having a different one (and only one) of the three required items. A fourth person, a server has unlimited supply of all three items. If nobody is drinking, the server places two of the three items (chosen at random) onto table. Thirsty person who can make a drink from those two items will pick them up and drink a glass of ice water. When done, thirsty person will notify the server and the process will repeat.arrow_forwardThe Family of Logarithmic Functions Write a Learning Log entry about the family of functions y = logb(x). Include the descriptive statements your team has come up with and any others that you think should be added from the class discussion. As you write, think about which statements are very clear to you and which need further clarification.arrow_forwardCorrect answer will be upvoted else downvoted. Computer science. Michael is blamed for disregarding the social removing rules and making a danger of spreading Covid. He is currently shipped off jail. Fortunately, Michael knows precisely what the jail resembles from within, particularly since it's actual straightforward. The jail can be addressed as a square shape a×b which is separated into stomach muscle cells, each addressing a jail cell, normal sides being the dividers among cells, and sides on the border being the dividers prompting opportunity. Prior to condemning, Michael can ask his companions among the jail representatives to make (all around stowed away) openings in a portion of the dividers (counting dividers among cells and the furthest dividers). Michael needs to have the option to escape the jail after this, regardless of which cell he is set in. Be that as it may, he likewise needs to break as couple of dividers as could be expected. Your assignment is to…arrow_forward
- Show that the following function is Turing-computable. f(x)=x+1 . I want the drawingarrow_forwardplease explainarrow_forwardCreate a Deterministic Finite Automaton (DFA) for the language L that is defined over the input alphabet E = {a, b} and has all of the following properties: i. Second and third letters of its words are the same, ii. Its words are longer than four letters, and iii. Its last letter cannot be the letter b. My answer is true or wrong? If it is wrong can you fix it? 96 91 92 a a. 95 9. 96arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning