ArticleslgStudy

mathematics

Pseudopolynomial time number partitioning

Pseudopolynomial time number partitioning is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Pseudopolynomial time number partitioning rather than just read about it. In short: In computer science, pseudopolynomial time number partitioning is a pseudopolynomial time algorithm for solving the partition problem. The problem can be solved using dynamic programming when the size of the set and the size of the sum of the integers in the set are not too big to render the storage requirements infeasible.

Pseudopolynomial time number partitioning — main illustration
Pseudopolynomial time number partitioning — illustration

Key takeaways

  • Pseudopolynomial time number partitioning belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Pseudopolynomial time number partitioning to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Pseudopolynomial time number partitioning from memory before moving on to harder problems.

Reference excerpt

In computer science, pseudopolynomial time number partitioning is a pseudopolynomial time algorithm for solving the partition problem. The problem can be solved using dynamic programming when the size of the set and the size of the sum of the integers in the set are not too big to render the storage requirements infeasible. Suppose the input to the algorithm is a multiset S {\displaystyle S} of cardinality N {\displaystyle N} :

S = {x1, ..., xN} Let K be the sum of all elements in S. That is: K = x1 + ... + xN. We will build an algorithm that determines whether there is a subset of S that sums to ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } . If there is a subset, then:

if K is even, the rest of S also sums to ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor }

if K is odd, then the rest of S sums to ⌈ K / 2 ⌉ {\displaystyle \lceil K/2\rceil } . This is as good a solution as possible. e.g.1 S = {1, 2, 3, 5}, K = sum(S) = 11, K/2 = 5, Find a subset from S that is closest to K/2 -> {2, 3} = 5, 11 - 5 * 2 = 1 e.g.2 S = {1, 3, 7}, K = sum(S) = 11, K/2 = 5, Find a subset from S that is closest to K/2 -> {1, 3} = 4, 11 - 4 * 2 = 3

Recurrence relation We wish to determine if there is a subset of S that sums to ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } . Let:

p(i, j) be True if a subset of { x1, ..., xj } sums to i and False otherwise. Then p( ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } , N) is True if and only if there is a subset of S that sums to ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } . The goal of our algorithm will be to compute p( ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } , N). In aid of this, we have the following recurrence relation:

p(i, j) is True if either p(i, j − 1) is True or if p(i − xj, j − 1) is True p(i, j) is False otherwise The reasoning for this is as follows: there is some subset of S that sums to i using numbers

x1, ..., xj if and only if either of the following is true:

There is a subset of { x1, ..., xj−1 } that sums to i; there is a subset of { x1, ..., xj−1 } that sums to i − xj, since xj + that subset's sum = i.

The pseudo-polynomial algorithm The algorithm consists of building up a table of size ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } by N {\displaystyle N} containing the values of the recurrence. Remember that K {\displaystyle K} is the sum of all N {\displaystyle N} elements in S {\displaystyle S} . Once the entire table is filled in, we return P ( ⌊ K / 2 ⌋ , N ) {\displaystyle P(\lfloor K/2\rfloor ,N)} . Below is a depiction of the table P {\displaystyle P} . There is a blue arrow from one block to another if the value of the target-block might depend on the value of the source-block. This dependence is a property of the recurrence relation.

function can_be_partitioned_equally(S) is input: A list of integers S. output: True if S can be partitioned into two subsets that have equal sum.

n ← |S| K ← sum(S) P ← empty boolean table of size ( ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } + 1) by (n + 1)

initialize top row (P(0,x)) of P to True initialize leftmost column (P(x, 0)) of P, except for P(0, 0) to False

for j from 1 to n for i from 1 to ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor }

x = S[j-1] if (i-x) >= 0 then P(i, j) ← P(i, j-1) or P(i-x, j-1) else P(i, j) ← P(i, j-1)

return P( ⌊ K / 2 ⌋ {\displaystyle \lfloor K/2\rfloor } , n)

Example Below is the table P for the example set used above S = {3, 1, 1, 2, 2, 1}:

… excerpt ends here. Continue reading the full article.

Illustrations

Pseudopolynomial time number partitioning: Result of example execution of algorithm on the table P
Result of example execution of algorithm on the table P

Worked examples

Example 1 — a first encounter with Pseudopolynomial time number partitioning

Start with the simplest possible case. Write down what Pseudopolynomial time number partitioning claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Pseudopolynomial time number partitioning before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Pseudopolynomial time number partitioning ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Pseudopolynomial time number partitioning

In research
Pseudopolynomial time number partitioning appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Pseudopolynomial time number partitioning in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Pseudopolynomial time number partitioning is common in secondary-school and first-year university syllabi. It links to neighbouring topics Number partitioning, Pseudo-polynomial time algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Pseudopolynomial time number partitioning outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Pseudopolynomial time number partitioning” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Pseudopolynomial time number partitioning in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Pseudopolynomial time number partitioning means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Pseudopolynomial time number partitioning out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Pseudopolynomial time number partitioning in simple terms?

In computer science, pseudopolynomial time number partitioning is a pseudopolynomial time algorithm for solving the partition problem. The problem can be solved using dynamic programming when the size of the set and the size of the sum of the integers in the set are not too big to render the storag…

Why does Pseudopolynomial time number partitioning matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Pseudopolynomial time number partitioning?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Pseudopolynomial time number partitioning.

Tags

  • Number partitioning
  • Pseudo-polynomial time algorithms

Keep exploring