Howdy ???
Very short and very easy question !!!! (easy to you, my Gurus)
Thanks,Quote:
Do you know how to decide whether 2 rational polynomials with n variables are equal ?
You Gurus :thumb: , the great !!!
Printable View
Howdy ???
Very short and very easy question !!!! (easy to you, my Gurus)
Thanks,Quote:
Do you know how to decide whether 2 rational polynomials with n variables are equal ?
You Gurus :thumb: , the great !!!
What is meant 'with n variables'? Do you mean polynomial of n-th power, or...
Anyways, you should check its coefficents.Code:P(x0,...,xn-1) = Sum(0, n-1)(Sum(0,n-1)(a[i][j]*x[i]^j))
or
P(x)=Sum(0,n-1)(a[i]*x^i)
Thanks,
and my next question is "how about Monte Carlo variety ?" I mean a kind of randomized algorithm.
You need to specify what you are talking about.
Is a rational polynomial, a polynomial with rational coefficients
or are you talking about a rational function, a ratio of polynomials.
Oh well, all of them,Quote:
Originally posted by souldog
You need to specify what you are talking about.
Is a rational polynomial, a polynomial with rational coefficients
or are you talking about a rational function, a ratio of polynomials.
So, can you tell me all of such situations, I love to hear from you really very much.
Please tell me what I should do in each situation ??
Thanks :)
I don't even think they realized that you're trying to sneakily get them to do your homework.
Thanks,Quote:
Originally posted by kasracer
I don't even think they realized that you're trying to sneakily get them to do your homework.
but can you give me a hint to [underlined]my homework[/underlined] ?????? :(
Thanks
I mean yes. that is homework but can you give me some solutions to that trivial homework ??
kasracer, I don't know who you are on this board but I read some of your posts posted by username<kasracer> and I find that you 've never given ANY specific solutions to ANY problems, I don't understand why you can keep your face straight like that ???????
Now can you tell me how to solve this problem ?????
I need to an algorithm to solve it in linear time O(n) or O(nlogn), can you give me one ???
Thanks,
have funCode:#include <vector>
template <typename T>
class poly
{
std::vector<T> coeff;
public:
inline explicit poly(const size_t &n=5) : coeff(std::vector<T>(n)) {}
inline explicit poly(const std::vector &vec) : coeff(coeff) {}
inline explicit poly(const poly<T> &another) : coeff(another.coeff) {}
inline explicit poly(const T *pArr, const size_t &n) : coeff(std::vector<T>(pArr, pArr+n)) {}
inline bool operator==(const poly<T> &another)
{
return another.coeff==coeff;
}
inline bool operator!=(const poly<T> &another)
{
return another.coeff!=coeff;
}
bool evaluate(T arg, T &ret)
{
size_t n=coeff.size();
if(!n) return false;
ret=coeff[0];
for(size_t i=1;i<n;++i)
{
ret+=arg*coeff[i];
arg*=arg;
}
return true;
}
inline T &operator[](const size_t &i)
{
return coeff[i];
}
};
int main()
{
int coeff1[]={1,4,7,4,7};
int coeff2[]={1,4,7,4,7};
poly<int> p1(coeff1, 5), p2(coeff2, 5);
int s;
p1.evaluate(1, s);
if(p1==p2)
{
//stuff
}
return 0;
}
We don't just give solutions to homework problems (you got lucky with AvDev). If you atleast try it, we'll help.Quote:
Originally posted by AppleGold
I mean yes. that is homework but can you give me some solutions to that trivial homework ??
Wow, you must really suck at searching. I try to help all the time and one of my last posts in the other C++ forum was a specific solution.Quote:
Originally posted by AppleGold
kasracer, I don't know who you are on this board but I read some of your posts posted by username<kasracer> and I find that you 've never given ANY specific solutions to ANY problems
Yes my "face" is "straight". :wave:Quote:
Originally posted by AppleGold
I don't understand why you can keep your face straight like that ???????
Thanks Avdav,
edit: Kasracer!!! What were you talking about ? I mean what you meant by one of your last posts in other C++ forum ? What forum ? Tell me, I like to have a look at it .
You said you searched moron. It isn't that difficult.Quote:
Originally posted by AppleGold
Kasracer!!! What were you talking about ? I mean what you meant by one of your last posts in other C++ forum ? What forum ? Tell me, I like to have a look at it .
Okay, Okay, cool man !!!Quote:
Originally posted by kasracer
You said you searched moron. It isn't that difficult.
If you want to be UP, so I say you ae UP, okay,
didnt know the exact problem though !!!
I don't know about mathematical stuff such as this. I would appreciate it if you were to make the subject indicate what the question is about, so I don't waste time looking at questions I can't help with.
Also, I have doubts that this question is appropriate for the C++ forum. As far as I can tell, this is not a programming question. If so, then you must expect people to tell you to get out of here.
Thank you much for your mentioning what I should do to make it clearer.Quote:
Originally posted by Sam Hobbs
I don't know about mathematical stuff such as this. I would appreciate it if you were to make the subject indicate what the question is about, so I don't waste time looking at questions I can't help with.
Also, I have doubts that this question is appropriate for the C++ forum. As far as I can tell, this is not a programming question. If so, then you must expect people to tell you to get out of here.
You shouldnot doubt because I think I post at the right place,
Thanks :)
:wave: