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
-2
votes
1 answer

how to implement least square polynomial with no built in methods using python?

currently running into a problem solving this. The objective of the exercise given is to find a polynom of certian degree (the degree is given) from a dataset of points (that can be noist) and to best fit it using least sqaure method. I don't…
-2
votes
1 answer

Anyone knows how to code this polynomial into python:?

Are there anyone help me how to write this polynomial into python language please, I’ve tried my best, but it’s too hard P/s sorry for my bad grammar, i’m from vietnam
Khoi Le
  • 39
  • 1
  • 4
-2
votes
1 answer

How to find all the terms of a polynomial that contain a specific variable in Matlab?

Let say that we have the polynomial f=a^2*b+b^2*c+c*d. I would like to know if, in Matlab, I could find all the terms of f that contain specific polynomials of variables a, b, c and d. For example, if I have a polynomial of variable c, that is…
Vassilis Chasiotis
  • 427
  • 1
  • 3
  • 15
-2
votes
1 answer

how to get the signs in the Polynomial in toString method?

i want to add the polynomials with the coeff getA(),getB() and getC() with the +ve or -ve signs. and remove the terms with zero coff like 2x^2+5 not 2x^2+0x+5 in general like (+/-)ax^2(+/-)bx(+/-)c. public String toString() { if…
javaLearner
  • 25
  • 1
  • 7
-2
votes
1 answer

Horew to write a parsePolynomial in Java?

parsePolynomial -- this method takes one parameter (a String) and returns a new Polynomial. The parameter is a String that represents a polynomial of the form similar to 2x^2+5.You must return a new instance of a Polynomial that correctly…
javaLearner
  • 25
  • 1
  • 7
-2
votes
1 answer

Function to calculate value of polynomial from scalar or matrix in R

I need a help to create function (math) to count some basic operations. Indeed i am a beginner and i don't really know how to do it. My task is to make function, which can value of polynomial from scalar or matrix. First example polynomial is p1 =…
naxer15
  • 31
  • 5
-2
votes
2 answers

Which of the following is the most precise classification of a problem X?

Which of the following is the most precise classification of a problem X? X is in NP X is in P X is in O(n2) X is in Θ(n2). I would greatly appreciate if anyone could explain the answer of this to me? I believe it's either NP or P, but i'm really…
AlanFoster
  • 8,156
  • 5
  • 35
  • 52
-2
votes
2 answers

Polynomials in Java

My add method works, however when I create a new SparsePolynomial object (at the bottom of the add method), the value of the newSparePolynomial changes when I debug it and I can't figure out where the extra information is coming from. Can someone…
Meat
  • 9
  • 1
  • 1
  • 2
-2
votes
2 answers

Python: my polynomial coefficients are off by a factor of 10

I am learning scientific computing with python. In the exercise, I am supposed to generate a polynomial by using its roots with this formula: Here is my implementation: def poly(x,roots): #Pass real and/or complex roots x =…
Johnathan
  • 1,877
  • 4
  • 23
  • 29
-2
votes
2 answers

Non member function error - Overloading Polynomials

My intentions of this code is to use overloaded operators for assignment, addition, subtraction and multiplication of polynomials. What I have done so far are the assignment, addition overloaded operators but I am receiving errors. - Thanks …
Bigboy6
  • 109
  • 2
  • 3
  • 13
-2
votes
1 answer

Compute a polynomial via a product using Python

I started learning Python and I have been referring to "A primer on Scientific Programming with Python by HP Langtangen". I just started the topic on functions and I have been assigned a task to develop a function which computes a polynomial by…
abe25
  • 27
  • 4
-2
votes
2 answers

How to solve a polynomial equation in scheme

This is my first asked question here, so I will do my best to make you understand my need. I'm trying to do a function which should resolve any polynomial equation in scheme language, but I am a beginner so I can't do it properly... I've tried to…
-2
votes
1 answer

My c program is generating a segmentation fault and I can't figure out why

My code is meant to two create polynomials and either add, subtract or multiply them. When I run either of the options it creates both polynomials,prints out the first polynomial and then has a segmentation fault. It seems to occur between…
-2
votes
1 answer

How to calculate sum of the given series

The nth term of the series is f(n). f(n) = 1, when n=1 f(n)= ((n-1)*(8*(n–2)* 2+ 20)+4) , when n>1 P(n)=f(1)+f(2)+.....f(n) 1<=n<=10^9 for a given n we have to find P(n) modulo 10^9+7. I solved the equation and finally…
Vistanza
  • 65
  • 10
-2
votes
2 answers

If Statement Not Recognizing Plus Sign

I was trying to create a program to calculate the simplified version of a polynomial expression. I want to separate all of the variables, and constants (with plus signs) but my program seems to not be recognizing some of the plus signs in my…
1 2 3
41
42