Question: Caveat Emptor ( NP - completeness, easier ) Due to dwindling popularity, the world s last DVD store is closing down and having a sale

Caveat Emptor (NP-completeness, easier)
Due to dwindling popularity, the worlds last DVD store is closing down and having a sale to get
rid of their remaining inventory of movies.
An avid DVD collector wants to buy a certain set S of the movies available in the store, and
to get the best deal they have gone around town and collected a large number m of discount
coupons (for some reason, nobody else was interested in them). Each coupon has a discount for
a specific movie package. For instance one coupon could say Get all 42 Star Wars movies for
the price of a single movie! More generally, each coupon is of the form Get all movies in the
set T, for the price of a single movie!.
The collector has a budget that would allow them to pay for a total of b single movies. In other
words they can choose a total of up to b different coupons and/or individual movies to buy. It is
fine to buy a few additional movies if that leads to smaller total cost, or even to buy the same
movie more than once. E.g., if S only contains the first three Star Wars movies then it could
still make sense to use the example coupon above to buy all Star Wars movies.
Prove that it is NP-complete to decide whether or not the collector can succeed in buying the
movies in S or not, for a total of at most b. In other words, the input in this problem consists
of the set S of movies to buy, the budget b, the number m of coupons, together with a list of
m sets T1, T2,..., Tm describing the coupons, where Ti
is the set of movies included in the ith
available coupon.
You may use a reduction involving any of the following known NP-hard problems which were
discussed in lectures, exercises and the book, listed here in alphabetical order: 3-Coloring,
3-Dimensional Matching, 3-Sat, (CNF-)Sat, Graph Coloring, Hamiltonian Cycle,
Hamiltonian Path, Independent Set, Knapsack, Load Balancing, Set Cover, Subset
Sum, Travelling Salesman, Vertex Cover.
I started solve the problem and here is my solution but I'm not sure if my solution is correct and I don't know how to write a psudocode fo the problem.
here is my soltuion:
Input format:
S = the set of movies to buy.
b = the budget
m = the number of coupons , together with a list of m sets T1, T2,..., Tm describing the coupons, where Ti is the set of movies included in the ith available coupons.
Solution for the problem:
To prove that the given problem is NP-complete, we need to show two things:
The problem is in NP which means that the solution can be verified in polynomial time.
The problem is NP-hard which means it is at least as hard as any other problem in NP.
The problem we are dealing with can be framed as a variant of the Subset Sum problem, which is known to be NP-complete.
Step 1: let us show that the problem is in NP
To prove that the problem is in NP class, we need to show that given a solution in our case (a subset of movies that can be bought within the budget), we can efficiently verify whether this solution is correct.
Given a subset T of movies from S that includes individual movies and movies obtained though coupons, we can:
Compute the total cost C(T) of purchasing this subset of movies. This involves considering the individual movie and applying any applicable coupons to get the effective cost.
Check if C(T)<= b. If this condition is satisfied, then T is a valid solution within the budget b.
Calculate Total Cost C(T):
For each movie in T:
If m is an individual movie and its not covered by any coupon, then we can add its cost cost(m) directly to the total cost C(T).
If m is part of a coupon Ti (i.e., all movies in Ti can be purchased for the price of one movie), so verify that the coupon can be applied:
Check if all movies in Ti are present in T. If yes, increment the count of coupon applications for Ti in T which is denoted as count (Ti, T)).
Now we can compute the effective total cost by summing up the costs of individual movies and adjusting for the coupons that have been applied:
C(T')=m T'cost (m)- Ti applied in T'count( Ti,T') x (size(Ti)-1)
cost(m) represent the cost of purchasing movie m.
Ti is a coupon where size (Ti) is the number of movies in the coupon (excluding the price of one movie)
count(Ti, T) is the number of times coupon Ti, is applied in T.
Verification of budget constraint:
After computing C(T), we check if C(T)<= b, where b is the budget.
If C(T)<= b, then T is a valid solution within the budget b.
Step 2: NP-Hardness (Reduction from Subset Sum)
To prove NP-hardness, we will reduce the well-know NP-complete problem Subset Sum to our problem.
Subset Sum problem:
Given a set of integers {x1, x2,...., xn } and a target sum B, can we find a subset
S{x1, x2,...., xn } such that the sum of elements in S is equals B?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!