Answer the question
In order to leave comments, you need to log in
How to generate all polynomials of the specified degree?
Let one polynomial be represented as an array containing its coefficients (over the field of residues modulo 2). Some degree is introduced, and all polynomials of this degree must be generated programmatically. All received arrays are stored in List. It’s not difficult to calculate manually, especially if you represent the coefficients as 0 and 1, but I can’t figure out how to do it programmatically.
For clarity of the question, I will give polynomials of degree 2:
001
011
101
111
We need an algorithm for programmatic generation of these coefficients.
Answer the question
In order to leave comments, you need to log in
try like this:
n=3;
for(i=0; i<1<<n; i++){
s=''
for(j=0; j<n; j++){
s+=(i>>j)&1+' '
}
s+='1'
console.log(s)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question