Processing math: 100%
Ask Your Question
0

Running a search algorithm

asked 3 years ago

mathstudent gravatar image

I want to write a program to check whether a given rational function f(x,y) in two variables x,y(=polynomial in x,ypolynomial in x,y) is of the form ik,jk,lk,mk1+xik+yjk1+xlk+ymk where ik,jk,lk,mk runs from 0 to 5(say), and k=number of summands is 16(say).

Is there a way to run a for loop that checks this? The main problem for me is that there are too many variables involved.

Preview: (hide)

Comments

Could you please provide a concrete example of the fractions you want to deal with, so that we get an idea of their structure, their degree, etc ?

tmonteil gravatar imagetmonteil ( 3 years ago )

3 Answers

Sort by » oldest newest most voted
0

answered 3 years ago

Max Alekseyev gravatar image

updated 3 years ago

You can speed up things by factoring the denominator of f(x,y) and see if for each factor you can find its multiple of the form 1+xl+ym - these will give you candidate denominators in the decomposition. Given that 1+xl+ym is irreducible (over Q at least), each factor must simply be of this form.

Preview: (hide)
link
0

answered 3 years ago

Emmanuel Charpentier gravatar image

updated 3 years ago

A "brute-force" approach to this problem is doubtful :

Such an approach would generate all possible sum of 16 terms, each representing one quadruplet i,j,k,l{0,,5}. Since there are 64=1296 such potential summation terms, there are 6416 possible 16-terms sums.But :

sage: ((6^4)^16).log(10).n()
49.8016800245532

meaning that the number of sums is about 6.441049, which seems a bit too large for systematic exploration...

Limiting the size of the exploration by other means is necessary. But this is the feathers of a totally different horse...

HTH, but doubting it,

Preview: (hide)
link
0

answered 3 years ago

tmonteil gravatar image

Prehaps coud itertools.product be of some help:

from itertools import product
P = product(range(6), repeat=4)
for i,j,k,l in P:
    print(i,j,k,l)
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 404 times

Last updated: Oct 05 '21