You are given a sequence of n integers and an integer k such that 1< k< n. The goal is to partition the sequence into k contiguous subsequences such that the largest sum of the numbers in any subsequence is minimized. Design a dynamic programming algorithm to find this minimum sum value as well as the partition that produces this minimum value. An example is given below. 1. Consider your 7 digit UH ID as a sequence of 7 integers. For example, if your UH ID is 3255967, then the sequence is 3, 2, 5, 5, 9, 6, 7. Let the given value of k be 3. Then, the best way to partition this particular sequence into 3 subsequences so that the largest subsequence sum is minimized is: {3,2, 5}{5,9}{6, 7} Note that the largest sum value is 5 + 9 = 14, attained by the second subsequence. Any other partition will increase the largest subsequence sum. What is the best way to partition your 7 digit UH ID sequence assuming k = 3? 2. Define the subproblems for your DP solution on a general instance of the problem where the sequence is of length n. Note that k is a fixed integer given as part of the input. 3. Give a recursive formulation, including the base cases, to solve this problem. 4. What is the running time of your solution? 5. Write a DP algorithm (give pseudocode) that outputs the minimum sum value. 6. Describe an algorithm to output the partition that corresponds to the minimum value.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

assuming ID is 1542553

UH ID:
You are given a sequence of n integers and an integer k such that 1< k<n. The goal
is to partition the sequence into k contiguous subsequences such that the largest sum of
the numbers in any subsequence is minimized. Design a dynamic programming algorithm
to find this minimum sum value as well as the partition that produces this minimum
value. An example is given below.
1. Consider your 7 digit UH ID as a sequence of 7 integers. For example, if your UH
ID is 3255967, then the sequence is 3, 2, 5, 5, 9, 6, 7. Let the given value of k be 3.
Then, the best way to partition this particular sequence into 3 subsequences so that
the largest subsequence sum is minimized is:
{3,2, 5}{5,9}{6, 7}
Note that the largest sum value is 5+ 9 = 14, attained by the second subsequence.
Any other partition will increase the largest subsequence sum.
What is the best way to partition your 7 digit UH ID sequence assuming k = 3?
2. Define the subproblems for your DP solution on a general instance of the problem
where the sequence is of length n. Note that k is a fixed integer given as part of the
input.
3. Give a recursive formulation, including the base cases, to solve this problem.
4. What is the running time of your solution?
5. Write a DP algorithm (give pseudocode) that outputs the minimum sum value.
6. Describe an algorithm to output the partition that corresponds to the minimum
value.
Transcribed Image Text:UH ID: You are given a sequence of n integers and an integer k such that 1< k<n. The goal is to partition the sequence into k contiguous subsequences such that the largest sum of the numbers in any subsequence is minimized. Design a dynamic programming algorithm to find this minimum sum value as well as the partition that produces this minimum value. An example is given below. 1. Consider your 7 digit UH ID as a sequence of 7 integers. For example, if your UH ID is 3255967, then the sequence is 3, 2, 5, 5, 9, 6, 7. Let the given value of k be 3. Then, the best way to partition this particular sequence into 3 subsequences so that the largest subsequence sum is minimized is: {3,2, 5}{5,9}{6, 7} Note that the largest sum value is 5+ 9 = 14, attained by the second subsequence. Any other partition will increase the largest subsequence sum. What is the best way to partition your 7 digit UH ID sequence assuming k = 3? 2. Define the subproblems for your DP solution on a general instance of the problem where the sequence is of length n. Note that k is a fixed integer given as part of the input. 3. Give a recursive formulation, including the base cases, to solve this problem. 4. What is the running time of your solution? 5. Write a DP algorithm (give pseudocode) that outputs the minimum sum value. 6. Describe an algorithm to output the partition that corresponds to the minimum value.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education