Ask Your Question

Nathan's profile - activity

2016-12-03 08:35:15 -0500 received badge  Nice Question (source)
2013-11-12 16:17:04 -0500 received badge  Famous Question (source)
2013-09-02 00:15:47 -0500 received badge  Famous Question (source)
2013-02-21 04:00:50 -0500 received badge  Student (source)
2013-01-25 11:13:58 -0500 received badge  Notable Question (source)
2012-11-20 02:59:04 -0500 received badge  Notable Question (source)
2012-09-26 08:36:32 -0500 received badge  Popular Question (source)
2012-06-17 07:14:44 -0500 received badge  Popular Question (source)
2011-10-17 06:04:18 -0500 received badge  Supporter (source)
2011-10-17 05:16:43 -0500 asked a question Creating an array of variables

Here is a very very basic question.

I want to create a polynomial, say a_0x^0 + a_1x + a_2*x^2+ \cdots + a_{20} x^{20}.

I could define these a_i one at a time, but it would be much better to have a way to create an array A of length 20 where A[i] is the coefficient a_i. The idea is that I want to do some operations and solve for these coefficients, which will end up being rational numbers.

There must be some very basic command that I don't know, but I can't find it in the documentation.

2011-10-07 08:51:56 -0500 commented answer Finding integer solutions to systems of polynomial equations

I have tried using assume(a,'integer) but a still seems to be in the Symbolic Ring. It still gives me an answer for a which is often not an integer for different values of A and B.

2011-10-07 05:52:03 -0500 asked a question Finding integer solutions to systems of polynomial equations

Hi,

I am trying to do something very simple but have been struggling.

Here is a simplified example that I can't get to work. I want to define polynomials with integer coefficients, say f(A,B) = A+B, g(A,B) = aA+bB, where I want to assume that a and b are intgers. I want the solver to give me the values of a and b so that f-g is equal to zero as a polynomial in A and B. So, I want it to give me a== 1, b== 1.

I have tried something like this-

R.< A,B > = ZZ[]

f = A+B

var('a', domain = ZZ)

var('b', domain = ZZ)

g = aA+bB

solve(f-g==0,a,b),

but what it gives me is [a == -((b-1)*B-A)/A, [1]].

How do I define variables a and b which are integers, but unknown integers? No matter what I seem to do, they are put in Symbolic Ring. How do I get the solve command to give me integer solutions to a set of linear equations?