Polynomial generation of degree n

I am mainly looking for a summation function that will calculate polynomials based on the number of variables and degree.

Example

2 Variables; 2 Degrees:

x^2+y^2+x*y+x+y+1

Thank.

+3
source share
3 answers

See Knuth The Art of Computer Programming, Vol. 4, Fascicle 3 for a comprehensive answer.

Short answer: enough to generate all polynomial expressions in n variables with accuracy d. Then for your problem, you can either collect answers with powers of ≤d, or add the dummy variable "1".

d, , (.. x 1 +... + x n= d), . ( " " )

+4

N D, D .

[_, _,..., _, _]

N <= D . , . , (1) (2) .

, .

+1

This is also similar to the dynamic programming option for the 0-1 Knapsack task. Here we will be interested in all the possible leaves of the decision tree.

0
source

Source: https://habr.com/ru/post/1729754/


All Articles