Menu

Exercise 4 Bonus Number N Perfect Sum Factors Except N Sum Exactly N Example 28 Perfect Si Q43827848

Exercise 4**(Bonus] A number n is perfect if the sum of its factors (except n itself) sum to exactly n. For example, 28 is pe

Its a question on algorithm and complexity. Please, proof stepby step, where necessary. Thanks

Exercise 4**(Bonus] A number n is perfect if the sum of its factors (except n itself) sum to exactly n. For example, 28 is perfect, since its factors (1, 2,4, 7, 14) sum to 28. But 12 is not perfect: Its factors (1,2, 3, 4,6) to 16, which is not 12. The PERFECT decision problem has as its input a number n written in binary and should output yes exactly when n is perfect. *Show that PERFECT is in NP. ***Is PERFECT in P? If yes, give a polynomial time algorithm to check if a given integer n is perfect. sum Show transcribed image text Exercise 4**(Bonus] A number n is perfect if the sum of its factors (except n itself) sum to exactly n. For example, 28 is perfect, since its factors (1, 2,4, 7, 14) sum to 28. But 12 is not perfect: Its factors (1,2, 3, 4,6) to 16, which is not 12. The PERFECT decision problem has as its input a number n written in binary and should output yes exactly when n is perfect. *Show that PERFECT is in NP. ***Is PERFECT in P? If yes, give a polynomial time algorithm to check if a given integer n is perfect. sum

Expert Answer


Answer to Its a question on algorithm and complexity. Please, proof step by step, where necessary. Thanks …

OR