Bill Allombert on Thu, 05 Jul 2012 13:33:59 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Hello


On Thu, Jul 05, 2012 at 02:12:48PM +0300, Ahmad Kamal wrote:
> thanks first for your reply
>  what i mean is i want to create multiple functions like that:
> 
> f1(x)=(25*x^m)+ (315*x^(m-1))+.....etc
> f2(x)=(33*x^m)+ (14*x^(m-1))+.....etc
> .
> .
> .
> fn(x)=(16*x^m)+ (19*x^(m-1))+.....etc
> 
> and the coefficients (25,33,16,315,14,19) to be random.

So you actually want to create random polynomials of degree m ?
Just do
random(B*x^m) where m is the degree and B the bound on the coefficients, e.g.

? random(1000*x^10)
%1 = 546*x^10+713*x^9+887*x^8+998*x^7+729*x^6+768*x^5+595*x^4+368*x^3+832*x^2+419*x+737
? random(1000*x^10)
%2 = 158*x^10+31*x^9+224*x^8+293*x^7+478*x^6+225*x^5+53*x^4+120*x^3+374*x^2+588*x+555

Cheers,
Bill.