Question: Consider the following problem that we will attempt to solve using backtracking: print all positive integers up to 1,000,000 whose only prime divisors (except from
Consider the following problem that we will attempt to solve using backtracking: print all positive integers up to 1,000,000 whose only prime divisors (except from 1) can be 5, 7 and 13. In other words, print all numbers N that can be expressed as a multiplication N = 5x 7y 13z , such that 1 N 1000000 and x 0, y 0, z 0. (Keep in mind that because x, y, z can be 0, this means numbers that have some of these prime divisors but not all are also included, e.g., 35 or 13.) Answer the following questions (in words or pseudocode):
-
(a) What would the solution vector for this problem look like?
-
(b) What are the candidates for positions in the solution vector (candidates array)?
-
(c) How would we implement is a solution?
-
(d) How would we implement process solution?

Problem 4. (24 points) Consider the following problem that we will attempt to solve using backtracking: print all positive integers up to 1,000,000 whose only prime divisors (except from 1) can be 5, 7 and 13. In other words, print all numbers N that can be expressed as a multiplication N = 5* * 7' * 13, such that 15N 0, y = 0, z > 0. (Keep in mind that because r, y, z can be 0, this means numbers that have some of these prime divisors but not all are also included, e.g., 35 or 13.) Answer the following questions (in words or pseudocode): (a) What would the solution vector for this problem look like? (b) What are the candidates for positions in the solution vector (candidates array)? (c) How would we implement is a solution? (d) How would we implement process solution? Problem 4. (24 points) Consider the following problem that we will attempt to solve using backtracking: print all positive integers up to 1,000,000 whose only prime divisors (except from 1) can be 5, 7 and 13. In other words, print all numbers N that can be expressed as a multiplication N = 5* * 7' * 13, such that 15N 0, y = 0, z > 0. (Keep in mind that because r, y, z can be 0, this means numbers that have some of these prime divisors but not all are also included, e.g., 35 or 13.) Answer the following questions (in words or pseudocode): (a) What would the solution vector for this problem look like? (b) What are the candidates for positions in the solution vector (candidates array)? (c) How would we implement is a solution? (d) How would we implement process solution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
