Questions tagged [polynomial-math]

Polynomial Math is a subset of mathematics dealing with mathematical expressions constructed from variables and constants using only the operations of addition, subtraction, multiplication, and non-negative integer exponents. Any polynomial math question should be programming related.

630 questions
0
votes
1 answer

Python -- polynomials in finite fields. Why does only __add__() work with super() in this case?

I'm trying to use the parent class's __div__() in order to maintain the same type so that many operations can be called at once as in the last example mix1 = bf2/bf4*bf1%bf5 in main() below where multiple arithmetic operations are strung together. …
stackuser
  • 869
  • 16
  • 34
0
votes
1 answer

Polynomial Class: Polynomial Multiplication

I have a Polynomial class that has a get_vect member function which stores integers in a vector that is to be the representation of the coefficients of the polynomial. Now, I am trying to multiply two polynomials together using a Multiply non-member…
0
votes
1 answer

Algorithm in C to calculate coefficients of polynomial using Lagrange interpolation

I've been stuck on this for a while now. I'm writing an algorithm in C to pull out the coefficients of a polynomial using Lagrange's interpolation method. My code partially works, for instance if we do the first example here…
JaboJG
  • 92
  • 1
  • 10
0
votes
1 answer

Decision Problems Reduction in Polynomial Time

I just have a quick question. If we have two decisions problems, say L1 and L2. If L1 and can be reduced to L2 in polynomial time, then is it true that L2 CANNOT be reduced to L1 in polynomial time? My understanding is that this would mean: L1 can…
HikeTakerByRequest
  • 333
  • 1
  • 2
  • 15
0
votes
2 answers

How to choose model for multi-dimension polynomial regression?

I have the data samples like this: 1.5 2.3 4.2 0.9 1.2 0.3 1.2 0.3 0.5 1.3 2.2 1.5 4.2 2.5 3.2 6.2 Let's define x1 = {1.5 2.3 4.2 0.9} and x11 = 1.5, x12 = 2.3, x13 = 4.2, y1 = 0.9 (every lien is a sample). Now, I need to apply…
WoooHaaaa
  • 19,732
  • 32
  • 90
  • 138
0
votes
2 answers

accessing data members in a Linkedlist

if (polynomial1->get(0)->compareTo(polynomial2->get(0)) == 0) { polynomial1->get(0)->coefficient += polynomial2->get(0)->coefficient; result->insert_tail->polynomial1->get(0); } Polynomial1 and Polynomial2 are both Linked Lists and I am…
user2510809
  • 235
  • 3
  • 14
0
votes
2 answers

Python --- multiplication in GF(2) field

This function is returning unusual values in the list g. It should return 32774, 65548, 1048768 but instead it's values are more like it's treating the entire binary like a big slinky and just moving the LSB's towards the MSB's instead of actually…
stackuser
  • 869
  • 16
  • 34
0
votes
1 answer

Python -- using regex on a class instance

I have a class that was taking in lists of 1's and 0's and performing GF(2) finite field arithmetic operations. It used to work until I tried to make it take the input in polynomial format. As for how the finite arithmetic will be done after fixing…
0
votes
1 answer

Python read binary polynomial into list

I'm trying to read in a polynomial in GF(2) finite field, which is basically only 1 or 0 for the coefficients or constants and the only number that really differentiates 1 part of polynomial from the other is the exponent. But the exponent ends up…
0
votes
1 answer

Python sympy insert one Polynomial in another bigger one, get final Polynomial

I have a function to return value a based on a PolyFit, depending on values a0, c, c0: import sympy a = Symbol("a") a0 = Symbol("a0") c = Symbol("c") c0 = Symbol("c0") t = Symbol("t") a_func = Poly(0, a0, c, c0) coeff = np.array([-0.71424954, …
0
votes
1 answer

MATLAB; Lagrange Polynomial, an Interesting Error

In my school homework I was given a problem, that required me to calculate Lagrange polynomial. The data set (x,y) involved x = 0,1,2....20, while y = x - 0.3*rand() + 1; Then we were asked to observed Runge's Phenomenon. After that, we were asked…
ponir
  • 447
  • 7
  • 20
0
votes
1 answer

Solving a non-polynomial equation numerically

I've got a problem with my equation that I try to solve numerically using both MATLAB and Symbolic Toolbox. I'm after several source pages of MATLAB help, picked up a few tricks and tried most of them, still without satisfying result. My goal is to…
0
votes
1 answer

Is this generalization of Big-Theta notation correct?

Say you have an algorithm that completes in a polynomial number of steps for the input of size n, like, for example, P(n)=2n^2+4n+3. The asymptotic tight bound for this algorithm Θ(n^2). Is it true to say that the Big-Theta notation for any…
0
votes
1 answer

How to solve polynomial with 4 or 7 variables in Fastest possible way

Given equation : K = Ap + Bq + Cr + Ds. Solution I tried : Terms we already know : A, B, C, D, K Finding term s given p, q, r; p=0, q=0, r=1; compute() => s = (K - Ap - Bq - Cr)/D; continue until s becomes < 0; for all terms p=0, q=0,…
0
votes
2 answers

Find polynomial function from set of points

i have a lot of point-sets. all having a x and a y coordinate. what i need is a way in vb.net to find out a polynomial function that describes as closely as possible these points. does anybody have an idea on how to do this? each set has 18 points!
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97