Concept explainers
(a)
To Show if there is an
(a)
Explanation of Solution
The linear inequalities that are required to satisfy be the set of constraints in the linear program. Let the function to be maximized, be a constant. Linear programs solver will fail to detect the feasible solution if the linear constraints are not feasible. Suppose linear programming solver returns the solution, thenthose linear constraints are feasible.
(b)
To Show if there is an algorithm for the linear-inequality feasibility problem, then it can be used to solve a linear-programming problem. The number of variables, linearinequalities, variable and constraint used in linear-inequality feasibility problem must be polynomial in n and m .
(b)
Explanation of Solution
To solve the linear program in standard form with some particulars such as A, b, c. That is, to maximize the equation
such that all entries of x
SubjecttoATY = T such that all entries in the y vector are nonzero. By Corollary 29.9 mentioned in the question, if x and y are feasible solutions to their respective problems, and if their objective functions are equal, then, the x and y optimal solutions and their objective functions should be equal. This can be achieved as, let ck be some nonzero entry in thec vector. If there are no nonzero entries, then the function to optimize is just the zero function, and it is exactly a feasibility question. Then, add the two linear inequalities (1) and (2) to get the equation below:
-(3)
The values the variables take, their objective functions will be equal. Lastly use these with the inequalities that are already present. Therefore, the constraints will be as follows:
Ax = b
ATy = c
The number of variables equal to n + m and a number of constraints equal to 2 + 2n + 2m , both are polynomial in n and m . So any assignment of variables that satisfy all of constraints will be a feasible solution to the problem and its dual and the respective objective functions take the same value therefore it is an optimal solution the original problem and its dual So the linear inequality feasibility solver returns a satisfying assignment.
If there is optimal solution x , an optimal solution for the dual can be obtained such that it makes the objective functions equal by theorem 29.10 mentioned in the above question. This guarantees that the two constraints added such that that the objectives of the original problem and the dual problem should be equal do not cause to change the optimal solution to the linear program.
Want to see more full solutions like this?
Chapter 29 Solutions
Introduction to Algorithms
- Explain the Wronskian determinant test. Using the Wronskian determinant test, write the program using NumPy to determine whether the functions f(x)=e^(- 3x), g(x)=cos2x and h(x)=sin2x are linearly independent in the range (-∞, + ∞). #UsePythonarrow_forwardGenerate the graph of f(xk) vs k where k is the iteration number and xk is the current estimate of x at iteration k. This graph should convey the decreasing nature of function values.arrow_forwardExercise 4 20= 10+4+6 The rod-cutting problem consists of a rod of n units long that can be cut into integer-length pieces. The sale price of a piece i units long is Pi for i = 1,...,n. We want to apply dynamic programming to find the maximum total sale price of the rod. Let F(k) be the maximum price for a given rod of length k. 1. Give the recurrence on F(k) and its initial condition(s). 2. What are the time and space efficiencies of your algorithm? Now, consider the following instance of the rod-cutting problem: a rod of length n=5, and the following sale prices P1=2, P2=3, P3-7, P4=2 and P5=5.arrow_forward
- (a) Stingy SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer k, find a satisfying assignment in which at most k variables are true, if such an assignment exists. Prove that stingy SAT is NP-hard. (b) The Double SAT problem asks whether a given satisfiability problem has at least two different satisfying assignments. For example, the problem {{V1, V2}, {V1, V2}, {V1, V2}} is satisfiable, but has only one solution (v₁ = F, v₂ = T). In contrast, {{V1, V2}, {V1, V2}} has exactly two solutions. Show that Double-SAT is NP-hard.arrow_forwardKnapsack 0/1 problem: Given N items where each item has some weight and profit associated with it and also given a bag with capacity W, [i.e., the bag can hold at most W weight in it]. The task is to put the items into the bag such that the sum of profits associated with them is the maximum possible. Given the problem is solved using a dynamic programming approach and the matrix derived is given below, answer the below set of questions by analyzing the DP matrix. weights = [2, 3, 4, 5], profits = [1, 2, 5, 6], Capacity W = 8 Capacity 2 3 Profits weights|0 1 2 5 16 14 |-> 5 10 0 O 10 1 2 3 4 0 O 0 1 1 0 1 0 1 O 10 1 2 2 2 5 2 O 15 50 1 356 6 O 1 3 6 18 00378 7 10 10 1 3 7 7 1 18arrow_forwardLet f: A → B be a function with A₁, A₂ ≤ A. Determine if the following statement is true or false. Prove it, if you think it's true, or give a counterexample otherwise: ƒ(A₁ N A₂) = ƒ (A₁) Ñ ƒ(A₂). Give an example of a function from N to N that is onto but not one-to-one Let A = {1,2,3, ...,8} and consider the function f: P(A) → N given by f(B) = |B|. Prove or disprove the statement that f is one-to-one.arrow_forward
- Maximum weight = 20The above problem is a 0/1 Knapsack problem. Here there are 7 different objects labelled from A to G. The objective of this problem is to carry the different objects in your bag in such a way such that the profit is maximized. But you have to make sure that your bag does not exceed the maximum weight i.e. the maximum weight that this bag can carry is less than or equal to 15. Remember you can carry an object exactly once. Now it is your job to use Genetic Algorithm to solve this problem. 1. Encode the problem and create an initial population of 4 different chromosomes 2. Think of an appropriate fitness function to this problem and give proper justification. 3. Use the fitness function to calculate the fitness level of all the chromosomes in your population 4. Perform natural selection and select the two fittest chromosomes 5. Use the parents from (4) and perform crossover to get 2 offspring 6. Perform mutation and check the fitness of the final offspring. Comment…arrow_forwardsuppose a computer solves a 100x100 matrix using Gauss elimination with partial pivoting in 1 second, how long will it take to solve a 300x300 matrix using Gauss elimination with partial pivoting on the same computer? and if you have a limit of 100 seconds to solve a matrix of size (N x N) using Gauss elimination with partial pivoting, what is the largest N can you do? show all the steps of the solutionarrow_forwardPls Use Python Explain the Wronskian determinant test. Using the Wronskian determinant test, write the program using NumPy to determine whether the functions f(x)=e^(- 3x), g(x)=cos2x and h(x)=sin2x are linearly independent in the range (-∞, + ∞). Ps: Please also explain step by step with " # "arrow_forward
- Machine Learning Problem Perform the optimization problem of finding the minimum of J(x) = (2x-3)2 by: (i) defining theta, J(theta), h(theta) as defined in the Stanford Machine Learning videos in Coursera; (ii) plotting J(theta) vs theta by hand then use a program (iii) determining its minimum using gradient descent approach starting from a random initial value of theta = 5. Perform the search for the minimum using the gradient descent approach by hand calculations, i.e., step 1, step 2, etc. showing your work completelyarrow_forwardShow that the following problem belongs to NP class: we are given a set S of integer numbers and an integer number t. Does S have a subset such that sum of its elements is t? Note: Data Structures and Algorithm problemarrow_forward(a) Suppose the matrix A is m × n and suppose that b is in the range of A. Give a formula for all solutions to the equation Ax = b in terms of the SVD of A, when m≥n and A has rank parrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole